Local Testnet
The repository ships a launcher that starts ten validators, one RPC node and one plain "miner" node on your machine, using deterministic test keys. It is how the chain is developed and tested, and the fastest way to try everything, including the agent_* API and the fee split, with no external dependency.
Start
cd netzero-chain/chain
go build -o build/bin/netzero ./cmd/geth
go build -o build/bin/nzc-testkeys ./cmd/nzc-testkeys
cd ..
bash deploy/testnet/run-local.sh up 10Ports: validator i serves HTTP on 8600+i, the RPC node on 8699, the miner node on 8698. Logs are in deploy/testnet/data/*/node.log.
Mining shares activate at block 29,400 in the compiled-in configuration, which a fresh local chain reaches after a day. To exercise them right away start with an override that every node gets:
NZC_EXTRA='--nzc.sharesstart 30' bash deploy/testnet/run-local.sh up 10Check
bash deploy/testnet/run-local.sh status
# node 0: head 130 peers 10 seat 0 final 129 lag 1
# ...
# node rpc: head 130 peers 10 seat -1 final 130 lag 0Get test USDn
The genesis funds a faucet with 10,000,000 test-USDn:
./chain/build/bin/nzc-testkeys send http://127.0.0.1:8699 0xYourAddress 100nzc-testkeys with no arguments prints the ten validator keys and the faucet key. They are derived from fixed strings; anyone can recreate them, which is the point on a testnet and would be fatal on a mainnet.
Try the agent API
The RPC node serves agent on loopback:
curl -s -X POST http://127.0.0.1:8699 -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"agent_createWallet","params":[],"id":1}'Fund it from the faucet, then agent_send, agent_deployContract, agent_callContract. Or skip the faucet: agent_startMining on the miner node (8698) and the wallet is paid by the protocol within a minute.
Watch the fee split
./chain/build/bin/nzc-testkeys spam http://127.0.0.1:8699 300 # 300 transfers
# then compare the Carbon Fund balance 0x…1001 before and after: +50% of all feesBreak it
Stop three validators and the chain keeps finalising. Stop a fourth and blocks continue but the finalized head freezes; restart them and finality resumes. deploy/testnet/run-local.sh down stops everything.
Parameters
The local testnet uses the public testnet's configuration: chain ID 20500, 3 s slots, epoch 200 blocks, validator decay parameters from block 20,000 every 5,000 blocks, base fee floor 1,000 gwei, incentive 0.05 USDn per block, mining shares from block 29,400 (overridable with --nzc.sharesstart).
