mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Create a local testnet (#2614)
The testnet will be on the local computer and have 1 eth1 node, 4 beacon nodes, 1 validator with 20 vc's.
This commit is contained in:
@@ -15,6 +15,32 @@ make install-lcli
|
||||
|
||||
## Starting the testnet
|
||||
|
||||
Modify `vars.env` as desired.
|
||||
|
||||
Start a local eth1 ganache server plus boot node along with `BN_COUNT`
|
||||
number of beacon nodes and `VC_COUNT` validator clients.
|
||||
|
||||
The `start_local_testnet.sh` script takes three options `-v VC_COUNT`, `-d DEBUG_LEVEL` and `-h` for help.
|
||||
The options may be in any order or absent in which case they take the default value specified.
|
||||
- VC_COUNT: the number of validator clients to create, default: `BN_COUNT`
|
||||
- DEBUG_LEVEL: one of { error, warn, info, debug, trace }, default: `info`
|
||||
|
||||
|
||||
```bash
|
||||
./start_local_testnet.sh
|
||||
```
|
||||
|
||||
## Stopping the testnet
|
||||
|
||||
This is not necessary before `start_local_testnet.sh` as it invokes `stop_local_testnet.sh` automatically.
|
||||
```bash
|
||||
./stop_local_testnet.sh
|
||||
```
|
||||
|
||||
## Manual creation of local testnet
|
||||
|
||||
These scripts are used by ./start_local_testnet.sh and may be used to manually
|
||||
|
||||
Start a local eth1 ganache server
|
||||
```bash
|
||||
./ganache_test_node.sh
|
||||
@@ -59,13 +85,13 @@ You can create additional beacon node and validator client instances with approp
|
||||
|
||||
### Adjusting number and distribution of validators
|
||||
The `VALIDATOR_COUNT` parameter is used to specify the number of insecure validator keystores to generate and make deposits for.
|
||||
The `NODE_COUNT` parameter is used to adjust the division of these generated keys among separate validator client instances.
|
||||
For e.g. for `VALIDATOR_COUNT=80` and `NODE_COUNT=4`, the validator keys are distributed over 4 datadirs with 20 keystores per datadir. The datadirs are located in `$DATADIR/node_{i}` which can be passed to separate validator client
|
||||
The `BN_COUNT` parameter is used to adjust the division of these generated keys among separate validator client instances.
|
||||
For e.g. for `VALIDATOR_COUNT=80` and `BN_COUNT=4`, the validator keys are distributed over 4 datadirs with 20 keystores per datadir. The datadirs are located in `$DATADIR/node_{i}` which can be passed to separate validator client
|
||||
instances using the `--datadir` parameter.
|
||||
|
||||
### Starting fresh
|
||||
|
||||
Delete the current testnet and all related files using:
|
||||
Delete the current testnet and all related files using. Generally not necessary as `start_local_test.sh` does this each time it starts.
|
||||
|
||||
```bash
|
||||
./clean.sh
|
||||
@@ -82,6 +108,5 @@ Update the genesis time to now using:
|
||||
./reset_genesis_time.sh
|
||||
```
|
||||
|
||||
> 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
|
||||
> it's probably easy to just use `./clean.sh && ./setup.sh`.
|
||||
> Note: you probably want to just rerun `./start_local_testnet.sh` to start over
|
||||
> but this is another option.
|
||||
|
||||
Reference in New Issue
Block a user