book updates

This commit is contained in:
Jacek Sieka 2020-07-03 18:03:06 +02:00
parent f9e159be90
commit f06cc34406
No known key found for this signature in database
GPG Key ID: A1B09461ABB656B8
7 changed files with 90 additions and 17 deletions

View File

@ -1,5 +1,5 @@
[book]
authors = ["Lee Ting Ting"]
[book]
authors = ["Lee Ting Ting", "Jacek Sieka"]
language = "en"
multilingual = false
src = "src"

View File

@ -2,8 +2,8 @@
- [Introduction](./intro.md)
- [Installation](./install.md)
- [Become a Validator](./validator.md)
- [Command-line Options](./cli.md)
- [Running the beacon node](./beacon_node.md)
- [Becoming a Validator](./validator.md)
- [API](./api.md)
- [Advanced Usage for Developers](./advanced.md)
- [FAQs](./faq.md)

View File

@ -1,16 +1,69 @@
# Command-line Options
# The beacon node
You can run your customized beacon node using the `beacon_node` executable. The available options are shown below - you can also run `beacon_node --help` for a reminder.
The beacon node application connects to an Ethereum 2 network, manages the block chain and provides API's to interact with the beacon chain.
You can run the beacon node without being a validator - doing so will allow you to sync the network and access its latest state.
## Prerequisites
Specifying a genesis file is mandatory to run this executable. You can either get it from the official eth2 repository [here](https://github.com/eth2-clients/eth2-testnets/blob/master/shared/witti/genesis.ssz) or generate your own like [this](https://github.com/status-im/nim-beacon-chain/blob/db92c2f2549a339be60896c3907cefdb394b5e11/scripts/launch_local_testnet.sh#L154) when starting a local testnet. You can also specify the path of your genesis file like [this](https://github.com/status-im/nim-beacon-chain/blob/db92c2f2549a339be60896c3907cefdb394b5e11/scripts/launch_local_testnet.sh#L229).
Before compiling and running the application, make sure you've completed the [installation guidelines](./install.md) for the prerequisites.
For example, download a genesis file and then run the following command to start the node:
## Running the node
<img src="./img/beacon_node_example.PNG" alt="" style="margin: 0 40 0 40"/>
When running the beacon node, you connect to a specific ethereum 2 network - this may be a private network or a public testnet like [altona](https://github.com/goerli/altona/tree/master/altona).
## Usage
When running the node for the first time, you need to specify network parameters, boot nodes and genesis information. This information can typically be found in the [eth2 testnets](https://github.com/eth2-clients/eth2-testnets) repository. This information is automatically downloaded when using the simplified startup.
Once the beacon node is running, it will first connect to the boot nodes in the network, look for more peers and start syncing the chain. Once sync is complete, it will keep following the head of the chain and can be interacted with through the [API](./api.md).
Before running the beacon node, it is important that computer has the correct time set - preferably from a trusted time source (this can be an NTP server you trust, GPS time or any other precise source of time).
To start syncing the `altona` network, run the build process. When asked for a key, just press enter.
```
$ make altona
# Build output...
Please enter your Goerli Eth1 private key in hex form (e.g. 0x1a2...f3c) in order to become a validator (you'll need access to 32 GoETH).
Hit Enter to skip this.
>
```
Hit enter above - you will be prompted again if you want to become a validator. Beacon node will launch and start syncing.
```
INF 2020-07-03 15:28:15+02:00 Starting beacon node topics="beacnde" tid=176865 file=beacon_node.nim:866 SECONDS_PER_SLOT=12 SLOTS_PER_EPOCH=32 SPEC_VERSION=0.12.1 cat=init dataDir=/home/arnetheduck/status/nim-beacon-chain/build/data/shared_altona_0 finalizedRoot=72e7b21c finalizedSlot=20064 headRoot=f92bf720 headSlot=20142 nim="Nim Compiler Version 1.2.2 [Linux: amd64] (be34b5ab)" pcs=start_beacon_node timeSinceFinalization=-108322 version="0.5.0 (c64737e)"
peers: 7 finalized: 3a806c9f:634 head: b364f8e9:636:29 time: 909:7 (29095) ETH: 0.0
```
### Status bar
The status bar shows important health information about your node:
* peers - The number of peers you're connected to
* finalized - The block root and epoch of the latest finalized checkpoint - when the network is healthy, this value will stay at 2-3 epochs from the wall clock
* head - The block root and time of the head block - as blocks are produced and processed, this will be updated to the latest head block as chosen by the consensus algorithm.
* time - The current wall time according to your computer - when the node is synced, the head block will closely follow this time.
* ETH: the total ETH validators attached to the node have accumulated. When there are no validators attached, this number will be 0.
Time is shown as `epoch:subslot`, starting from the block chain genesis time - one epoch is typically 32 slots but this may vary between networks.
The status bar content may be updated using command line flags.
### Metrics
Nimbus includes metrics support using the Prometheus format. To enable it, you need to enable insecure feature when compiling the application. The http server that exports Prometheus metrics should not be exposed to external parties.
```
# Compile with insecure features enabled
make NIMFLAGS="-d:insecure" altona
```
## Command line options
```
$ ./beacon_node --help
@ -141,3 +194,7 @@ beacon_node_shared_altona_0 wallets list
Lists details about all wallets.
```
## Next steps
Once you're synced, you can move on to become a [validator](./validator.md).

View File

@ -1,16 +1,16 @@
# Frequently Asked Questions
## 1. What is Beacon Chain?
## What is Beacon Chain?
A complete introduction about the beacon chain can be found in the [Ethereum 2.0 blog series](https://our.status.im/two-point-oh-the-beacon-chain/).
In short, the beacon chain is a **new type of blockchain** to help the Ethereum blockchain to smoothly transfer its consensus algorithm from PoW (Proof of Work) to PoS (Proof of Stake), aka Ethereum 2.0.
## 2. Differences Between Beacon Chain and Ethereum 1.0
## Differences Between Beacon Chain and Ethereum 1.0
In traditional PoW, those that propose new blocks are called **_miners_**, whereas in PoS, they are called **_validators_**. In essence, _miners_ rely on actual hardware (such as some specifically manufactured mining machines), while _validators_ rely on just software and a good network connection.
## 3. What it is Like to Be a Validator?
## What it is Like to Be a Validator?
It is obvious that you must have enough computing power or dedicated hardware in order to be a miner, but how about being a validator? Here is a brief overview:
@ -19,7 +19,7 @@ It is obvious that you must have enough computing power or dedicated hardware in
3. Run the beacon node and wait for the network to sync before your validator is activated.
4. That's all! Remember to stay connected to the network, or you may lose some of your deposit, as punishment, depending on how long you're offline. :P
## 4. What is Nimbus?
## What is Nimbus?
In a sentence, Nimbus is an Ethereum 1.0 & 2.0 Client for Resource-Restricted Devices.

View File

@ -2,6 +2,18 @@
Beacon chain can run on Linux, macOS, Windows, and Android. At the moment, Nimbus has to be built from source.
## Time
The beacon chain relies on your computer having the correct time set, down to at most 0.5 seconds.
It is recommended that you run a high quality time service on your computer such as:
* GPS
* NTS (network time security, IETF draft)
* Roughtime (google)
As a minimum, you should run an NTP client on the server - NTP may easily be disrupted however.
## External Dependencies
- Developer tools (C compiler, Make, Bash, Git)
@ -51,4 +63,4 @@ apt install build-essential git libpcre3-dev
## Next steps
Once you've installed build tools, you're ready to move on to launching the beacon node and becoming a [validator](./validator.md)
Once you've installed the prerequisites, you're ready to move on to launching the [beacon node](./beacon_node.md).

View File

@ -13,8 +13,8 @@ In this book, we will cover:
1. [What is beacon chain](./faq.md#1-what-is-beacon-chain) and [what is Nimbus](./faq.md#4-what-is-nimbus) to equip you with some basic knowledge.
2. [Installation steps](./install.md) outline the prerequisites to get started.
3. How to [become a validator](./validator.md) in Ethereum 2.0 as a user, for example on the Altona testnet.
4. [CLI](./cli.md) for running your customized nimbus beacon node.
3. [Running the beacon node](./beacon_node.md) describes how to run the beacon node software to sync the beacon chain.
4. How to [become a validator](./validator.md) in Ethereum 2.0 as a user, for example on the Altona testnet.
5. [API](./api.md) for monitoring your node through `http`.
6. [Advanced usage](./advanced.md) for developers.
7. Common [questions and answers](./faq.md) to satisfy your curiosity.

View File

@ -2,6 +2,8 @@
To become a validator, you need to install the beacon chain software, acquire 32 ETH, set up your validator account and register with the deposit contract on Ethereum.
Before becoming a validator, you can [run the beacon node](./beacon_node.md) itself and sync the network.
There is currently no Eth2 mainnet - all networks are testnets.
## Recommended Testnets
@ -13,6 +15,8 @@ Though Nimbus can connect to any of the testnets published in the [eth2-clients/
## Altona
The steps to connect to any testnet are similar - we'll use altona as an example.
### Initial setup
Before we start, we have to obtain 32 ETH on the Goerli testnet. Then, we can deposit 32 Ethers to the registration smart contract to become a validator.