Skip to content

feat: CLI tool to decode multiaddrs into structured JSON - #128

Open
sumanjeet0012 wants to merge 1 commit into
multiformats:masterfrom
sumanjeet0012:fix-issue-119
Open

feat: CLI tool to decode multiaddrs into structured JSON#128
sumanjeet0012 wants to merge 1 commit into
multiformats:masterfrom
sumanjeet0012:fix-issue-119

Conversation

@sumanjeet0012

Copy link
Copy Markdown

Fixes #119

Description

This PR adds a multiaddr executable that provides a CLI for inspecting multiaddrs, matching the functionality of go-multiaddr's CLI. It takes either a string or hex-packed bytes (prefixed with 0x) and outputs structured JSON containing the canonical string representation, the packed hex value, and a breakdown of each component protocol.

Changes

  • Updated pyproject.toml to register multiaddr.cli:main as a console script.
  • Created multiaddr/cli.py with the implementation logic using argparse.
  • Created tests/test_cli.py for verifying standard string input, hex input, invalid input, and compact output.
  • Updated README.rst with an example of how to use the CLI tool.
  • Added a newsfragment for towncrier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: CLI tool to decode multiaddrs into structured JSON

1 participant