Skip to content

Commit 41096b4

Browse files
committed
feat: take filenames as input args for script
Update readme with changes
1 parent 0edcf3f commit 41096b4

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed

scripts/core-rpc-tools/README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ This generates:
8080
Compare the two versions and generate a detailed change report:
8181

8282
```bash
83-
# Edit generate-rpc-change-summary.py to set your file paths
84-
85-
python3 generate-rpc-change-summary.py
83+
# Pass the two JSONL files as command-line arguments
84+
python3 generate-rpc-change-summary.py \
85+
dash-cli-help-22.1.3-<timestamp>.jsonl \
86+
dash-cli-help-23.0.0-<timestamp>.jsonl
8687
```
8788

8889
This generates:
@@ -141,21 +142,19 @@ NET_ARGS="" ./dump-cli-help.sh # mainnet
141142
**Usage**:
142143

143144
```bash
144-
# Edit the script to set your input files
145-
nano generate-rpc-change-summary.py
146-
147-
# Then run
148-
python3 generate-rpc-change-summary.py
145+
python3 generate-rpc-change-summary.py <old_version.jsonl> <new_version.jsonl>
149146
```
150147

151-
**Configuration** (edit the `__main__` block at the bottom):
148+
**Examples**:
152149

153-
```python
154-
if __name__ == '__main__':
155-
old_file = 'dash-cli-help-<old_version>-<timestamp>.jsonl'
156-
new_file = 'dash-cli-help-<new_version>-<timestamp>.jsonl'
150+
```bash
151+
# Compare version 22.1.3 to 23.0.0
152+
python3 generate-rpc-change-summary.py \
153+
dash-cli-help-22.1.3-20251104T214929Z.jsonl \
154+
dash-cli-help-23.0.0-20251104T213450Z.jsonl
157155

158-
# ... rest of script
156+
# The script automatically extracts version info from the JSONL metadata
157+
# and creates an appropriately named output file
159158
```
160159

161160
## Output Files Reference

scripts/core-rpc-tools/dump-cli-help.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#!/usr/bin/env bash
22
#
3-
# dump-dash-cli-help.sh
3+
# dump-cli-help.sh
44
#
55
# Iterate over all dash-cli RPC commands (including subcommands where applicable)
66
# and dump their help text into:
77
# - A single readable text file (OUT)
88
# - Optionally, a newline-delimited JSON file (OUT_JSONL) for machine parsing
99
#
1010
# Usage:
11-
# chmod +x dump-dash-cli-help.sh
12-
# ./dump-dash-cli-help.sh
11+
# chmod +x dump-cli-help.sh
12+
# ./dump-cli-help.sh
1313
#
1414
# Overrides:
15-
# CLI=/path/to/dash-cli NET_ARGS="-testnet" OUT="help.txt" ./dump-dash-cli-help.sh
15+
# CLI=/path/to/dash-cli NET_ARGS="-testnet" OUT="help.txt" ./dump-cli-help.sh
1616
#
1717
# Dependencies:
1818
# Needs a running Dash node with RPC access (same as using dash-cli manually).

scripts/core-rpc-tools/generate-rpc-change-summary.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
Generate executive summary of RPC changes between versions.
44
"""
55

6+
import argparse
67
import json
78
import re
8-
import os
99
from collections import defaultdict
1010

1111
# ---------- JSONL parsing & metadata ----------
@@ -472,11 +472,14 @@ def generate_summary(old_file, new_file, old_version=None, new_version=None):
472472
# ---------- CLI ----------
473473

474474
if __name__ == '__main__':
475-
# Sample usage — update paths as needed
476-
old_file = 'dash-cli-help-22.1.3-20251104T214929Z.jsonl'
477-
new_file = 'dash-cli-help-23.0.0-rc.3-20251104T213450Z.jsonl'
478-
479-
report, old_ver, new_ver = generate_summary(old_file, new_file)
475+
parser = argparse.ArgumentParser(
476+
description="Generate executive summary of Dash Core RPC changes between two JSONL dumps."
477+
)
478+
parser.add_argument("old_jsonl", help="Path to OLD version JSONL file")
479+
parser.add_argument("new_jsonl", help="Path to NEW version JSONL file")
480+
args = parser.parse_args()
481+
482+
report, old_ver, new_ver = generate_summary(args.old_jsonl, args.new_jsonl)
480483

481484
# Build output filename from metadata versions if available
482485
safe_old = re.sub(r'[^A-Za-z0-9._-]+', '_', old_ver)

0 commit comments

Comments
 (0)