3.6 KiB
id | title |
---|---|
building | Getting Started with Nimbus |
This document will explain how to install, test, and run Nimbus on your local machine. For a full guide, see the Nimbus for Newbies post.
Getting Started
- install Nim
- be on a command-line friendly system (i.e. access to Terminal / Console / Cmder / Git Bash / Powershell)
Alternatively, download our pre-configured Vagrant box.
Note: the Nimbus build system uses Makefiles to make the process identical across platforms, easy to update, and compatible with any OS. We don't use Nim's package manager Nimble because it's fundamentally broken.
Installing
Clone Nimbus.
git clone git@github.com:status-im/nimbus
cd nimbus
Dependencies
To run the Nimbus, we'll need the RocksDB database and a newer version of Nim. On OS X, execute:
brew install rocksdb
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
On Linux, this should do it:
sudo apt-get install librocksdb-dev rocksdb # or your own Linux distribution's equivalent
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
On Windows, please first make sure you have make
installed - either in the form of MinGW32make.exe
via MinGW website or regular old make installed through Git Bash or a package manager like Chocolatey:
choco install make
Note - Windows requires you to add things to your PATH environment variable. This is done by simply opening the Start Menu, searching for "Env", selecting "Edit the system environment variables", clicking on Environment Variables in the popup, and then editing the PATH variable in the list by adding a new entry that corresponds to the folder into which you installed your version of make
(Choco takes care of this for you, only applies if you installed manually)
Next, run:
make fetch-dlls
or
mingw32make.exe fetch-dlls
This downloads the rocksdb and sqlitedb DLL files into nimbus/build
so that the built program can read them.
Building, Testing, Running
To build Nimbus:
On OS X / Linux:
make
On Windows:
make
or
mingw32make.exe
The Nimbus client will now be in build/nimbus
on any OS and can be run with the same command:
./build/nimbus
It should synchronize up to block 49439 and then crash, as mentioned above. Look at flags and options with build/nimbus --help
.
To test, run:
make test # (or mingw32make.exe test on Win if you use mingw32)
Ethereum 2.0
To run and test the Ethereum 2.0 version of Nimbus:
git clone git@github.com:status-im/nim-beacon-chain
cd nim-beacon-chain
This one still uses Nimble, so:
nimble install
It is possible that Nimble will get stuck without output, or that it will ask you strange questions like overwriting a dependency that's already installed in the very same project you're installing it to. In any case, confirm if possible, or restart the installation process by canceling (CTRL+C) and re-running the command.
Once done, run:
nimble test
This executes the test written for the Ethereum 2.0 client version of Nimbus. To run the simulation which spins up a few beacon nodes and builds a beacon chain locally (local testnet), run:
sh tests/simulation/start.sh
Congrats! You're now running Nimbus for both the Ethereum 1.0 platform, and the coming Ethereum 2.0.