Add stellar network id to return the network id.#2407
Conversation
eb17dee to
f0c8ff9
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a new stellar network id command that outputs the network ID (SHA-256 hash of the network passphrase), implementing issue #2390. This command addresses a common pain point where users had to manually compute the network ID using shell tools like sha256sum, which was error-prone.
Changes:
- Adds a new
stellar network idsubcommand with support for plain text and JSON output formats - Integrates the command into the network module with proper error handling
- Includes a basic integration test to verify the command works with testnet
- Updates the CLI documentation with the new command usage
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| cmd/soroban-cli/src/commands/network/mod.rs | Registers the new id subcommand in the network module enum and error handling |
| cmd/soroban-cli/src/commands/network/id.rs | Implements the network ID command with SHA-256 hashing and multiple output formats |
| cmd/crates/soroban-test/tests/it/integration/network.rs | Adds integration test to verify the network ID command works correctly |
| FULL_HELP_DOCS.md | Documents the new command including options and usage examples |
12683ef to
3bf299d
Compare
Maybe this command should be |
|
@leighmcculloch the idea was the passphrase emitted on If you prefer, I can move this pr into |
That's a really good idea 👍🏻. It's going to be super easy to grab the wrong id otherwise. I forgot that |
|
oof… was totally unaware of the |
What
Why
Implement #2390.
Known limitations
N/A