feat(node): add --network parameter to node commands#132
Conversation
Replace hardcoded "mainnet" tag with a configurable --network flag on all node write operations. Defaults to "mainnet" for backward compatibility.
foxpatch-aleph
left a comment
There was a problem hiding this comment.
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.
Replace hardcoded "mainnet" tag with a configurable --network flag on all node write operations. Defaults to "mainnet" for backward compatibility.