Repository navigation
feat(cli): network + wallet + node/hanzo.network as top-level concerns - #2
Merged
Merged
Conversation
…concerns One coherent CLI that fits the console + cloud + fabric, one way: - network: list/current/use/add — the ONE network model shared with the console selector and the node fabric (hanzo-mining NetworkType). Sovereign L1 => network_id == chain_id; built-ins mainnet/testnet/devnet/local; custom networks (add defaults chain-id to network-id). Persisted to config. - wallet: show/address/create/import/use/list — PQ identity via cloud custody (KMS/MPC, POST /v1/wallets, keys stay server-side) OR offline local secp256k1 (tiny-bip39 mnemonic / 0x key -> m/44'/60'/0'/0/0 -> Keccak256 address). Secrets in the OS keychain (never on disk, never printed); config holds only metadata. Auto-provision when a command needs a wallet. - node: up/status/join/stop — resolve + run hanzod on the active network, record PID, SIGTERM by PID (no blind pkill), optional --with-cloud. Never builds here. - compose: deploy targets the active network and signs with the active wallet (auto-provisions on a real deploy); cluster defaults its node URL to the active network api. Integrates the stranded cluster subcommands onto main. config.rs gains network+wallet state + save(); reuses the iam::token keychain pattern for wallet secrets. Tests: BIP-39 12-word reference + hardhat + raw-key derivation vectors. cargo build + clippy green.
zeekay
added a commit
that referenced
this pull request
Jul 26, 2026
…concerns (#2) One coherent CLI that fits the console + cloud + fabric, one way: - network: list/current/use/add — the ONE network model shared with the console selector and the node fabric (hanzo-mining NetworkType). Sovereign L1 => network_id == chain_id; built-ins mainnet/testnet/devnet/local; custom networks (add defaults chain-id to network-id). Persisted to config. - wallet: show/address/create/import/use/list — PQ identity via cloud custody (KMS/MPC, POST /v1/wallets, keys stay server-side) OR offline local secp256k1 (tiny-bip39 mnemonic / 0x key -> m/44'/60'/0'/0/0 -> Keccak256 address). Secrets in the OS keychain (never on disk, never printed); config holds only metadata. Auto-provision when a command needs a wallet. - node: up/status/join/stop — resolve + run hanzod on the active network, record PID, SIGTERM by PID (no blind pkill), optional --with-cloud. Never builds here. - compose: deploy targets the active network and signs with the active wallet (auto-provisions on a real deploy); cluster defaults its node URL to the active network api. Integrates the stranded cluster subcommands onto main. config.rs gains network+wallet state + save(); reuses the iam::token keychain pattern for wallet secrets. Tests: BIP-39 12-word reference + hardhat + raw-key derivation vectors. cargo build + clippy green. Co-authored-by: Hanzo Dev <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make the
hanzoCLI (Rust) manage Hanzo's top-level concerns so it fits together with the console + cloud + fabric — ONE network model, ONE wallet model, ONE way.hanzo network(src/commands/network.rs)list/current/use <name>/add <name> --network-id --chain-id --rpc --api [--explorer --label --activate]. The ONE network model, mirroring the console selector and the node fabric (hanzo-miningNetworkType). Sovereign L1 ⇒network_id == chain_id;adddefaults chain-id to network-id.Selection + custom networks persist to
~/.config/hanzo/config.toml.hanzo wallet(src/commands/wallet.rs)show/address/create [--local] [--custody kms|mpc]/import <mnemonic|0xkey>/use <addr>/list.POST /v1/wallets,cloud/clients/wallets); the CLI only sees the address.tiny-bip39mnemonic (any word count) or 0x key →m/44'/60'/0'/0/0→ Keccak256 EVM address.iam::tokenpattern); config holds only metadata. Auto-provision viawallet::ensure.hanzo node(src/commands/node.rs)up/status/join <network>/stop. Resolves + runs hanzod on the active network (never builds here — CI/CD does), records PID, SIGTERMs by PID (no blind pkill),--with-cloudspawns the control plane.Composition
deploytargets the active network and signs with the active wallet (auto-provisions on a real deploy).clusterdefaults its node URL to the active network api. Also integrates the previously-strandedclustersubcommands onto main.Tests / gate
cargo build+cargo clippygreen (only a pre-existingsdk/go.rswarning remains).cargo test --bin hanzo: 15 passed — incl. BIP-39 12-word reference vector, hardhat mnemonic, and raw-key EVM-address derivation.@hanzo/dev
~/work/hanzo/devis the Rust coding-agent monorepo (dev/dev-tui/dev-exec, codex fork) — an orthogonal concern (AI pair-programmer), not infra. It composes with this CLI as a separate tool; no network/wallet wiring needed (would violate separation of concerns). Left untouched.