paritytech / paritytech/polkadot-cli
feat: batch query support via stdin JSON
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 2
- Avg merge
- 12h 35m
- Merged PRs (30d)
- 4
Description
Parent Epic: #63
Summary
Allow agents to query multiple storage items in a single CLI invocation, reducing round-trips and connection overhead.
Usage
echo '[{"target":"System.Number"},{"target":"System.Account","keys":["5FHn..."]}]' | dot query --batch --output json
Output
JSON array of results matching input order:
[
{"target":"System.Number","value":12345678},
{"target":"System.Account","keys":["5FHn..."],"value":{"nonce":42,"data":{"free":"1000000000000"}}}
]
Implementation
- Add
--batchflag to query command that reads JSON from stdin - Parse each item, resolve against metadata, execute queries
- Share a single RPC connection across all queries
- Keep existing single-target positional syntax untouched
Files
src/commands/query.ts— add--batchflag and stdin parsing
Verification
- Batch query 3 different storage items, verify all results returned
- Mix plain storage and map queries in one batch
- Verify error handling: one bad target shouldn't fail the whole batch
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/commands/query.ts, reviewing the existing query command and its single-target positional syntax. Add the --batch stdin path, then verify three storage items, mixed plain and map queries, shared results in input order, and that one bad target does not fail the whole batch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100