paritytech / paritytech/polkadot-cli

feat: add `dot info` command for chain identity and properties

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

Add an info command that shows chain identity information agents need before doing anything on a chain — token symbol, decimals, SS58 prefix, runtime version.

Usage

dot info --output json
dot info --chain kusama --output json

Output

{
  "chain": "polkadot",
  "rpc": "wss://rpc.polkadot.io",
  "tokenSymbol": "DOT",
  "tokenDecimals": 10,
  "ss58Prefix": 0,
  "specName": "polkadot",
  "runtimeVersion": 1003004,
  "palletCount": 68
}

Implementation

  • Token symbol/decimals: system_properties RPC call
  • SS58 prefix: System.SS58Prefix constant (already queryable)
  • Runtime version: state_getRuntimeVersion RPC call or from metadata
  • Pallet count: from cached metadata via listPallets()
  • Register as new command in cli.ts

Files

  • src/commands/info.tsNEW command
  • src/cli.ts — register new command

Verification

  • Run dot info --output json on polkadot, kusama, asset hub
  • Verify all fields are populated and accurate
  • Verify --output pretty produces readable table

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 with the new command described for src/commands/info.ts and the command registration in src/cli.ts. Review the listed system_properties and state_getRuntimeVersion RPC calls, the System.SS58Prefix value, and cached metadata from listPallets(). Run dot info --output json and --output pretty against polkadot, kusama, and asset hub; done means all fields are populated and accurate and the pretty output is readable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 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.