Skip to content

Create a Private Chain

Yilun Zhang edited this page Sep 4, 2018 · 2 revisions

This page shows you how to create a private chain. You shouldn't do this until you have a very good reason.

We will assume here that all nodes are running on locally on your machine.

  1. Create several directories (one per node you want to run).

  2. Copy (or create symbolic link) nknd, nknc to each directory. Skip this step if you are using docker.

  3. Create a new wallet in each directory.

  4. Create a config.json in each directory from the template config.local.json. All of them should put the same public key as the GenesisBlockProposer. Note that ports in different config.json can be the same, conflict in ports will be resolved automatically.

Start a bootstrap node by creating a network

$ ./nknd -c

Start other nodes by joining the network

$ ./nknd

Or provide a seed node to override the one in config.json

$ ./nknd -seed http://$RemoteNodeIP:$HttpJsonPort

When the network contains enough nodes (more than the length of successor list plus one, by default 9+), stop the node that created the network in order for the relay service to work properly. Nodes joining the network later should use a live node as seed.