Merge pull request #32 from status-im/develop

Updates
This commit is contained in:
Bruno Škvorc 2019-03-30 00:48:20 +01:00 committed by GitHub
commit beb1f930ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 100 deletions

View File

@ -3,112 +3,86 @@ id: building
title: 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](https://our.status.im/nimbus-for-newbies/) post.
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/).
## Getting Started
## Installing prerequisites
- [install Nim](https://bitfalls.com/nim1)
- be on a command-line friendly system (i.e. access to Terminal / Console / Cmder / [Git Bash](https://git-scm.com) / Powershell)
_Right now, Nimbus is only available on non-Windows operating systems. We're working on Windows support. If you don't have a Linux or OS X machine, please consider using our [pre-configured Vagrant box](https://github.com/status-im/nim-vagrant)._
Alternatively, [download our pre-configured Vagrant box](https://our.status.im/setting-up-a-local-vagrant-environment-for-nim-development/).
_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.
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). Then, run:
```bash
git clone git@github.com:status-im/nimbus
git clone https://github.com/status-im/nimbus
cd nimbus
make update deps # Downloads and builds submodules, dependencies, and even Nim itself
./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
```
### Dependencies
To run Nimbus, we'll need the RocksDB database and a newer version of Nim. On OS X, execute:
```bash
brew install rocksdb
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
```
On Linux, this should do it:
```bash
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](http://www.mingw.org) or regular old make installed through Git Bash or a package manager like Chocolatey:
```bash
choco install make
```
_Note - Windows requires you to add programs you want to be able to execute from anywhere on your machine 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). [This is what mine looks like](https://imgur.com/a/yQIi6Qa)._
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.
_In the content below, `make` will refer to `make` or `mingw32.exe`, depending on which you're using. Make the change to your commands accordingly._
### Building, Testing, Running
To build Nimbus:
On OS X / Linux:
```bash
make
```
The Nimbus client will now be in `build/nimbus` on any OS and can be run with the same command:
### Building and Running Nimbus
To run Nimbus in Ethereum 1.0 mode:
```bash
make nimbus
./build/nimbus
```
It should synchronize up to block 49439 and then crash, as mentioned above. Look at flags and options with `build/nimbus --help`.
Nimbus will now run and attempt to synchronize with the Ethereum 1.0 blockchain. It can currently reach block 1.5 million.
To test, run:
### Building and Running the Ethereum 2.0 local beacon chain simulation
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/).
Enter the Ethereum 2.0 realm of Nimbus:
```bash
make test
cd vendor/nim-beacon-chain
```
To update the source files for a rebuild:
```bash
make update
```
To clean the slate and start with a fresh build:
```bash
make clean
```
### Ethereum 2.0
To run and test the Ethereum 2.0 version of Nimbus (the network simulation):
There, use this submodule's Make commands. To run the simulation:
```bash
make eth2_network_simulation
```
You should now see attestations and blocks being produced and confirmed and a bunch of other details from the nodes as they do their thing.
If you'd like to clean the previous run's data:
![Beacon nodes communicating](/img/beacon.jpg)
```bash
make clean_eth2_network_simulation_files eth2_network_simulation
```
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:
```bash
USE_MULTITAIL="yes" make eth2_network_simulation
```
You'll get something like this (click for full size):
[![](https://i.imgur.com/Pc99VDO.png)](https://i.imgur.com/Pc99VDO.png)
To change the number of validators and nodes:
```bash
VALIDATORS=512 NODES=50 make eth2_network_simulation
```
Find out more about the simulation [here](https://our.status.im/nimbus-development-update-03/).
### 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.
```bash
cd research
nim c -d:release -r state_sim --help
```
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
We have a publicly available testnet running between Nimbus nodes. Read all about it and learn how you can join it [here](https://our.status.im/the-nimbus-mvp-testnet-is-here/).
---

View File

@ -3,7 +3,6 @@ id: contributor_guide
title: Contributor Guide
---
# How To Get Involved with Nimbus' development
- look around [the repo](https://github.com/status-im/nimbus), especially the [open issues](https://github.com/status-im/nimbus/issues)
@ -11,10 +10,25 @@ title: Contributor Guide
- check out some [more open bounties](https://gitcoin.co/explorer?keywords=nimbus&order_by=-web3_created)
- learn about the source code by [dissecting](https://github.com/status-im/nimbus/tree/master/tests) and [debugging](https://github.com/status-im/nimbus/wiki/Understanding-and-debugging-Nimbus-EVM-JSON-tests) the tests
To configure your setup for development:
```bash
git clone https://github.com/status-im/nimbus
cd nimbus
make update deps
./env.sh bash # configures your environment with dependencies like a locally installed Nim, etc.
```
[Build](/docs/building.html) and start hacking!
## Thought Experiments
If you have research ideas you'd like to throw at us, exotic hardware you'd like to test on, or anything else revolutionary cooking up in your mind that you think might be bite too big for Geth or Parity to chew, let us know. We'll gladly experiment!
## Testing
You can join a testnet by following instructions [here](https://our.status.im/the-nimbus-mvp-testnet-is-here/).
## Guidelines
Whatever you might expect to see in other projects applies here:
@ -23,4 +37,4 @@ Whatever you might expect to see in other projects applies here:
- when evaluating PRs, focus exclusively on the quality of the code
- if submitting code, make sure it's tested. All code MUST come with tests. To speed up the review, ping a [team member](/docs/team).
- if submitting typo fixes or documentation changes, speed up the review process by pinging a team member. [Swader](https://github.com/swader) will usually review those very quickly.
- if submitting a tutorial for inclusion on the [official blog](), also feel free to ping [Swader](https://github.com/swader).
- if submitting a tutorial for inclusion on the [official blog](https://our.status.im/tag/nimbus), also feel free to ping [Swader](https://github.com/swader).

View File

@ -8,12 +8,14 @@ In talking to people both familiar and complete strangers to Ethereum clients, t
### Q: When do you expect to have it production-ready?
Soon. We've got some network simulations already running for [Ethereum 2.0](https://out.status.im/tag/two-point-oh), and we're syncing up to block 50000 on Ethereum 1.0. To stay in the loop, please follow our development updates on [our blog](https://our.status.im/tag/nimbus).
Soon. We've got some network simulations and a [public testnet](https://our.status.im/the-nimbus-mvp-testnet-is-here/) already running for [Ethereum 2.0](https://out.status.im/tag/two-point-oh), and we're syncing up to block 1.5 million on Ethereum 1.0. To stay in the loop, please follow our development updates on [our blog](https://our.status.im/tag/nimbus).
### Q: How is a super-light node different from just calling Infura through Web3js?
A Web3js or any similar JavaScript package for communicating with the blockchain is basically a more advanced XMLHttpRequest / Fetch wrapper. What we mean by this is that these packages retrieve information from another node and trust it implicitly. They ask "has this transaction been confirmed?" and get a response that's either "yes" or "that transaction is unknown". With light nodes, they ask "give me the data to check if this transaction has been confirmed" and then check on their own. This is a trust-minimized setup which combines the best of both worlds - very little storage and processing power required while allowing for cryptographic verification of the full node's claims.
A Web3js or any similar JavaScript package for communicating with the blockchain is basically a more advanced XMLHttpRequest / Fetch wrapper. What we mean by this is that these packages retrieve information from another node and trust it implicitly. They ask "has this transaction been confirmed?" and get a response that's either "yes" or "that transaction is unknown".
With light nodes, they ask "give me the data to check if this transaction has been confirmed" and then check on their own. This is a trust-minimized setup which combines the best of both worlds - very little storage and processing power required while allowing for cryptographic verification of the full node's claims.
### Q: What's the plan for mobile?
While true that Nimbus only compiles to C, C++ and JavaScript and iOS and Android don't support C natively (and we definitely don't want a JS version of Nimbus running on a mobile device), native compiles with Nim work for both Android and iOS, just like geth written in go works. It's all NDK/C API. We'll soon have published specific instructions on how to compile it for all manner of devices, but you can already give it a go by following the [build instructions](/docs/building.html).
While true that Nimbus only compiles to C, C++ and JavaScript and iOS and Android don't support C natively (and we definitely don't want a JS version of Nimbus running on a mobile device), native compiles with Nim work for both Android and iOS, just like geth written in go works. It's all NDK/C API. We'll soon have published specific instructions on how to compile it for all manner of devices, but you can already give it a go by following the [build instructions](/docs/building.html). Nimbus already runs just fine on OS X and any flavor of Linux, including a [NanoPC-T4 ARM](https://twitter.com/bitfalls/status/1111329152928485377) computer.

View File

@ -9,7 +9,7 @@ In addition to a dedicated Nimbus team, Status as an organization will support d
Eugene has deep background and interest in systems programming, reverse engineering, development of high-load and high-performance networking services, and information security. He joined Nim community 3 years ago and has contributed to Nim networking, threading, and multiprocessing.
### [Jacek Sieka](https://www.linkedin.com/in/sieka/)
### [Jacek Sieka](https://www.linkedin.com/in/sieka/)
With a keen interest and background in peer-to-peer applications and compilers, Jacek joined Status as Head of Research, coming most recently from the high-frequency trading world. Fun hobby projects from the past include DC++ (a file sharing app), nlvm (an llvm-based Nim compiler) and more!
@ -34,10 +34,6 @@ Dustin is the team's Pure Quickwitted Indianglassfish.
Bruno is the technical writer and team's DX guy. He's been in blockchain for 3 years after 15 years of web. His passion for decentralization and forwarding the world's truly censorship-free internet is what drove him to Nimbus. What little free time he has, he tries to spend on sports, board games and VR. You can add him on Oculus and Steam as theswader.
### [Peter Munch-Ellingsen](https://github.com/PMunch)
Peter has been working with Nim since discovering it during his studies back in 2016. Since a young age he's been interested in programming. Starting out with games, but touching in on everything from web to high-performance and distributed computing through his work and studies.
### [Ștefan Talpalaru](https://github.com/stefantalpalaru)
Ștefan comes from a decade of professional web development and a decade and a half of amateur free software contributions in a wide range of domains and programming languages. His claim to fame in the Nim world is the grafting of a Go runtime to the Nim compiler by way of the pluggable garbage collector API.

View File

@ -144,14 +144,6 @@
<span><a href="https://github.com/swader"><img src="../img/arrow_ogn.png" /></a></span>
</p>
</div>
<div class="contribute">
<img class="contributor" src="../img/peter.jpg" />
<h3>Peter Munch-Ellingsen</h3>
<p><a href="https://get.status.im/user/0x04910559b94b70d7c2cd7237f2e6ef3b8110c5fc726e7ef40fc9f3c59eeece2efb69bc9a255a8064f061e16a7b8149fae43ec81559199a50b46f6e4ff8e029c0fe" style="color: #939ba1;">Imaginative Admirable Elephant</a></p>
<p><a href="https://github.com/PMunch">See Github profile</a>
<span><a href="https://github.com/PMunch"><img src="../img/arrow_ogn.png" /></a></span>
</p>
</div>
<div class="contribute">
<img class="contributor" src="../img/stefan.jpg" />
<h3>Ștefan Talpalaru</h3>