Skip to content

feat(cli): network + wallet + node/hanzo.network as top-level concerns - #2

Merged
zeekay merged 1 commit into
mainfrom
feat/net-wallet-node
Jul 8, 2026
Merged

zeekay merged 1 commit into
mainfrom
feat/net-wallet-node

Conversation

@zeekay

@zeekay zeekay commented Jul 8, 2026

Copy link
Copy Markdown
Member

What

Make the hanzo CLI (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-mining NetworkType). Sovereign L1 ⇒ network_id == chain_id; add defaults chain-id to network-id.

name network_id / chain_id rpc api
mainnet 36963 rpc.hanzo.network api.hanzo.ai
testnet 36964 rpc.hanzo-test.network api.hanzo.ai
devnet 36965 rpc.hanzo-dev.network api.hanzo.ai
local 31337 localhost:9650/ext/bc/C/rpc localhost:3690

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.

  • Cloud custody (default when signed in): the PQ identity — keys derived + held server-side (KMS/MPC via POST /v1/wallets, cloud/clients/wallets); the CLI only sees the address.
  • Local custody: offline secp256k1 — tiny-bip39 mnemonic (any word count) or 0x key → m/44'/60'/0'/0/0 → Keccak256 EVM address.
  • No plaintext: secrets live in the OS keychain (reusing the iam::token pattern); config holds only metadata. Auto-provision via wallet::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-cloud spawns the control plane.

Composition

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. Also integrates the previously-stranded cluster subcommands onto main.

Tests / gate

  • cargo build + cargo clippy green (only a pre-existing sdk/go.rs warning remains).
  • cargo test --bin hanzo: 15 passed — incl. BIP-39 12-word reference vector, hardhat mnemonic, and raw-key EVM-address derivation.
  • Smoke-tested end-to-end on host: network list/use/add + persist, wallet import/create --local/show/address (no secret in config), node up (scaffold guidance), deploy dry-run composition.

@hanzo/dev

~/work/hanzo/dev is 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.

…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
zeekay merged commit 429821c into main Jul 8, 2026
0 of 8 checks passed
@zeekay
zeekay deleted the feat/net-wallet-node branch July 8, 2026 15:37
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]>
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