paritytech / paritytech/polkadot-cli

feat: batch query support via stdin JSON

Open
#68 0 comments 0 reactions 0 assignees View on GitHub

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 --batch flag 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 --batch flag 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.