nimbus-site/source/docs/building.md

82 lines
2.9 KiB
Markdown
Raw Normal View History

2018-10-10 05:21:12 +00:00
---
id: building
title: Getting Started with Nimbus
---
This document will explain how to install, test, and run Nimbus on your local machine. To learn about what Nimbus is, see the [intro post](https://our.status.im/nimbus-for-newbies/). To dig deeper, see the Nimbus [Ethereum 1.0](https://github.com/status-im/nimbus) and [Ethereum 2.0](https://github.com/status-im/nim-beacon-chain) repositories.
2018-10-10 05:21:12 +00:00
### Building and running Nimbus
2018-10-10 05:21:12 +00:00
To run Nimbus in [Ethereum 1.0 mode](https://github.com/status-im/nimbus), first [install the prerequisites](https://github.com/status-im/nimbus#prerequisites).
Then:
2018-10-10 05:21:12 +00:00
```bash
2019-03-29 23:44:29 +00:00
git clone https://github.com/status-im/nimbus
2018-10-10 05:21:12 +00:00
cd nimbus
2019-08-27 12:52:23 +00:00
make update
2019-04-27 20:28:52 +00:00
# >>> WINDOWS ONLY <<<
make fetch-dlls # WINDOWS ONLY
# >>> WINDOWS ONLY <<<
2019-03-29 23:44:29 +00:00
make nimbus
./build/nimbus
2019-01-09 13:23:59 +00:00
```
2019-03-29 23:44:29 +00:00
Nimbus will now run and attempt to synchronize with the Ethereum 1.0 blockchain. It can currently reach block 1.5 million.
2019-01-09 13:23:59 +00:00
### Building and running the Ethereum 2.0 local beacon chain simulation
2019-01-09 13:23:59 +00:00
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.
2019-01-09 13:23:59 +00:00
Prerequisites: Follow the instructions outlined [here](https://github.com/status-im/nim-beacon-chain#prerequisites-for-everyone).
2019-08-27 14:15:57 +00:00
Now, enter the Ethereum 2.0 realm of Nimbus:
2019-01-09 13:23:59 +00:00
2019-03-29 23:44:29 +00:00
```bash
2019-08-27 12:52:23 +00:00
git clone https://github.com/status-im/nim-beacon-chain
cd nim-beacon-chain
make
make test
2019-01-09 13:23:59 +00:00
```
2019-08-27 12:52:23 +00:00
To run the simulation:
2019-01-09 13:23:59 +00:00
```bash
2019-03-29 23:44:29 +00:00
make eth2_network_simulation
2019-01-09 13:23:59 +00:00
```
2019-03-29 23:44:29 +00:00
If you'd like to clean the previous run's data:
2019-01-09 13:23:59 +00:00
```bash
make clean_eth2_network_simulation_all
2019-01-09 13:23:59 +00:00
```
2019-03-29 23:44:29 +00:00
To change the number of validators and nodes:
2019-01-09 13:33:26 +00:00
```bash
# Clear data files from your last run and start the simulation with a new genesis block:
make VALIDATORS=192 NODES=6 USER_NODES=1 eth2_network_simulation
2019-01-09 13:33:26 +00:00
```
2019-03-29 23:44:29 +00:00
Find out more about the simulation [here](https://our.status.im/nimbus-development-update-03/).
2019-01-09 13:23:59 +00:00
### Building and running the Ethereum 2.0 local state transition simulation
2019-03-29 23:44:29 +00:00
The state transition simulation quickly runs the Beacon chain state transition function in isolation and outputs JSON snapshots of the state. It runs without networking and blocks are processed without slot time delays.
2019-01-09 13:23:59 +00:00
```bash
# build and run the state simulator, then display its help ("-d:release" speeds it
# up substantially, allowing the simulation of longer runs in reasonable time)
make NIMFLAGS="-d:release" state_sim
build/state_sim --help
2019-01-09 13:23:59 +00:00
```
2019-03-29 23:44:29 +00:00
Use the output of the help command to pass desired values to the sim - change number of validators, nodes, etc. to get different results.
### Medalla Ethereum 2.0 Testnet
2019-01-09 13:23:59 +00:00
There is a publicly available [Ethereum 2.0](https://our.status.im/tag/two-point-oh) multi-client testnet running until at least October. Read all about it [here](https://blog.ethereum.org/2020/08/03/eth2-quick-update-no-14/), and learn how you can join it in [the Nimbus beacon chain book](https://status-im.github.io/nim-beacon-chain/medalla.html).