💻Baremetal

Authors: [ Godwin]

System Requirements

CPU
OS
RAM
DISK

8 vCPU

Ubuntu 22.04

48 GB

400+ GB

Pre-requisite

At the time when this node was set up, Erigon v2.61.x and GO v1.23.x were the required version for the Berachain setup.

Check out https://docs.berachain.com/nodes/evm-execution to find the correct required version when setting up the node.

Commands

sudo apt update -y && sudo apt upgrade -y && sudo apt auto-remove -y

Firewall Settings

Check status & enable UFW

sudo ufw enable
sudo ufw status verbose

Set explicit default UFW rules

Allow SSH, HTTP, and HTTPS

Allow Remote connection

Setup Instructions

Depending on your execution client you intend to use, you delete the other client files. For a full list of the clients and versions go to this page - EVM Execution Layer ⟠ | Berachain Core Docs

For this guide, I chose erigon client, so this guide will follow the installation of erigon as the execution layer as well as beacond for the consensus layer.

Install Erigon

First Install go

Build Erigon

Berachain node requires erigon v1.26.x for mainnet. With Rust and the dependencies installed, you're ready to build Erigon. First, clone the repository:

Install Beacond Consensus Layer Note: Beacond requires go version 1.17.x - 1.23.x

Install Beacond

Edit Env.sh The file env.sh contains environment variables used in the other scripts. fetch-berachain-params.sh obtains copies of the genesis file and other configuration files. Then we have setup- and run- scripts for various execution clients and beacond.

You need to set these constants:

  1. CHAIN_SPEC: Set to testnet or mainnet.

  2. MONIKER_NAME: Should be a name of your choice for your node.

  3. WALLET_ADDRESS_FEE_RECIPIENT: This is the address that will receive the priority fees for blocks sealed by your node. If your node will not be a validator, this won't matter.

  4. EL_ARCHIVE_NODE: Set to true if you want the execution client to be a full archive node.

  5. MY_IP: This is used to set the IP address your chain clients advertise to other peers on the network. If you leave it blank, geth and reth will discover the address with UPnP (if you are behind a NAT gateway) or assign the node's ethernet IP (which is OK if your computer is directly on the internet and has a public IP). In a cloud environment such as AWS or GCP where you are behind a NAT gateway, you must specify this address or allow the default curl canhazip.com to auto-detect it, if connections to that address lead back to your instance.

You should verify these constants:

  • LOG_DIR: This directory stores log files.

  • BEACOND_BIN: Set this to the full path where you installed beacond. The expression provided finds it in your $PATH.

  • BEACOND_DATA: Set this to where the consensus data and config should be kept. BEACOND_CONFIG must be under BEACOND_PATH as shown. Don't change it.

  • ERIGON_BIN or other chain client: Set this to the full path where you installed erigon. The expression provided finds it in your $PATH.

Fetch Mainnet Parameters

Run

Set up the Consensus Client

The script setup-beacond.sh invokes beacond init and beacond jwt generate. This script:

  1. Runs beacond init to create the file var/beacond/config/priv_validator_key.json. This contains your node's private key, and especially if you intend to become a validator, this file should be kept safe. It cannot be regenerated, and losing it means you will not be able to participate in the consensus process.

  2. Runs beacond jwt generate to create the file jwt.hex. This contains a secret shared between the consensus client and execution client so they can securely communicate. Protect this file. If you suspect it has been leaked, generate a new one with beacond jwt generate -o $JWT_PATH.

  3. Rewrites the beacond configuration files to reflect settings chosen in env.sh.

  4. Places the mainnet parameters fetched above where Beacon-Kit expects them, and shows you an important hash from the genesis file.

Set up the Execution Client

The provided scripts setup-reth, setup-geth and setup-nether create a runtime directory and configuration for those respective chain clients. The node is configured with pruning settings according to the EL_ARCHIVE_NODE setting in config.sh.

Here's an example of setup-erigon:

Your genesis block hash must agree with the above

Run the Client

Setup Services for both beacond and erigon

Beacond service

Erigon Service

Contents of run-erigon.sh

This file can be configured based on your needs

Contents of run-beacon.sh

Start the service

Confirm Node Syncing

Beacon

Erigon

Testing Local RPC Node

Get the current execution block number

Result

Get Current Consensus Block Number

Result

Last updated

Was this helpful?