Using the CLI (nhb-cli)
The nhb-cli is your essential command center for direct on-chain interaction. It connects to a running node via its RPC API to query the state and broadcast new, signed transactions. This guide covers the primary commands.
Generate a Wallet
This command creates a new ECDSA private key (your secret) and saves it to a file named wallet.key in your current directory. It will also display the corresponding public nhb... address.
./nhb-cli generate-keyGenerated new key and saved to wallet.key
Your public address is: nhb19xcxfznkgtr8je0ry28jts3r2mgldy6zzfaa27Check Balance
Queries the node for the complete state of any address. This includes liquid balances for both NHBCoin and ZapNHB, the total amount staked, and the current nonce.
./nhb-cli balance nhb19xcxfznkgtr8je0ry28jts3r2mgldy6zzfaa27State for: nhb19xcxfznkgtr8je0ry28jts3r2mgldy6zzfaa27
Username:
NHBCoin: 100000
ZapNHB: 5000
Staked: 0 ZapNHB
Nonce: 0Stake ZapNHB
Creates and broadcasts a native transaction to lock up a specified amount of your liquid ZapNHB into a staked position. Staking is the prerequisite to becoming a validator candidate.
./nhb-cli stake 5000 wallet.keySuccessfully sent stake transaction for 5000 ZapNHB.
Check the node logs for confirmation and wait for the next block.Un-stake ZapNHB
Creates and broadcasts a native transaction to unlock a specified amount of your staked ZapNHB, returning it to your liquid balance.
./nhb-cli un-stake 1000 wallet.keySuccessfully sent un-stake transaction for 1000 ZapNHB.Redirect Validator Rewards
Lets a validator redirect its own epoch reward payouts to a different wallet it actually uses day-to-day, without moving its stake or its consensus signing key. Because only the validator's own key can authorize where its rewards go, this is a local signed transaction, not a bare RPC call — it must be run on the validator server itself, using its own local key file (e.g. /etc/nhbchain/validator.key), which should never leave that server. Pass an empty string ("") as the address to clear a previously-set beneficiary redirect.
./nhb-cli set-reward-beneficiary nhb1abcyourwalletaddress... /etc/nhbchain/validator.keySuccessfully sent set-reward-beneficiary transaction.Send a Heartbeat
Sends a zero-value native transaction whose sole purpose is to signal on-chain activity. This is the primary way to increase your Engagement Score within the POTSO consensus mechanism. In normal operation a running validator node submits these heartbeats automatically on a regular cadence — this is what keeps a staked validator eligible to join and stay in the active set. Running this command manually is intended for troubleshooting and testing, not routine use.
./nhb-cli heartbeat wallet.keySuccessfully sent heartbeat transaction.Deploy a Smart Contract
Deploys EVM bytecode to the network. This command reads a hex-encoded bytecode string from a file and broadcasts it as a contract creation transaction.
./nhb-cli deploy ./storage_contract.hex wallet.keySuccessfully sent contract deployment transaction.