Repository navigation
Commit e1cd987
authored
feat(rpc): qn rpc — JSON-RPC calls with managed or custom endpoints (#52)
* RPC support
* wip
* feat(rpc): add call/list-networks subcommands and custom endpoint URL
Restructure `qn rpc` into explicit subcommands and add a way to target a
custom RPC endpoint instead of the account's Tooling Access endpoint.
- `qn rpc call <method> [params]` replaces the bare `qn rpc <method>` form,
leaving room for future subcommands. Bare `qn rpc` prints help.
- `qn rpc list-networks` (alias `ls`) replaces the `--list-networks` flag.
- `qn rpc call --endpoint-url <URL>` sends a call to a fully-formed HTTP URL.
The URL is self-authenticating: no session token is minted or attached, and
the Tooling Access enable/probe recovery is bypassed entirely.
- `[rpc] endpoint_url` in config sets a client-wide default; a per-call
`--endpoint-url` overrides it.
- `--endpoint-url` and `--network` are mutually exclusive (a custom URL is not
multichain-routed), enforced at parse time.
An unknown `--network` key now surfaces a CLI error pointing at
`qn rpc list-networks` instead of the SDK's internal wording.
Consumes the published quicknode-sdk 0.7 (4-arg `rpc.call` +
`RpcConfig.endpoint_url`). Docs (README, agent context) and tests updated;
rpc.rs test count 18.
* feat(rpc): accept JSON params from a file via --params-file
Add `--params-file <PATH>` / `-f` to `qn rpc call`, mirroring `qn sql query
--file`: read the JSON-RPC params from a file, or from stdin when the path is
`-`. Mutually exclusive with the positional params argument (clap ArgGroup).
The positional params and its `-` stdin form are unchanged. A missing file
surfaces "could not read params file '<path>': ...".
Tests: file happy path, missing-file error, positional/--params-file conflict.
* fix(rpc): gate tooling-access disable and name RPC call positionals
Disabling Tooling Access cuts off blockchain access for all Quicknode
developer tooling on the account, so route it through confirm_mild
(Severity::Mild): --yes skips, TTY prompts, non-TTY without --yes returns
exit 5. Prompt names the blast radius.
Also set explicit value_name on 'qn rpc call' positionals (METHOD, PARAMS)
per the CLI value-name convention.
Tests: disable now needs --yes (exit 0); no --yes non-TTY returns exit 5
and reaches the mock zero times.1 parent 424dab4 commit e1cd987
13 files changed
Lines changed: 2284 additions & 100 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
281 | 330 | | |
282 | 331 | | |
283 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
| |||
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
152 | 165 | | |
153 | 166 | | |
154 | 167 | | |
| |||
206 | 219 | | |
207 | 220 | | |
208 | 221 | | |
| 222 | + | |
209 | 223 | | |
210 | 224 | | |
211 | 225 | | |
| |||
239 | 253 | | |
240 | 254 | | |
241 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
242 | 262 | | |
243 | 263 | | |
244 | 264 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
120 | 131 | | |
121 | 132 | | |
122 | 133 | | |
| |||
171 | 182 | | |
172 | 183 | | |
173 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
174 | 200 | | |
175 | 201 | | |
176 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
0 commit comments