Skip to content

Add a block inspect CLI command #7

@Fiyiware

Description

@Fiyiware

Context

There is no easy way to look inside a mined block from the CLI. A block inspect command would make the prototype far more demonstrable — and feeds directly into the "block explorer tour" idea mentioned in CONTRIBUTING.md.

What to do

Add a subcommand to the prototype CLI (prototype/qrb_cli.py) that, given a block height or hash, prints a human-readable view of:

  • Block height, hash, previous-block pointer, timestamp.
  • Proposer.
  • For each transaction: sender, recipient, amount, and a truncated view of the ML-DSA-65 signature (it's large — show first/last bytes, not the whole thing).
  • The resulting state diff if it's cheap to compute.

Acceptance criteria

  • python qrb_cli.py block inspect <height> prints the above for an existing block.
  • A clear error message for a non-existent block (no raw traceback).
  • A small test covering the happy path and the not-found case.

Good to know

Match the style of the existing CLI subcommands. Keep output readable in a normal terminal width — the full Dilithium signature is ~3 KB, so truncate it.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions