2020-05-26 08:30:44 +00:00
|
|
|
# Simple Local Testnet
|
|
|
|
|
|
|
|
These scripts allow for running a small local testnet with two beacon nodes and
|
|
|
|
one validator client. This setup can be useful for testing and development.
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
The scripts require `lci` and `lighthouse` to be installed on `PATH`. From the
|
|
|
|
root of this repository, run:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo install --path lighthouse --force --locked
|
|
|
|
cargo install --path lcli --force --locked
|
|
|
|
```
|
|
|
|
|
|
|
|
## Starting the testnet
|
|
|
|
|
|
|
|
Assuming you are happy with the configuration in `var.env`, create the testnet
|
|
|
|
directory, genesis state and validator keys with:
|
|
|
|
|
|
|
|
```bash
|
2020-08-11 02:16:33 +00:00
|
|
|
./setup.sh
|
2020-05-26 08:30:44 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Start the first beacon node:
|
|
|
|
|
|
|
|
```bash
|
2020-08-11 02:16:33 +00:00
|
|
|
./beacon_node.sh
|
2020-05-26 08:30:44 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
In a new terminal, start the validator client which will attach to the first
|
|
|
|
beacon node:
|
|
|
|
|
|
|
|
```bash
|
2020-08-11 02:16:33 +00:00
|
|
|
./validator_client.sh
|
2020-05-26 08:30:44 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
In a new terminal, start the second beacon node which will peer with the first:
|
|
|
|
|
|
|
|
```bash
|
2020-08-11 02:16:33 +00:00
|
|
|
./second_beacon_node.sh
|
2020-05-26 08:30:44 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Additional Info
|
|
|
|
|
|
|
|
### Debug level
|
|
|
|
|
|
|
|
The beacon nodes and validator client have their `--debug-level` set to `info`.
|
|
|
|
Specify a different debug level like this:
|
|
|
|
|
|
|
|
```bash
|
2020-08-11 02:16:33 +00:00
|
|
|
./validator_client.sh debug
|
|
|
|
./beacon_node.sh trace
|
|
|
|
./second_beacon_node.sh warn
|
2020-05-26 08:30:44 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Starting fresh
|
|
|
|
|
|
|
|
Delete the current testnet and all related files using:
|
|
|
|
|
|
|
|
```bash
|
2020-08-11 02:16:33 +00:00
|
|
|
./clean.sh
|
2020-05-26 08:30:44 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Updating the genesis time of the beacon state
|
|
|
|
|
|
|
|
If it's been a while since you ran `./setup` then the genesis time of the
|
|
|
|
genesis state will be far in the future, causing lots of skip slots.
|
|
|
|
|
|
|
|
Update the genesis time to now using:
|
|
|
|
|
|
|
|
```bash
|
2020-08-11 02:16:33 +00:00
|
|
|
./reset_genesis_time.sh
|
2020-05-26 08:30:44 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
> Note: you probably want to drop the beacon node database and the validator
|
|
|
|
> client slashing database if you do this. When using small validator counts
|
2020-08-11 02:16:33 +00:00
|
|
|
> it's probably easy to just use `./clean.sh && ./setup.sh`.
|