Skip to content

Running a private network

Adam Waldenberg edited this page Oct 23, 2026 · 3 revisions

Running a private network

A private network is a set of nodes that dial only each other and trust board keys of their own. Use it to try the ledger, the sporks and the commands before they are used on the real network.

Never give a private network the real board keys. A spork is signed over its content and nothing names the network, so a spork made on a private network with the real keys would be accepted on the real one.

Keep the network apart

What How
No dialling of the seed nodes --no-seeds
Board keys of your own --network-keys <public>,<public>, on every node and on every signing command, two or more keys made with hedgehog util key-generate; --retired-network-keys names older keys that count in a spork's history
Ports that do not collide -p for the peer-to-peer port and -r for the REST port, different for each node on a machine
A data directory of its own On Linux, XDG_DATA_HOME, see Running Hedgehog

The nodes find each other only when told: start one with --no-seeds, then give each of the others the address of a node already running, hedgehog cli --restport <r> node-add <ip>:<p>.

A ledger on it

  1. Make a key for each validator, hedgehog util ledger-key-generate <file>, and keep the public keys it prints.
  2. Put a snapshot in the data directory of every node as bootstrap.dat. A snapshot that is there is not downloaded again. A node uses it only if one of its own board keys signed it, so the published snapshot, signed by the real keys, does not do: cut its signature off a copy and sign the copy with hedgehog bootstrap sign. The genesis commits to the content, which stays the same.
  3. Make the genesis from the snapshot and the public keys with hedgehog util ledger-genesis, see Running a ledger node, and give the same file to every node.
  4. Start each node with --ledger --ledger-genesis <file> --ledger-key <file>.
  5. Propose the mint supply, mint storage, fee and blacklist sporks with gridspork-set and gridspork-grow, and co-sign them with the second board key. The signing commands take the same --network-keys and --retired-network-keys as the nodes, and the board key from -k, --key-file or $HEDGEHOG_BOARD_KEY; it never leaves the machine. See Ledger sporks and Grid sporks. Until then hedgehog cli ledger info lists them as unset.
  6. Check that every node shows the same chain id, that it is running and that the validators sign.

rehearsal/ledger-rehearsal.sh in the source does all of this for four nodes on one machine, and sends a mint and a transfer through them.

Clone this wiki locally