Skip to content

Commit 6b6e9b4

Browse files
committed
v0.6.4 Script and instructions for joining Pyrmont; WIP page in the book
1 parent 11e1a9e commit 6b6e9b4

File tree

6 files changed

+253
-38
lines changed

6 files changed

+253
-38
lines changed

CHANGELOG.md

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,54 @@
1-
Next
1+
2020-11-17 v0.6.4
22
=================
33

4-
* Avoid pcre dependency
5-
* Increase quarantine size to 32 and fix parents not being downloaded
6-
consistently
4+
New additions:
5+
6+
* Support for the Pyrmont testnet.
7+
8+
* The PCRE library is no longer necessary for building Nimbus.
9+
10+
* Sensitive files such as keystores are now accessible only to the
11+
user of the beacon node on POSIX systems (the group rights have
12+
been dropped).
13+
14+
We've fixed:
15+
16+
* An issue preventing blocks to be downloaded when the client goes
17+
out of sync.
18+
19+
* Resource leaks that may lead to reduction of network activity due
20+
to a build-up of malfunctioning peer connections.
21+
722

823
2020-11-12 v0.6.2
924
=================
1025

1126
A bugfix release addressing issues discovered in the Toledo network.
1227

13-
New additions:
28+
New features include:
1429

15-
* Added an estimated syncing time to the beacon node status bar.
30+
* GossipSub 1.1
1631

17-
* Added metadata for the upcoming Pyrmont network. This will be a
18-
short-lived network with parameters very closely resembling mainnet.
32+
* The beacon node status bar (footer) now contains a
33+
time-left-until-synced estimate.
1934

20-
* Switched to version 1.1 of the GossipSub protocol.
21-
22-
* Added an JSON-RPC method `setLogLevel` for dynamically changing the
35+
* A JSON-RPC method `setLogLevel` for dynamically changing the
2336
log level of selected components at run-time.
2437

25-
Bug fixes:
38+
* The ability to launch Nimbus with a partially-synced Geth node.
39+
40+
We've fixed:
2641

27-
* Fixed a bug preventing the node from proposing blocks when connected
42+
* A bug preventing the node from proposing blocks when connected
2843
to a web3 provider
2944

30-
* Fixed an invalid "corrupted database" error message appearing on start-up
45+
* An invalid "corrupted database" error message appearing on start-up
3146

32-
* Fixed incorrectly set message-ids in gossip message causing other clients
47+
* Incorrectly set message-ids in gossip message causing other clients
3348
to penalise and potentially disconnect our nodes from the network.
3449

35-
* Improved the behaviour of Nimbus when paired with a Geth node which is not
36-
fully synced.
50+
* An issue occuring when Nimbus is paired with a Geth node
51+
that is not fully synced.
3752

3853

3954
2020-11-09 Hope (v0.6.0)

README.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,40 +112,34 @@ apt install build-essential git
112112

113113
### Connecting to testnets
114114

115-
Once the [prerequisites](#prerequisites) are installed you can connect to the [Medalla testnet](https://github.com/goerli/medalla) with the following commands:
115+
Once the [prerequisites](#prerequisites) are installed you can connect to the [Pyrmont testnet](https://github.com/protolambda/pyrmont) with the following commands:
116116

117117
```bash
118118
git clone https://github.com/status-im/nimbus-eth2
119119
cd nimbus-eth2
120-
make medalla # This will build Nimbus and all other dependencies
121-
# and connect you to Medalla
120+
make pyrmont # This will build Nimbus and all other dependencies
121+
# and connect you to Pyrmont
122122
```
123123

124124
You can also start multiple local nodes, in different terminal windows/tabs, by specifying their numeric IDs:
125125

126126
```bash
127-
make medalla NODE_ID=0 # the default
128-
make medalla NODE_ID=1
129-
make medalla NODE_ID=2
127+
make pyrmont NODE_ID=0 # the default
128+
make pyrmont NODE_ID=1
129+
make pyrmont NODE_ID=2
130130
```
131131

132132
To change the TCP and UDP ports from the default value of 9000:
133133

134134
```bash
135-
make BASE_PORT=9100 medalla
136-
```
137-
138-
If you wish to make a deposit, execute the following command:
139-
140-
```
141-
make medalla-deposit VALIDATORS=2 # The default is just 1 deposit
135+
make BASE_PORT=9100 pyrmont
142136
```
143137

144138
### Getting metrics from a local testnet client
145139

146140
```bash
147141
# the primitive HTTP server started to serve the metrics is considered insecure
148-
make NIMFLAGS="-d:insecure" medalla
142+
make NIMFLAGS="-d:insecure" pyrmont
149143
```
150144

151145
Now visit http://127.0.0.1:8008/metrics to see the raw metrics. You should see a plaintext page that looks something like this:
@@ -181,7 +175,7 @@ See [this page](https://status-im.github.io/nimbus-eth2/metrics-pretty-pictures.
181175
To feed the data into a Prometheus instance, run:
182176

183177
```bash
184-
cd build/data/shared_medalla_0
178+
cd build/data/shared_pyrmont_0
185179
prometheus --config.file=./prometheus.yml --storage.tsdb.path=./prometheus
186180
# when starting multiple nodes at the same time, just use the config file from the one with the highest ID
187181
```
@@ -192,7 +186,7 @@ You can then visualise the data by getting Grafana up and running with the dashb
192186
### Stress-testing the client by limiting the CPU power
193187

194188
```bash
195-
make medalla CPU_LIMIT=20
189+
make pyrmont CPU_LIMIT=20
196190
```
197191

198192
The limiting is provided by the cpulimit utility, available on Linux and macOS.

beacon_chain/version.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ when not defined(nimscript):
99
const
1010
versionMajor* = 0
1111
versionMinor* = 6
12-
versionBuild* = 3
12+
versionBuild* = 4
1313
versionBlob* = "hope" # Single word - ends up in the default graffitti
1414

1515
useInsecureFeatures* = defined(insecure)

docker/dist/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ make dist
2828

2929
No `-march=native` and no metrics support.
3030

31-
## Running a Medalla node
31+
## Running a Pyrmont node
3232

3333
With default options:
3434

3535
```bash
36-
./run-medalla-beacon-node.sh
36+
./run-pyrmont-beacon-node.sh
3737
```
3838

3939
The script will forward all supplied options to the beacon node executable:
4040

4141
```bash
42-
./run-medalla-beacon-node.sh --log-level=DEBUG --tcp-port=9050
42+
./run-pyrmont-beacon-node.sh --log-level=DEBUG --tcp-port=9050
4343
```
4444

4545
To monitor the Eth1 validator deposit contract, you'll need to pair
@@ -54,7 +54,7 @@ By default, the script will ask you to enter a web3 provider URL interactively,
5454
but this can be bypassed by specifying a websocket `WEB3_URL` environment variable:
5555

5656
```bash
57-
WEB3_URL="<YOUR_WEB3_URL>" ./run-medalla-beacon-node.sh
57+
WEB3_URL="<YOUR_WEB3_URL>" ./run-pyrmont-beacon-node.sh
5858
```
5959

6060
## Running a mainnet node
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# Become a Pyrmont validator
2+
3+
This chapter will take you through how to become a validator on the eth2 testnet [Pyrmont](https://github.com/protolambda/pyrmont).
4+
5+
If you generated your signing key using the [eth2 launchpad](https://pyrmont.launchpad.ethereum.org/), and wish to import it into the Nimbus client, this page is for you.
6+
7+
> If you haven't created your validator key yet, we recommend you do so using the [launchpad](https://pyrmont.launchpad.ethereum.org/). If you're not sure what the eth2 launchpad is, we recommend reading this [introductory post](https://blog.ethereum.org/2020/07/27/eth2-validator-launchpad/) first.
8+
9+
## Prerequisites
10+
11+
> ⚠️ If this is your first time playing with Nimbus, please make sure you [install our external dependencies](./install.md) first.
12+
13+
This tutorial assumes basic knowledge of the [command line](https://www.learnenough.com/command-line-tutorial/basics#:~:text=Learn%20Enough%20Command%20Line%20to%20Be%20Dangerous%20is%20an%20introduction,broad%20an%20audience%20as%20possible.).
14+
15+
## Validating
16+
17+
To start validating on the `pyrmont` network:
18+
19+
20+
#### 1. Clone the nim beacon chain repository
21+
22+
```
23+
git clone https://github.com/status-im/nimbus-eth2
24+
cd nimbus-eth2
25+
```
26+
27+
#### 2. Build the beacon node
28+
```
29+
make nimbus_beacon_node
30+
```
31+
32+
*Patience... this may take a few minutes.*
33+
34+
#### 3. Import keystore(s)
35+
36+
```
37+
build/nimbus_beacon_node deposits import --data-dir=build/data/shared_pyrmont_0 <YOUR VALIDATOR KEYS DIRECTORY>
38+
```
39+
40+
Replacing `<YOUR VALIDATOR KEYS DIRECTORY>` with the full pathname of your `validator_keys` directory.
41+
42+
> Tip: run `pwd` in your `validator_keys` directory to print the full pathname to the console.
43+
44+
You'll be asked to enter the password you created to encrypt your keystore(s) in the *Generate Keys* section of the Launchpad process. Don't worry, this is entirely normal. Your validator client needs both your keystore(s) and the password encrypting it to import your [keys](https://blog.ethereum.org/2020/05/21/keys/) (since it needs to decrypt the keystore in order to be able to use it to sign on your behalf).
45+
46+
47+
#### 4. Connect to Pyrmont
48+
49+
```
50+
./run-pyrmont-beacon-node.sh
51+
```
52+
53+
You should see that the beacon node has launched with your validator attached:
54+
55+
```
56+
WRN 2020-08-03 16:24:17.950+02:00 Validator not in registry (yet?) topics="beacval" tid=11677993 file=validator_duties.nim:53 pubKey=a9c4df36
57+
INF 2020-08-03 16:24:17.951+02:00 Local validator attached tid=11677993 file=validator_pool.nim:21 pubKey=a9c4df36 validator=a9c4df36
58+
INF 2020-08-03 16:24:17.951+02:00 Local validators attached topics="beacval" tid=11677993 file=validator_duties.nim:61 count=1
59+
INF 2020-08-03 16:24:17.958+02:00 Starting beacon node topics="beacnde" tid=11677993 file=nimbus_beacon_node.nim:875 version="0.5.0 (31b33907)" nim="Nim Compiler Version 1.2.6 [MacOSX: amd64] (bf320ed1)" timeSinceFinalization=81350 head=ebe49843:0 finalizedHead=ebe49843:0 SLOTS_PER_EPOCH=32 SECONDS_PER_SLOT=12 SPEC_VERSION=0.12.2 dataDir=build/data/shared_pyrmont_0 pcs=start_beacon_node
60+
```
61+
62+
> **Note:** when you run `./run-pyrmont-beacon-node.sh`, the beacon node launches with an Infura endpoint supplied by us. This endpoint is passed through the `web3-url` option (which takes as input the url of the web3 server from which you'd like to observe the eth1 chain).
63+
>
64+
> Because Infura caps the requests per endpoint per day to 100k, and all Nimbus nodes use the same Infura endpoint by default, it can happen that our Infura endpoint is overloaded (i.e the requests on a given day reach the 100k limit). If this happens, all requests to Infura using the default endpoint will fail, which means your node will stop processing new deposits.
65+
>
66+
> To pass in your own Infura endpoint, you'll need to run:
67+
>```
68+
> make NODE_PARAMS="--web3-url=<YOUR_WEBSOCKET_ENDPOINT>" pyrmont
69+
>```
70+
> Importantly, the endpoint must be a websocket (`wss`) endpoint, not `https`. If you're not familiar with Infura, we recommend reading through our [Infura guide](./infura-guide), first.
71+
>
72+
> P.S. We are well aware that Infura is less than ideal from a decentralisation perspective. As such we are in the process of changing our default to [Geth](https://geth.ethereum.org/docs/install-and-build/installing-geth) (with Infura as a fallback). For some rough notes on how to use Geth with Nimbus, see [here](https://gist.github.com/onqtam/aaf883d46f4dab1311ca9c160df12fe4) (we will be adding more complete instructions very soon).
73+
74+
75+
> **Tip:** to 🎨 on the [graffitwall](https://pyrmont.beaconcha.in/graffitiwall), pass the graffiti parameter like this:
76+
>```
77+
> ./run-pyrmont-beacon-node.sh --graffiti='<YOUR_GRAFFITI>'
78+
79+
80+
#### 5. Keep an eye on your validator
81+
82+
If you deposited after the [genesis](https://hackmd.io/@benjaminion/genesis) state was decided (August 2nd 1300 UTC), your validators will have been put in a queue based on deposit time, and will slowly be inducted into the validator set after genesis. Getting through the queue may take a few hours or days.
83+
84+
The best way to keep track of your validator's status is [pyrmont.beaconcha.in](https://pyrmont.beaconcha.in) (click on the orange magnifying glass at the very top and paste in its public key).
85+
86+
You can even [create an account](https://pyrmont.beaconcha.in/register) to add alerts and keep track of your validator's [performance](https://pyrmont.beaconcha.in/dashboard).
87+
88+
To keep track of your syncing progress, have a look at the output at the very bottom of the terminal window in which your validator is running. You should see something like:
89+
90+
```
91+
peers: 35 ❯ finalized: ada7228a:8765 ❯ head: b2fe11cd:8767:2 ❯ time: 9900:7 (316807) ❯ sync: wPwwwwwDwwDPwPPPwwww:7:4.0627 (280512)
92+
```
93+
94+
Where:
95+
- `peers` tells you how many peers you're currently connected to (in the above case, 35 peers)
96+
- `finalized` tells you the most recent finalized epoch you've synced to so far (the 8765th epoch)
97+
- `head` tells you the most recent slot you've synced to so far (the 2nd slot of the 8767th epoch)
98+
- `time` tells you the current time since Genesis (the 7th slot of the 9900th epoch -- or equivalently, the 316,807th slot)
99+
- `sync` tells you how fast you're syncing (4.0627 blocks per second), how many blocks you've synced so far (280,512), along with information about 20 sync workers linked to the 20 most performant peers you are currently connected to (represented by a string of letters and a number).
100+
101+
To dig into `sync` a little:
102+
```
103+
sync: <sync worker map>:<number of active workers>:<current syncing speed in blocks/second>
104+
```
105+
106+
The string of letters -- what we call the `sync worker map` (in the above case represented by `wPwwwwwDwwDPwPPPwwww`) represents the status of the sync workers mentioned above, where:
107+
108+
```
109+
s - sleeping (idle),
110+
w - waiting for a peer from PeerPool,
111+
R - requesting blocks from peer
112+
D - downloading blocks from peer
113+
P - processing/verifying blocks
114+
U - updating peer's status information
115+
```
116+
117+
The number following it (in the above case represented by `7`) represents the number of workers that are currently active (i.e not sleeping or waiting for a peer).
118+
119+
120+
#### 6. Keep your validator updated
121+
122+
Finally, makes sure you stay on the lookout for any critical updates to Nimbus. This best way to do so is through the **announcements** channel on our [discord](https://discord.com/invite/XRxWahP).
123+
124+
To update to the latest version, disconnect from pyrmont and run:
125+
126+
```
127+
git pull && make update
128+
```
129+
130+
Once the update is complete, run `make nimbus_beacon_node` and `./run-pyrmont-beacon-node.sh` to reconnect to the network.
131+
132+
Looking forward to seeing you on Pyrmont! 💛
133+
134+
## Key management
135+
136+
Keys are stored in the `build/data/shared_pyrmont_0/` folder, under `secrets` and `validators` - make sure you keep these folders backed up.
137+
138+
The `secrets` folder contains the common secret that gives you access to all your validator keys.
139+
140+
The `validators` folder contains your keystores (encrypted keys). Keystores are used by validators as a method for exchanging keys. For more on keys and keystores, see [here](https://blog.ethereum.org/2020/05/21/keys/).
141+
142+
>**Note:** The Nimbus client will only ever import your signing key -- in any case, if you used the deposit launchpad, this is the only key you should have (you can generate the withdrawal key from your mnemonic when you wish to withdraw).
143+
144+
## Metrics
145+
146+
Metrics are not included in the binary by default - to enable them, use the following options when building the client:
147+
148+
```
149+
make NIMFLAGS="-d:insecure" nimbus_beacon_node
150+
```
151+
152+
You can then browse the metrics by connecting to:
153+
154+
[http://localhost:8008/metrics](http://localhost:8008/metrics)
155+
156+
Make sure this port is protected as the http server used is not considered secure (it should not be used by untrusted peers).
157+
158+
For instructions on how to spin up a beautiful and useful monitoring dashboard for your validator and beacon node, see [this page](./metrics-pretty-pictures.md).
159+
160+
## Advanced options
161+
162+
### Start multiple nodes
163+
164+
You can start multiple local nodes, in different terminal windows/tabs, by specifying numeric IDs:
165+
166+
```
167+
NODE_ID=0 ./run-pyrmont-beacon-node.sh # the default
168+
NODE_ID=1 ./run-pyrmont-beacon-node.sh
169+
NODE_ID=2 ./run-pyrmont-beacon-node.sh
170+
```
171+
172+
### Attach multiple validators to the same beacon node
173+
174+
Simply [import as many keystores as you wish](./pyrmont.md#3-import-keystores) before running `./run-pyrmont-beacon-node.sh`. Nimbus will automagically find your keys and attach your validators. See [key management](./pyrmont.md#key-management) for more information on where we store your keys.
175+
176+
To give you some context, we (the Nimbus team) are currently running 170 validators per beacon node on our AWS instances.
177+
178+
### Node parameters
179+
180+
You can customise your beacon node's parameters using the `NODE_PARAMS` option:
181+
182+
```
183+
make NODE_PARAMS="--tcp-port=9100 --udp-port=9100" pyrmont
184+
```
185+
186+
>**Note:** the above command has exactly the same effect as `make BASE_PORT=9100 pyrmont`
187+
188+
A complete list of the available parameters can be found [here](https://github.com/status-im/nimbus-eth2/blob/devel/beacon_chain/conf.nim#L92-L210) (use a parameter's `name` field to set it).
189+
190+
### Logs
191+
192+
Log files are saved in `build/data/shared_pyrmont_0/`.
193+
194+
195+
### Makefile
196+
197+
If you are comfortable reading [Makefiles](https://en.wikipedia.org/wiki/Makefile#:~:text=A%20makefile%20is%20a%20file,to%20generate%20a%20target%2Fgoal), you can see the commands that `make pyrmont` executes under the hood, [here](https://github.com/status-im/nimbus-eth2/blob/23bec993414df904e9d7ea9d26e65005b981aee0/Makefile#L184-L197).
198+
199+
Some of the provided options (such as `--network=pyrmont`) are essential while others (such as the ones controlling logging, metrics, ports, and the RPC service) are there for convenience.
200+
201+
The Goerli testnet parameters (`$(GOERLI_TESTNETS_PARAMS`), are defined higher up in the Makefile, [here](https://github.com/status-im/nimbus-eth2/blob/23bec993414df904e9d7ea9d26e65005b981aee0/Makefile#L164-L171).

run-pyrmont-beacon-node.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
cd "$(dirname $0)"
4+
scripts/run-beacon-node.sh nimbus_beacon_node pyrmont $@
5+

0 commit comments

Comments
 (0)