nimbus-site/source/docs/building.md

94 lines
3.3 KiB
Markdown
Raw Normal View History

2018-10-10 05:21:12 +00:00
---
id: building
title: Getting Started with Nimbus
---
2019-03-29 23:44:29 +00:00
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/).
2018-10-10 05:21:12 +00:00
2019-03-29 23:44:29 +00:00
## Installing prerequisites
2018-10-10 05:21:12 +00:00
2019-04-27 20:28:52 +00:00
If you are on Windows, instead of using the commands below you can also use our [pre-configured Vagrant box](https://github.com/status-im/nim-vagrant) if you prefer to run things in a Linux environment.
2018-10-10 05:21:12 +00:00
2019-04-27 20:28:52 +00:00
We use Makefiles to quickly and easily build our binaries. Before you begin, please make sure you have [RocksDB installed](https://github.com/status-im/nimbus#rocksdb). On Windows, you can skip this step and instead rely on the "WINDOWS ONLY" part of the process below:
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-04-27 20:28:52 +00:00
make update # Downloads and builds submodules, dependencies, and even Nim itself
# >>> WINDOWS ONLY <<<
make fetch-dlls # WINDOWS ONLY
# >>> WINDOWS ONLY <<<
2019-03-29 23:44:29 +00:00
./env.sh bash # Optional, but useful. Sets the current shell's environment to use the version of Nim language the `make update deps` command just built
2019-01-09 13:23:59 +00:00
```
2019-03-29 23:44:29 +00:00
### Building and Running Nimbus
2019-01-09 13:23:59 +00:00
2019-03-29 23:44:29 +00:00
To run Nimbus in Ethereum 1.0 mode:
2019-01-09 13:23:59 +00:00
```bash
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
2019-03-29 23:44:29 +00:00
### Building and Running the Ethereum 2.0 local beacon chain simulation
2019-01-09 13:23:59 +00:00
2019-03-29 23:44:29 +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. This is a precursor to our [testnet](https://our.status.im/the-nimbus-mvp-testnet-is-here/).
2019-01-09 13:23:59 +00:00
2019-03-29 23:44:29 +00:00
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
cd vendor/nim-beacon-chain
2019-01-09 13:23:59 +00:00
```
2019-03-29 23:44:29 +00:00
There, use this submodule's Make commands. 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
2019-03-29 23:44:29 +00:00
make clean_eth2_network_simulation_files eth2_network_simulation
2019-01-09 13:23:59 +00:00
```
2019-03-29 23:44:29 +00:00
If you'd like to see the nodes running on separated sub-terminals inside one big window, install [Multitail](https://www.vanheusden.com/multitail/), then:
2019-01-09 13:23:59 +00:00
```bash
2019-03-29 23:44:29 +00:00
USE_MULTITAIL="yes" make eth2_network_simulation
2019-01-09 13:23:59 +00:00
```
2019-03-29 23:44:29 +00:00
You'll get something like this (click for full size):
2019-01-09 13:33:26 +00:00
2019-03-29 23:44:29 +00:00
[![](https://i.imgur.com/Pc99VDO.png)](https://i.imgur.com/Pc99VDO.png)
2019-01-09 13:33:26 +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
2019-03-29 23:44:29 +00:00
VALIDATORS=512 NODES=50 make 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
2019-03-29 23:44:29 +00:00
### Building and Running the Ethereum 2.0 local state transition simulation
The state transition simulation measures how fast it can process the tasks in the beacon chain's state transition.
2019-01-09 13:23:59 +00:00
```bash
2019-03-29 23:44:29 +00:00
cd research
nim c -d:release -r 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.
### Nimbus Ethereum 2.0 Testnet
2019-01-09 13:23:59 +00:00
2019-07-12 08:18:42 +00:00
We have a publicly available testnet running between Nimbus nodes. Read all about it and learn how you can join it [here](/docs/t0.html). There is also a cutting edge [testnet 1](/docs/t1.html) that's basically a testing ground for testnet 0.
2019-01-09 13:23:59 +00:00
2019-01-09 17:32:14 +00:00
---
2019-01-09 13:23:59 +00:00
Congrats! You're now running Nimbus for both the Ethereum 1.0 platform, and the coming [Ethereum 2.0](https://our.status.im/tag/two-point-oh).