Eridian
eridian.xyzx.comGitHub
  • 📖Eridian Docs
  • Ethereum Dev
    • ✏️Ethereum Notes
      • 🎛️Technical Basics
      • 🪧Ethereum Addresses
      • 📚Ethereum State Explained
      • ⛽Gas Fees Explained
    • 🔧Useful Tools
      • ☁️Ethers
      • *️⃣Ethernal
    • 📝Solidity Notes
      • ❔Interview Questions
        • 🟢1. Easy - Interview Questions
        • 🟠2. Medium - Interview Questions
        • 🟡3. Hard - Interview Questions
        • 🔴4. Advanced - Interview Questions
      • 💡Note Ideas
      • ABI
      • abi.encodePacked
      • Abstract Contracts
      • Arrays
      • Casting
      • CEI - Checks, Effects, Interactions
      • Comments (NATSPEC)
      • Constructor
      • Contract Structure & Versions
      • Data - Storage vs Memory
      • Data - Storage Layout
      • Enum
      • Errors (require & revert)
      • Events
      • EVM Opcodes
      • External Contract Interaction
      • 🏗️External Dependencies
      • Functions
      • Function Modifiers
      • If / Else / For / While Loops
      • Inheritance
      • Interfaces
      • Keccak256
      • Library
      • Mappings
      • msg.sender
      • Objects & Types
      • OpenZeppelin
      • Payable
      • Public State Variable vs Function
      • Receive & Fallback
      • Security
      • Self Destruct
      • Send ETH (transfer, send, call)
      • Stack Too Deep
      • Structs
      • Style Guide
      • Time Units
      • Try / Catch
      • Typecasting
      • Using Directive
      • Variables, Consts & Immutable
      • Withdraws
    • ⚒️Foundry Notes
      • 📖Docs & GitHub Pages
      • 🤝Useful Commands
        • 🔨Anvil
        • 🪄Cast
        • 🔥Forge
      • 🧪Tests
        • Cheatcodes
      • 📝Useful Scripts
        • Deploy Contract Using Hex
    • 👾DeFi Challenges
      • 👨‍🚀Ethernaut
        • Ethernaut - Template
        • Level 1 - Fallback ⏺
        • Level 2 - Fallout ⏺
        • Level 3 - Coin Flip ⏺⏺
        • Level 4 - Telephone ⏺
        • Level 5 - Token ⏺⏺
        • Level 6 - Delegation ⏺⏺
        • Level 7 - Force ⏺⏺⏺
        • Level 8 - Vault ⏺⏺
        • Level 9 - King ⏺⏺⏺
        • Level 10 - Re-entrancy ⏺⏺⏺
        • Level 11 - Elevator ⏺⏺
        • Level 12 - Privacy ⏺⏺⏺
        • Level 13 - Gatekeeper 1 ⏺⏺⏺⏺
        • Level 14 - Gatekeeper 2 ⏺⏺⏺
        • Level 15 - Naught Coin ⏺⏺⏺
        • Level 16 - Preservation ⏺⏺⏺⏺
        • Level 17 - Recovery ⏺⏺⏺
        • Level 18 - Magic Number ⏺⏺⏺
        • Level 19 - Alien Codex ⏺⏺⏺⏺
        • Level 20 - Denial ⏺⏺⏺
        • Level 21 - Shop ⏺⏺
        • Level 22 - Dex ⏺⏺
        • Level 23 - Dex Two ⏺⏺
        • Level 24 - Puzzle Wallet ⏺⏺⏺⏺
        • Level 25 - Motorbike ⏺⏺⏺
        • Level 26 - DoubleEntryPoint ⏺⏺
        • Level 27 - Good Samaritan ⏺⏺⏺
        • Level 28 - Gatekeeper 3 ⏺⏺⏺
        • Level 29 - Switch ⏺⏺⏺⏺
        • Level 30 - Higher Order ⏺⏺⏺⏺
        • Level 31 - Stake ⏺⏺⏺
      • 💸Damn Vulnerable DeFi
    • 🔍Auditing
      • 🗞️Exploit Resources
      • 🔧Audit Tools
    • 🤖MEV
  • Infrastructure Docs
    • 💻Hardware
    • 🐧Linux
      • 📖Linux Glossary
      • ⌨️Linux Commands
      • 💾Installation
      • 🏗️Maintenance
      • 🖥️Ubuntu Desktop
      • 🛜ZeroTier
      • 🎞️TMUX
      • 🔵Bluetooth
    • ⛓️Ethereum Clients
      • ⚙️Execution Clients
        • ⛏️Geth
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
        • 🐻Erigon
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
        • 🧶Besu
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
      • 🤝Beacon Clients
        • 💡Lighthouse
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
        • 🪅Teku
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
      • 💎Validator Clients
        • 💡Lighthouse
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
      • ➕L2 Clients
        • 🔵Base
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
      • 💰MEV Boost
        • 💾Installation
        • 🏗️Maintenance
    • 🚨Alerting and Monitoring
      • 🔥Prometheus
      • 🌡️HealthChecks.io
      • 📟PagerDuty
  • General Dev
    • 💾Git Notes
      • Repos
      • Committing changes
      • Branches
      • Merging & Rebasing
      • PRs
Powered by GitBook
On this page
  • Create Aliases
  • Firewall Configuration
  • Erigon - Install
  • Erigon - Configure Service
  • Erigon - Command Aliases
  • Erigon - Update Scripts
Edit on GitHub
  1. Infrastructure Docs
  2. Ethereum Clients
  3. Execution Clients
  4. Erigon

Installation

Erigon client installation guide.

Create Aliases

These aliases make interacting with Erigon on the command line easier.

echo "alias erigon-log='journalctl -f -u erigon.service -o cat | ccze -A'" >> ~/.bashrc
echo "alias erigon-start='sudo systemctl start erigon.service'" >> ~/.bashrc
echo "alias erigon-stop='sudo systemctl stop erigon.service'" >> ~/.bashrc
echo "alias erigon-restart='sudo systemctl restart erigon.service'" >> ~/.bashrc
echo "alias erigon-status='sudo systemctl status erigon.service'" >> ~/.bashrc

echo "alias erigon-version='sudo /usr/local/bin/erigon --version'" >> ~/.bashrc
echo "alias erigon-config='sudo vim /etc/systemd/system/erigon.service'" >> ~/.bashrc

echo "alias erigon-enable='sudo systemctl enable erigon.service'" >> ~/.bashrc
echo "alias erigon-disable='sudo systemctl disable erigon.service'" >> ~/.bashrc

echo "alias erigon-delete-data='sudo rm -rf /var/lib/goethereum/erigon'" >> ~/.bashrc
echo "alias erigon-update='~/erigon-update.sh'" >> ~/.bashrc

source ~/.bashrc

Firewall Configuration

Erigon - Install

Build the latest version of Erigon.

ERIGON_VERSION_COMMIT_HASH=        # e.g.3f907d6

cd ~
git clone --recurse-submodules https://github.com/ledgerwatch/erigon.git
cd erigon
git checkout ${ERIGON_VERSION_COMMIT_HASH}
make erigon

Move the compiled Erigon build to a new directory.

sudo cp ~/erigon/build/bin/erigon /usr/local/bin

Create Erigon user and directory.

sudo useradd --no-create-home --shell /bin/false erigon
sudo mkdir -p /var/lib/erigon

Erigon - Configure Service

Set permissions.

sudo chown -R erigon:erigon /var/lib/erigon

Configure Erigon service using the command line flags.

sudo vim /etc/systemd/system/erigon.service
/etc/systemd/system/erigon.service
[Unit]
Description=Erigon Ethereum Client - Execution Node
After=network.target
Wants=network.target

[Service]
User=erigon
Group=erigon
Type=simple
Restart=always
RestartSec=5
TimeoutStopSec=1200

EnvironmentFile=/etc/default/execution-variables.env

ExecStart=/usr/local/bin/erigon \
    --internalcl \
    --chain ${NETWORK} \
    --port ${EXECUTION_P2P_PORT} \
    --datadir /var/lib/erigon \
    \
    --pprof \
    --metrics \
    --metrics.addr ${EXECUTION_METRICS_ADDR} \
    --metrics.port ${EXECUTION_METRICS_PORT} \
    \
    --authrpc.jwtsecret=/var/lib/jwtsecret \
    --maxpeers ${EXECUTION_MAX_PEERS} \
    \
    --ws \
    --ws.port ${EXECUTION_WS_PORT} \
    \
    --http \
    --http.api "eth,erigon,engine" \
    --http.vhosts "*" \
    --http.corsdomain "*" \
    --http.addr ${EXECUTION_RPC_ADDR} \
    --http.port ${EXECUTION_RPC_PORT} \
    \
    --torrent.download.rate=512mb

[Install]
WantedBy=default.target

Start the service and check it's working as expected.

Erigon - Command Aliases

daemon-reload     # Reload any changes made to the erigon.service
erigon-enable     # Enable the erigon.service
erigon-start      # Start the erigon.service
erigon-status     # View the status of the erigon.service

erigon-log        # View the erigon.service logs

Erigon - Update Scripts

Create Erigon update script.

vim ~/erigon-update.sh
~/erigon-update.sh
#!/bin/bash
set -e

while true; do
    read -p "Are you sure you want to update Erigon? (Y/N) " yn
    case $yn in
        [Yy]* ) break;;
        [Nn]* ) exit;;
        * ) echo "Please answer Y or N.";;
    esac
done

cd ~/erigon

read -p "Enter the commit hash you want to checkout: " commit_hash

git fetch
git checkout $commit_hash

echo
echo "****************"
echo "Making Erigon..."
echo "****************"
make erigon

# Check if erigon.service is running
service_was_running=0
if sudo systemctl is-active --quiet erigon.service; then
    service_was_running=1
    echo "******************"
    echo "Stopping Erigon..."
    sudo systemctl stop erigon.service
fi

echo "Replacing previous version..."
sudo rm -rf /usr/local/bin/erigon
sudo cp ~/erigon/build/bin/erigon /usr/local/bin

# Only start erigon.service if it was running originally
if [ $service_was_running -eq 1 ]; then
    echo "Restarting Erigon..."
    echo "********************"
    sudo systemctl start erigon.service
fi

Make the script executable.

chmod u+x ~/erigon-update.sh

Last updated 8 months ago

Configure the firewall using generic Execution client UFW settings:

JWT Secret is now shared between all clients on the same machine:

Configure .

⛓️
⚙️
🐻
💾
#ufw
Create JWT Secret
Execution Service Environment Variables