Depending on the execution client you intend to use, delete the other client files.
For this guide, I chose Reth client, so this guide will follow the installation of Reth as the execution layer, as well as Beacond for the consensus layer.
Install Reth
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
The rustup installer provides an easy way to update the Rust compiler and works on all platforms.
Install the following dependencies if running on Ubuntu:
Berachain node requires reth v1.1.x for mainnet. With Rust and the dependencies installed, you're ready to build Reth. First, clone the repository:
git clone https://github.com/paradigmxyz/reth
cd reth
git checkout v1.1.5
Then, install Reth into your PATH directly via:
cargo install --locked --path bin/reth --bin reth The binary will now be accessible as reth via the command line, and exist under your default .cargo/bin folder.
Beacond Consensus Layer Note: Beacond requires go version 1.17.x - 1.23.x
git clone https://github.com/berachain/beacon-kit.git
make install
make build
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.
#!/bin/bash
# CHANGE THESE VALUES
export CHAIN_SPEC=mainnet # or "testnet"
export MONIKER_NAME=anyname
export WALLET_ADDRESS_FEE_RECIPIENT=0x9BcaA41DC32627776b1A4D714Eef627E640b3EF5
export EL_ARCHIVE_NODE=false # set to true if you want to run an archive node on CL and EL
export MY_IP=`curl -s canhazip.com`
# VALUES YOU MIGHT WANT TO CHANGE
export LOG_DIR=$(pwd)/logs
export BEACOND_BIN=/root/beacon-kit/build/bin/beacond
export BEACOND_DATA=$(pwd)/data/beacond
export BEACOND_CONFIG=$BEACOND_DATA/config # can't change this. sorry.
export JWT_PATH=$BEACOND_CONFIG/jwt.hex
export RETH_BIN=/root/.cargo/bin/reth
#export GETH_BIN=$(command -v geth || echo $(pwd)/geth)
#export NETHERMIND_BIN=$(command -v Nethermind.Runner || echo #$(pwd)/Nethermind.Runner)
#export ERIGON_BIN=$(command -v erigon || echo $(pwd)/erigon)
You need to set these constants:
CHAIN_SPEC: Set to testnet or mainnet.
MONIKER_NAME: Should be a name of your choice for your node.
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.
EL_ARCHIVE_NODE: Set to true if you want the execution client to be a full archive node.
MY_IP: This is used to set the IP address that 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.
RETH_BIN or other chain client: Set this to the full path where you installed reth. The expression provided finds it in your $PATH.
The script setup-beacond.sh invokes beacond init and beacond jwt generate.
This script:
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.
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.
Rewrites the beacond configuration files to reflect settings chosen in env.sh.
Places the mainnet parameters fetched above where Beacon-Kit expects them, and shows you an important hash from the genesis file.
# FROM: ~/beranode-setup
./setup-beacond.sh;
# expected output:
BEACOND_DATA: /root/beranode-setup/data/beacond
BEACOND_BIN: /root/beacon-kit/build/bin/beacond
Version: v1.2.0.rc2-19-g0da575879
✓ Private validator key generated in /root/beranode-setup/data/beacond/config/priv_validator_key.json
✓ JWT secret generated at /root/beranode-setup/data/beacond/config/jwt.hex
✓ Config files in /root/beranode-setup/data/beacond/config updated
0xdf609e3b062842c6425ff716aec2d2092c46455d9b2e1a2c9e32c6ba63ff0bda
✓ Beacon-Kit set up. Confirm genesis root is correct.
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-reth:
# FROM: ~/beranode-setup
./setup-reth.sh;
# [Expected Output]:
RETH_DATA: /root/beranode-setup/var/reth/data
RETH_BIN: /root/.cargo/bin/reth
Version: reth Version: 1.1.5
2025-05-09T08:35:56.850901Z INFO Initialized tracing, debug log directory: /root/.cache/reth/logs/80094
2025-05-09T08:35:56.853494Z INFO reth init starting
2025-05-09T08:35:56.853891Z INFO Opening storage db_path="/root/beranode-setup/var/reth/data/db" sf_path="/root/beranode-setup/var/reth/data/static_files"
2025-05-09T08:35:56.861490Z INFO Verifying storage consistency.
2025-05-09T08:35:59.340630Z INFO Genesis block written hash=0xd57819422128da1c44339fc7956662378c17e2213e669b427ac91cd11dfcfb38
✓ Reth set up.