Skip to content

feat(node): add --network parameter to node commands#132

Merged
odesenfans merged 2 commits intomainfrom
od/node-network-param
Mar 26, 2026
Merged

feat(node): add --network parameter to node commands#132
odesenfans merged 2 commits intomainfrom
od/node-network-param

Conversation

@odesenfans
Copy link
Copy Markdown
Contributor

Replace hardcoded "mainnet" tag with a configurable --network flag on all node write operations. Defaults to "mainnet" for backward compatibility.

Replace hardcoded "mainnet" tag with a configurable --network flag
on all node write operations. Defaults to "mainnet" for backward
compatibility.
Copy link
Copy Markdown

@foxpatch-aleph foxpatch-aleph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR cleanly adds a configurable --network parameter to all node write operations, replacing the hardcoded 'mainnet' tag. The implementation is consistent across all affected functions (create_ccn, create_crn, link_crn, unlink_crn, stake, unstake, drop_node, amend_node), with proper default values for backward compatibility. All existing tests have been updated to pass the network parameter, and the test assertions correctly verify the network tag appears in the message content. The changes are minimal, focused, and follow the existing code patterns.

crates/aleph-cli/src/cli.rs (line 703): Consider adding a note to the help text about valid network values, e.g., "Network tag (e.g. mainnet, testnet, devnet). Defaults to mainnet."

crates/aleph-sdk/src/corechannel.rs (line 80): The network parameter is used directly without validation. If there are specific allowed network values, consider adding validation or documentation about expected values. Currently this just passes through whatever string is provided.

@odesenfans odesenfans merged commit d08d520 into main Mar 26, 2026
9 checks passed
@odesenfans odesenfans deleted the od/node-network-param branch March 26, 2026 21:30
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.

2 participants