Aura Validator
How to setup a Nethermind Validator in Aura (Authority Round) consensus algorithm
This article will lead you through docker-compose setup of Nethermind Aura Validator (xDai chain in this example). Same result can be obtained by Downloading & Running Nethermind package or by Building Nethermind from the source code.
If you chose not to use docker-compose, you can skip docker-compose related sections and read about config file and private key configuration only.

Prerequisites

    docker-compose
    docker
    machine with at least 4GB RAM is recommended
1
sudo apt-get install docker docker-compose -y
Copied!

Clock synchronization

You system clock needs to be synchronized otherwise you might encounter skipping block sealing. By default stepDuration is configured to 5s.
Verify if your system clock is synchronized, type timedatectl status and you should see similar output:
1
Local time: Tue 2020-06-30 17:16:19 UTC
2
Universal time: Tue 2020-06-30 17:16:19 UTC
3
RTC time: Tue 2020-06-30 17:16:19
4
Time zone: Etc/UTC (UTC, +0000)
5
System clock synchronized: yes
6
systemd-timesyncd.service active: yes
7
RTC in local TZ: no
Copied!
If System clock synchronized displays yes you are all set, otherwise you may need to either:
    synchronize clock with NTP servers (allow UDP port 123 for both incoming and outgoing traffic)
    use below script to sync with google.com:
Create fixtime.sh script and run it with watch -n 60 command in a screen
1
echo sudo date -s '"$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"' > fixtime.sh
2
chmod +x fixtime.sh
3
screen -S time
4
watch -n 60 ./fixtime.sh
Copied!
Press Ctrl+A+D to leave the screen

Docker-compose file sample

Create and editdocker-compose.yml file
1
nano docker-compose.yml
Copied!
docker-compose.yml
1
version: '3.5'
2
3
services:
4
nethermind-validator:
5
image: nethermind/nethermind
6
container_name: nethermind-validator
7
restart: unless-stopped
8
ports:
9
- 8545:8545
10
- 30303:30303
11
network_mode: host
12
environment:
13
- NETHERMIND_CONFIG=xdai
14
volumes:
15
- ${PWD}/nethermind_db:/nethermind/nethermind_db
16
- ${PWD}/keystore:/nethermind/keystore
17
- ${PWD}/logs:/nethermind/logs
18
- ${PWD}/xdai.cfg:/nethermind/configs/xdai.cfg
19
- ${PWD}/NLog.config:/nethermind/NLog.config
20
- ${PWD}/static-nodes.json:/nethermind/Data/static-nodes.json
21
22
volumes:
23
nethermind_db:
24
driver: local
25
name: nethermind_db
26
keystore:
27
driver: local
28
name: keystore
29
logs:
30
driver: local
31
name: logs
Copied!
Configure Nethermind node via environment variables or use local config file and map it to the one, existing inside container (xdai.cfg file in above example).
Make sure that nethermind_db, keystore(logs - optional ) are mapped, otherwise you might lose database or keys
NLog.config file is optional. static-nodes.json can be filled with an array of enodes, this is also optional.

Mining Private key

Make sure that the filename contains key's public address otherwise it won't be recognized by Nethermind Client as a keyfile. Correct naming of a keyfile: key-a5237f7f43cc46cba43ac212dabd0c45e3e3050a
The keyfile should be then stored inside keystore volume.

Config file

Things to be configured:
    Init.IsMining true
    Init.MemoryHint can be left default, recommended to configure it accordingly to the machine hardware setup (for xdai 1000000000 is enough)
    EthStats section if you wish to report node status to the ethstats page for a given network
    Metrics section if running local/remote Metrics infrastructure
    KeyStore.PasswordFiles path to the file containing password for mining private key
    KeyStore.UnlockAccounts an array of accounts, provide mining public address here
    KeyStore.BlockAuthorAccount mining public address should be provided here as well
    Aura.ForceSealing set to true
xdai.cfg
1
{
2
"Init": {
3
"WebSocketsEnabled": false,
4
"StoreReceipts": true,
5
"IsMining": true,
6
"ChainSpecPath": "chainspec/xdai.json",
7
"GenesisHash": "0x4f1dd23188aab3a76b463e4af801b52b1248ef073c648cbdc4c9333d3da79756",
8
"BaseDbPath": "nethermind_db/xdai",
9
"LogFileName": "xdai.logs.txt",
10
"MemoryHint": 3000000000,
11
"StaticNodesPath": "Data/static-nodes.json"
12
},
13
"Network": {
14
"DiscoveryPort": 30303,
15
"P2PPort": 30303
16
},
17
"JsonRpc": {
18
"Enabled": false,
19
"Host": "127.0.0.1",
20
"Port": 8545,
21
"WebSocketsPort": 8546
22
},
23
"Db": {
24
"HeadersDbCacheIndexAndFilterBlocks": false,
25
"BlocksDbCacheIndexAndFilterBlocks": false,
26
"ReceiptsDbCacheIndexAndFilterBlocks": false,
27
"BlockInfosDbCacheIndexAndFilterBlocks": false
28
},
29
"Sync": {
30
"FastSync": true,
31
"PivotNumber": 10410000,
32
"PivotHash": "0x806f498fdde010f25bd3beb18e6f8a9c9450752f8c0e27da2cd2465ff184628c",
33
"PivotTotalDifficulty": "3542339439646969404653729663364707080928280566",
34
"FastBlocks": true,
35
"UseGethLimitsInFastBlocks": false,
36
"FastSyncCatchUpHeightDelta": 10000000000
37
},
38
"EthStats": {
39
"Enabled": false,
40
"Server": "ws://localhost:3000/api",
41
"Name": "Nethermind xDai",
42
"Secret": "secret",
43
"Contact": "[email protected]"
44
},
45
"Metrics": {
46
"NodeName": "Nethermind xDai",
47
"Enabled": false,
48
"PushGatewayUrl": "http://localhost:9091/metrics",
49
"IntervalSeconds": 5
50
},
51
"KeyStore": {
52
"PasswordFiles": ["keystore/password.file"],
53
"UnlockAccounts": ["0x..."],
54
"BlockAuthorAccount": "0x..."
55
},
56
"Aura": {
57
"ForceSealing": true
58
},
59
"Bloom": {
60
"IndexLevelBucketSizes": [
61
16,
62
16,
63
16
64
]
65
}
66
}
67
Copied!

Running Validator node

Run it with a simple docker-compose command.
1
docker-compose up -d
Copied!
You will need to wait for the node to be fully synchronized.
To check the logs and verify if it is sealing blocks as expected (look for the Sealed block log).
1
docker-compose logs -f nethermind-validator
Copied!
Last modified 11mo ago