Quick install instructions for running a private Erigon archive node.
Coffee/retirement money appreciated: xetic.eth
sudo apt update && sudo apt dist-upgrade -y && sudo apt install build-essential cmake libssl-dev libclang-dev git -y
wget https://dl.google.com/go/go1.23.3.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.23.3.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
git clone https://github.com/erigontech/erigon.git && cd erigon && make erigon
Add noatime
to mount point and (optionally) disable swap when using high memory system:
sudo nano /etc/fstab
Disable CPU exploit mitigations to boost performance when using bare metal server:
sudo nano /etc/default/grub
Add mitigations=off
to GRUB_CMDLINE_LINUX
.
sudo update-grub
sudo tee /etc/security/limits.d/90-erigon-nofiles.conf > /dev/null <<EOT
# Increase process file descriptor count limit
#<domain> <type> <item> <value>
* - nofile 2000000
EOT
sudo tee /etc/sysctl.d/20-erigon.conf > /dev/null <<EOT
# Increase UDP buffer size
net.core.rmem_max=134217728
net.core.rmem_default=134217728
net.core.wmem_max=134217728
net.core.wmem_default=134217728
# Increase memory mapped files limit
vm.max_map_count=2000000
# Maximize number of file-handles a process can allocate
fs.nr_open=2147483584
EOT
Reboot to load with CPU mitigations disabled if using bare metal:
sudo shutdown -r now
Otherwise, just reload system settings for adjusted performance limits:
sudo sysctl --system
tee /home/debian/run-erigon.sh > /dev/null <EOT
#!/bin/bash
cd /home/debian/erigon
./build/bin/erigon --chain=mainnet --prune.mode=archive --private.api.addr=localhost:9090 --ws --http.api=eth,debug,trace,ots --torrent.download.rate=800mb --torrent.conns.perfile=15 --txpool.disable --http.corsdomain='*'
EOT
chmod +x /home/debian/run-erigon.sh
sudo tee /etc/systemd/system/erigon.service > /dev/null <EOT
[Unit]
Description=Erigon Archive Node
After=network.target
[Service]
User=debian
ExecStart=/home/debian/run-erigon.sh
Restart=always
RestartSec=1
LimitNOFILE=1000000
Environment="PATH=/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
[Install]
WantedBy=multi-user.target
EOT
sudo systemctl daemon-reload && sudo systemctl enable --now erigon
sudo systemctl status erigon