Update, upgrade, and clean the system, and then install essential development tools (build-essential), firewall management (ufw), and the Git version control system.
Allow remote RPC connections with Execution Client
sudo ufw allow from ${REMOTE.HOST.IP} to any port 9656
Not advised to allow all or unknown IP address to RPC port
Enable Firewall
sudo ufw enable
Install go
Download the Go programming language distribution archive, extracts it to the "/usr/local" directory, and then removes the downloaded archive, effectively installing Go version 1.20.6 on the system.
Please add the Go executable path to your system's PATH environment variable, and then test to ensure that Go is working correctly.
echo "export PATH="$PATH:/root/.foundry/bin:/usr/local/go/bin"" >> /root/.bashrc
source /root/.bashrc
go version #test
Create Erigon Directory
Create a new directory named erigon within the "/root/.local/share" directory, providing a location for storing data related to Erigon.
mkdir /root/.local/share/erigon
Generate JWT token
Generate a 32-byte random hexadecimal value using OpenSSL, removes any newline characters, and then save the result into the file "jwt.hex" located in the "/root/.local/share/erigon/" directory.
openssl rand -hex 32 | sudo tee /root/.local/share/erigon/jwt.hex > /dev/null
Build Erigon
Clone the Erigon repository from GitHub, including its submodules, changes the current directory to the Erigon directory, checks out the latest release tag, and then compile the project using the "make" build system.
git clone --recurse-submodules https://github.com/ledgerwatch/erigon.git
cd erigon
git checkout <latest release tag>
make
Configure Erigon
Append a systemd service configuration for the Erigon Gnosis Mainnet Service to the "/etc/systemd/system/erigon.service" file, specifying its description, dependencies, and executable parameters for proper execution and monitoring.
Reload the systemd manager configuration, start the Erigon service, and enable it to start automatically on system boot, ensuring that the Erigon Gnosis Mainnet Service is active and will be automatically started upon system startup.
Use journalctl to display real-time log messages and continuously follow the log output of the Erigon service, allowing you to monitor its activity and troubleshoot any issues as they occur.
Create a new directory named lodestar within the "/root/.local/share" directory, providing a location for storing data related to Lodestar.
mkdir /root/.local/share/lodestar
Build Lodestar
Clone the lodestar repository from GitHub, navigate to the lodestar directory, switch to the stable branch, and then build the project with yarn.
git clone https://github.com/chainsafe/lodestar.git
cd lodestar
git checkout stable
yarn install
yarn run build
Configure Lodestar
Append a systemd service configuration for the Lodestar Gnosis Service to the "/etc/systemd/system/lodestar.service" file, specifying its description, dependencies, and executable parameters for proper execution and monitoring.
Reload the systemd manager configuration, restart the Lodestar and Erigon services, and enable the Lodestar service to start automatically on system boot. This ensures that both services are running with the latest configuration and that the Lodestar service will be automatically started upon system startup.
Use journalctl to display real-time log messages and continuously follow the log output of the Lodestar service, allowing you to monitor its activity and troubleshoot any issues as they occur.
sudo journalctl -fu lodestar
Lighthouse 🕯️
Install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Please add the Rust executable path to your system's PATH environment variable, and then test to ensure that Rust is working correctly.
Create a new directory named "lighthouse" within the "/root/.local/share" directory, providing a location for storing data related to Lighthouse.
mkdir /root/.local/share/lighthouse
Build Lighthouse
Clone the lighthouse repository from GitHub, navigate to the lighthouse directory, switch to the stable branch, and then build the project with the gnosis feature enabled using the "make" build system.
git clone https://github.com/sigp/lighthouse.git
cd lighthouse
git checkout stable
FEATURES=gnosis make
Configure Lighthouse
Append a systemd service configuration for the Lighthouse Gnosis Service to the "/etc/systemd/system/lighthouse.service" file, specifying its description, dependencies, and executable parameters for proper execution and monitoring.
Reload the systemd manager configuration, restart the Lighthouse and Erigon services, and enable the Lighthouse service to start automatically on system boot. This ensures that both services are running with the latest configuration and that the Lighthouse service will be automatically started upon system startup.
Use journalctl to display real-time log messages and continuously follow the log output of the Lighthouse service, allowing you to monitor its activity and troubleshoot any issues as they occur.
sudo journalctl -fu lighthouse
Nimbus ☁️
Install cmake
sudo apt -y install cmake
Create Nimbus Directory
Create a new directory named nimbus within the "/root/.local/share" directory, providing a location for storing data related to Nimbus.
mkdir /root/.local/share/nimbus
Build Nimbus
Clone the Nimbus repository from GitHub, navigate to the nimbus directory, switch to the latest stable release, and then build the project with make
git clone https://github.com/status-im/nimbus-eth2
cd nimbus-eth2
git checkout stable
make -j4 nimbus_beacon_node
You can increase -j4 (-j32) with higher or lower integer depending on your host machine ram to decrease build time. Omit -j4 on systems with 4GB of memory or less.
Alternatively, extract the binary from the precompiled docker images:
Append a systemd service configuration for the Nimbus Gnosis Service to the "/etc/systemd/system/nimbus.service" file, specifying its description, dependencies, and executable parameters for proper execution and monitoring.
Reload the systemd manager configuration, restart the Nimbus and Erigon services, and enable the Nimbus service to start automatically on system boot. This ensures that both services are running with the latest configuration and that the Nimbus service will be automatically started upon system startup.
Use journalctl to display real-time log messages and continuously follow the log output of the Nimbus service, allowing you to monitor its activity and troubleshoot any issues as they occur.
sudo journalctl -fu nimbus
Teku 🍷
Install the required Java runtime
sudo apt -y install openjdk-17-jre
Create Teku Directory
Create a new directory named teku within the "/root/.local/share" directory, providing a location for storing data related to Teku.
mkdir /root/.local/share/teku
Build Teku
Clone the teku repository from GitHub, navigate to the teku directory, switch to the latest release, and then build the project with with the Gradle wrapper gradlew, as follows.
Append a systemd service configuration for the Teku Gnosis Service to the "/etc/systemd/system/teku.service" file, specifying its description, dependencies, and executable parameters for proper execution and monitoring.
Reload the systemd manager configuration, restart the Teku and Erigon services, and enable the Teku service to start automatically on system boot. This ensures that both services are running with the latest configuration and that the Teku service will be automatically started upon system startup.
Use journalctl to display real-time log messages and continuously follow the log output of the Teku service, allowing you to monitor its activity and troubleshoot any issues as they occur.
sudo journalctl -fu teku
Test Erigon RPC 🧪
Erigon and Consensus client must be synced before testing.
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1", true],"id":1}' http://localhost:9656