💻Baremetal
Authors: [man4ela | catapulta.eth]
System Requirements
16+ cores CPU
Debian 12/Ubuntu 22.04
=> 16 GB RAM
=1TB+
(SSD or NVMe)
Setup production Erigon
This guide covers the installation ofErigon, an implementation of Ethereum (execution layer), on the efficiency frontier, Archive Node by default, and Lighthouse, as a Consensus Layer.
Pre-Requisites
sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y
sudo apt install -y libgtest-dev libomp-dev libgmp-dev git make wget aria2 gcc pkg-config libusb-1.0-0-dev libudev-dev jq g++ curl libssl-dev screen apache2-utils build-essentialSetting up Firewall
Set explicit default UFW rules
sudo ufw default deny incoming
sudo ufw default allow outgoingAllow SSH and peers
sudo ufw allow 22/tcp
sudo ufw allow 30303
sudo ufw allow 9001Allow remote RPC connections with the Node
sudo ufw allow from ${REMOTE.HOST.IP} to any port 8545
sudo ufw allow from ${REMOTE.HOST.IP} to any port 5052Not advised to allow all or unknown IP address to RPC port
Enable Firewall
sudo ufw enableTo check the status of UFW and see the current rules
sudo ufw status verboseInstall GO
sudo wget https://go.dev/dl/go1.21.6.linux-amd64.tar.gz && sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz && rm go1.21.6.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin:/root/.local/bin' >> /root/.bashrc
source /root/.bashrc
#verify Go installation
go versionBuild Erigon RPC Node
git clone --recurse-submodules https://github.com/ledgerwatch/erigon.git
cd erigon
git checkout v2.60.10
make erigonCreate Data directory and jwt secret file
cd ..
mkdir erigon-sepolia_data && cd erigon-sepolia_data
sudo openssl rand -hex -out /root/erigon-sepolia_data/jwtsecret 32Create Systemd service for Erigon
sudo nano /etc/systemd/system/erigon-sepolia.servicePaste the configs and save by entering ctrl+X and Y+ENTER:
[Unit]
Description=Erigon Sepolia Service
After=network.target
StartLimitIntervalSec=200
StartLimitBurst=5
[Service]
Type=simple
Restart=on-failure
RestartSec=5
TimeoutSec=900
User=root
Nice=0
LimitNOFILE=200000
WorkingDirectory=/root/erigon/build/bin/
ExecStart=/root/erigon/build/bin/erigon \
--chain=sepolia \
--port=30303 \
--http.port=8545 \
--torrent.port=42069 \
--torrent.download.rate=80mb \
--private.api.addr=127.0.0.1:9090 \
--http \
--ws \
--http.api=eth,debug,net,trace,web3,erigon \
--http.addr=0.0.0.0 \
--http.corsdomain='*' \
--metrics \
--metrics.port=6060 \
--metrics.addr=0.0.0.0 \
--authrpc.jwtsecret=/root/erigon-sepolia_data/jwt.hex \
--datadir=/root/erigon-sepolia_data \
--rpc.gascap=5000000000 \
--rpc.returndata.limit=1100000 \
--pprof \
--pprof.addr=0.0.0.0 \
--pprof.port=6070
[Install]
WantedBy=multi-user.targetLaunch Erigon
sudo systemctl daemon-reload #refresh systemd configuration when changes made
sudo systemctl enable erigon-sepolia.service #enable erigon-sepolia.service at system startup
sudo systemctl start erigon-sepolia.service #start erigon-sepolia.service
sudo nano /etc/systemd/system/erigon-sepolia.service #make changes in erigon-sepolia.service fileBuild Lighthouse
Go to the Releases page and select the latest release:
cd /root/
mkdir lighthouse-sepolia_data
mkdir lighthouse-sepolia && cd lighthouse-sepolia
wget https://github.com/sigp/lighthouse/releases/download/v5.3.0/lighthouse-v5.3.0-x86_64-unknown-linux-gnu.tar.gz
tar -xzf lighthouse-v5.3.0-x86_64-unknown-linux-gnu.tar.gz #Extract the tar.gz archive
chmod +x /root/lighthouse-sepolia/ #Grant execute permissions to the files in the directoryCreate systemd file for Lighthouse
sudo nano /etc/systemd/system/lighthouse-sepolia.servicePaste the configs and save by entering ctrl+X and Y+ENTER:
[Unit]
Description=Lighthouse-sepolia Beacon Node
After=network.target
[Service]
User=root
WorkingDirectory=/root/lighthouse-sepolia/
ExecStart=/root/lighthouse-sepolia/lighthouse beacon_node \
--network sepolia \
--datadir /root/lighthouse-sepolia_data \
--http \
--http-address 0.0.0.0 \
--http-port 5052 \
--execution-endpoint http://127.0.0.1:8551 \
--checkpoint-sync-url https://sepolia.beaconstate.info \
--execution-jwt /root/erigon-sepolia_data/jwt.hex \
--disable-deposit-contract-sync \
--prune-blobs false
Restart=on-failure
LimitNOFILE=1000000
[Install]
WantedBy=default.targetLaunch Lighthouse
sudo systemctl daemon-reload #refresh systemd configuration when changes made
sudo systemctl enable lighthouse-sepolia.service #enable lighthouse-sepolia service at system startup
sudo systemctl start lighthouse-sepolia.service #start lighthouse-sepolia
sudo nano /etc/systemd/system/lighthouse-sepolia.service #make changes in lighthouse-sepolia.service fileMonitor the logs for errors
journalctl -u erigon-sepolia.service -f -n 100 #follow logs of erigon-sepolia.service
journalctl -u lighthouse-sepolia.service -f -n 100 #follow logs of lighthouse-sepolia.serviceDuring the synchonization, you are expected to get following log messages fromerigon:
[INFO] [09-06|02:52:15.496] [4/12 Execution] Executed blocks number=9421994 blk/s=112.3 tx/s=9589.1 Mgas/s=906.5 gasState=0.38 batch=246.4MB alloc=6.4GB sys=16.7GB
[INFO] [09-06|02:52:29.871] [] Flushed buffer file name=erigon-sortable-buf-4268134305
[INFO] [09-06|02:52:30.358] [] Flushed buffer file name=erigon-sortable-buf-140271917
[INFO] [09-06|02:52:30.405] [] Flushed buffer file name=erigon-sortable-buf-3356874711
[INFO] [09-06|02:52:43.500] Committed State gas reached=221060403580 gasTarget=549755813888 block=9423228 time=16.113674309s committedToDb=true
[INFO] [09-06|02:52:45.488] [4/12 Execution] Executed blocks number=9423456 blk/s=48.7 tx/s=5474.7 Mgas/s=412.4 gasState=0.00 batch=3.1MB alloc=5.7GB sys=16.7GBAnd Lighthouse:
Sep 06 01:05:36.659 INFO New block received root: 0x9bf6a56781caf6b6e57cb6a0cead5e9ada0c417a36d4dd3d6924d07e5993935b, slot: 9896726
Sep 06 01:05:41.000 WARN Head is optimistic execution_block_hash: 0x613050be274505439dda4867d07840bd2e2e6e9ba0cddd96aada49449861bbb2, info: chain not fully verified, block and attestation production disabled until execution engine syncs, service: slot_notifierRun curl command in the terminal to check the status of your node
curl command in the terminal to check the status of your nodecurl -H "Content-type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545Expected output during synchronization:
{"jsonrpc":"2.0","id":1,"result":{"currentBlock":"0x0","highestBlock":"0x137477f","stages":[{"stage_name":"Snapshots","block_number":"0x137477f"},{"stage_name":"Headers","block_number":"0x137477f"},{"stage_name":"BorHeimdall","block_number":"0x0"},{"stage_name":"BlockHashes","block_number":"0x137477f"},{"stage_name":"Bodies","block_number":"0x137477f"},{"stage_name":"Senders","block_number":"0x137477f"},{"stage_name":"Execution","block_number":"0x90b383"},{"stage_name":"Translation","block_number":"0x0"},{"stage_name":"HashState","block_number":"0x0"},{"stage_name":"IntermediateHashes","block_number":"0x0"},{"stage_name":"AccountHistoryIndex","block_number":"0x0"},{"stage_name":"StorageHistoryIndex","block_number":"0x0"},{"stage_name":"LogIndex","block_number":"0x0"},{"stage_name":"CallTraces","block_number":"0x0"},{"stage_name":"TxLookup","block_number":"0x0"},{"stage_name":"Finish","block_number":"0x0"}]}}When it returns false then your node is fully synchronized with the network
References
Last updated