This guide is about running your own private local testnet.
- If you wish to join the ongoing public testnet, please read become a validator.
This guide will help you setup your own private local testnet.
First, install Lighthouse.
Then, get the current unix time in seconds; you can use
$ date +%s. It
should look like this
1576803034 and you should use it wherever we put
If you choose a time that's more than several minutes in the past the validator client will refuse to produce blocks. We will loosen this restriction in the future, the issue is tracked here.
Start a new node with:
$ lighthouse bn --http testnet -r quick 8 <time>
--httpflag starts the API so the validator can produce blocks.
-rflag creates a random data directory to avoid clashes with other nodes.
8is number of validators with deposits in the genesis state.
$ lighthouse bn testnet --helpfor more configuration options, including
In a new terminal window, start the validator client with:
$ lighthouse vc testnet insecure 0 8
insecurecommand uses predictable, well-known private keys. Since this is just a local testnet, these are fine.
0 8indicates that this validator client should manage 8 validators, starting at validator 0 (the first deposited validator).
- The validator client will try to connect to the beacon node at
--helpto configure that address and other features.
You may connect another (non-validating) node to your local network by starting a new terminal and running:
lighthouse bn -z --libp2p-addresses /ip4/127.0.0.1/tcp/9000 testnet -r quick 8 <time>
--zero-ports) flag sets all listening ports to be zero, which then means that the OS chooses random available ports. This avoids port collisions with the first node.
--libp2p-addressesflag instructs the new node to connect to the first node.