paritytech / paritytech/polkadot-cli
Offline constant lookups from cached metadata
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 2
- Avg merge
- 12h 35m
- Merged PRs (30d)
- 4
Description
Problem
dot const (src/commands/const.ts:29) creates a chain client (live connection), but constants are embedded in metadata — they don't need a live chain. This means dot const fails when the chain is unreachable, even though the data is already cached locally.
Proposal
When cached metadata exists for the target chain, decode the constant directly from metadata without establishing a connection.
# Should work offline after first use
dot const Balances.ExistentialDeposit --chain polkadot
Implementation
- Check if cached metadata exists for the target chain before connecting
- If cached metadata is available, decode the constant value directly from it
- Fall back to live connection only if no cache exists
- Consider adding a
--offlineflag to explicitly require offline mode (error if no cache)
Acceptance Criteria
-
dot constworks without a live chain when metadata is cached - Falls back to live connection when no cache exists
- Output is identical whether online or offline
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/const.ts:29 and trace how cached metadata and the live chain client are obtained. Run dot const Balances.ExistentialDeposit --chain polkadot with and without connectivity, then verify cached metadata is used offline, live lookup remains the fallback, and both paths produce identical output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100