paritytech / paritytech/polkadot-cli

Offline constant lookups from cached metadata

Open
#23 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

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 --offline flag to explicitly require offline mode (error if no cache)

Acceptance Criteria

  • dot const works 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

  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/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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.