Skip to content

Commit

Permalink
Add Aura-based validator guide
Browse files Browse the repository at this point in the history
  • Loading branch information
rubo committed Nov 13, 2023
1 parent 0638a84 commit 9bcd116
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/validators/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"position": 5,
"label": "Validators",
"link": {
"type": "doc", "id": "validators"
}
}
118 changes: 118 additions & 0 deletions docs/validators/aura.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
title: Aura-based validators
sidebar_position: 0
---

This guide will walk you through configuring an Aura-based validator with Nethermind in a Docker container using the Energy Web chain as an example.

:::info
Your machine's clock has to be synchronized. Otherwise, you might miss block sealing. By default, the block time is set to 5 seconds.
:::

## Configuring a Docker container

The example below shows how to configure a Docker container for an Aura-based validator on the Energy Web chain:

```yaml title="docker-compose.yml"
services:
nethermind-validator:
image: nethermind/nethermind:latest
container_name: nethermind-validator
restart: unless-stopped
ports:
- 8545:8545
- 30303:30303
ulimits:
nofile:
soft: 1000000
hard: 1000000
environment:
- NETHERMIND_CONFIG=energyweb
volumes:
- ${PWD}/keystore:/nethermind/keystore
- ${PWD}/logs:/nethermind/logs
- ${PWD}/nethermind_db:/nethermind/nethermind_db
```
## Configuring keyfile
Make sure that the keyfile name contains the public key (address). Otherwise, Nethermind doesn't recognize it as such.
For instance, a keyfile can be named `key-0x1234567890123456789012345678901234567890`.

The keyfile must be stored in the `keystore` directory located in the Nethermind base data directory.

## Configuration settings

Here is an example of recommended settings for a validator. The most convenient way to configure these settings is either defining them in the configuration file or passing them as environment variables.

- `Init.IsMining`: `true`
- `Init.MemoryHint`: Can be left unspecified. It's recommended to configure it accordingly to the machine specification(for Eneergy Web, 768000000 is enough).
- `EthStats` namespace parameters if you want to report node status to Ethstats for your network.
- `Metrics` namespace parameters to enable node monitoring.
- `KeyStore.PasswordFiles`: The path to the file containing the password for the mining private key.
- `KeyStore.UnlockAccounts`: An array of accounts. Provide the miner public address here.
- `KeyStore.BlockAuthorAccount`: The miner public address should be provided here as well.
- `Aura.ForceSealing`: `true`
- `Merge.Enabled`: `false`

Here's an example of above settings in the Energy Web configuration file:

```json title="energyweb.cfg"
{
"Init": {
"ChainSpecPath": "chainspec/energyweb.json",
"GenesisHash": "0x0b6d3e680af2fc525392c720666cce58e3d8e6fe75ba4b48cb36bcc69039229b",
"BaseDbPath": "nethermind_db/energyweb",
"LogFileName": "energyweb.log",
"MemoryHint": 768000000
},
"Sync": {
"FastSync": true,
"PivotNumber": 26940000,
"PivotHash": "0x8835983de9578a4355313afd2a43d8eada6f2a4ddbd9c51da103e0d5f53c4d8b",
"PivotTotalDifficulty": "9167206964850082205703311924211835616257898274",
"FastBlocks": true,
"UseGethLimitsInFastBlocks": false,
"FastSyncCatchUpHeightDelta": 10000000000
},
"EthStats": {
"Enabled": true,
"Name": "Nethermind Energy Web",
"Secret": "secret...",
"Url": "ws://localhost:3000/api"
},
"Metrics": {
"Enabled": true,
"NodeName": "Energy Web",
"PushGatewayUrl": "http://localhost:9091/metrics"
},
"Mining": {
"MinGasPrice": 1
},
"Merge": {
"Enabled": false
},
"Aura": {
"ForceSealing": true
},
"KeyStore": {
"PasswordFiles": ["keystore/password"],
"UnlockAccounts": ["0x..."],
"BlockAuthorAccount": "0x..."
},
}
```

## Running the validator

The above Docker Compose file can be run from the directory the `docker-compose.yml` is located in as follows:

```bash
docker-compose up -d
```

To check the logs and verify the sealing of blocks, run:

```bash
docker-compose logs -f nethermind-validator
```
6 changes: 3 additions & 3 deletions docs/validators.md → docs/validators/validators.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: Validators
sidebar_position: 5
sidebar_position: 0
---

## General considerations

:::warning Important
Please check out the [security considerations](./fundamentals/security.md) before using Nethermind as a validator.
Please check out the [security considerations](../fundamentals/security.md) before using Nethermind as a validator.
:::

For Ethereum validators, we highly recommend checking out [Staking with Ethereum](https://ethereum.org/en/staking/) and [Validator checklist](https://launchpad.ethereum.org/en/checklist).
Expand All @@ -24,7 +24,7 @@ A single validator on Intel NUC 11:
- Storage: Samsung 980 PRO PCIe NVMe SSD 2TB
- Internet speed: 620 Mbps download, 160 Mbps upload

See also Nethermind [hardware requirements](./get-started/system-requirements.md#hardware-requirements).
See also Nethermind [hardware requirements](../get-started/system-requirements.md#hardware-requirements).

### AWS

Expand Down
4 changes: 4 additions & 0 deletions redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ const redirects = {
from: '/nethermind/guides-and-helpers/faq',
to: '/faq'
},
{
from: '/nethermind/guides-and-helpers/validator-setup/aura-validator',
to: '/validators/aura'
},
{
from: '/nethermind/guides-and-helpers/validator-setup/eth2-validator',
to: '/validators'
Expand Down

0 comments on commit 9bcd116

Please sign in to comment.