Depending on your objective, there are various ways to run Nimbus in Ethereum 2.0 mode.
We’re writing a book that explains all the ways in which you can use Nimbus to either monitor the eth2 chain or become a fully-fledged validator.
It’s hosted here: https://status-im.github.io/nimbus-eth2/
The beacon chain simulation runs several beacon nodes on the local machine, attaches several local validators to each, and builds a beacon chain between them.
Prerequisites: At the moment, Nimbus has to be built from source, and has the following external dependencies – developer tools (C compiler, Make, Bash, Git), PCRE; follow the instructions outlined here to install them.
Once you’ve installed the prerequisites, you’re ready to enter the Ethereum 2.0 realm of Nimbus:
git clone https://github.com/status-im/nim-beacon-chain
To run the simulation:
If you’d like to clean the previous run’s data:
To change the number of validators and nodes:
# Clear data files from your last run and start the simulation with a new genesis block:
USE_MULTITAIL="yes" make eth2_network_simulation
You’ll get something like this (click for full size):
You can find out more about the beacon node simulation here.
This simulation is primarily designed for researchers, but we’ll cover it briefly here in case you’re curious :)
The state transition simulation quickly runs the beacon chain state transition function in isolation and outputs JSON snapshots of the state (directly to the
nim-beacon-chain directory). It runs without networking and blocks are processed without slot time delays.
# build the state simulator, then display its help ("-d:release" speeds it
Use the output of the
help command to pass desired values to the simulator - experiment with changing the number of slots, validators, , etc. to get different results.
The most important options are:
slots: the number of slots to run the simulation for (default 192)
validators: the number of validators (default 6400)
attesterRatio: the expected fraction of attesters that actually do their work for every slot (default 0.73)
json_interval: how often JSON snapshots of the state are outputted (default every 32 slots – or once per epoch)
For example, to run the state simulator for 384 slots, with 20,000 validators, and an average of 66% of attesters doing their work every slot, while outputting snapshots of the state twice per epoch, run:
build/state_sim --slots=384 --validators=20000 --attesterRatio=0.66 --json_interval=16