Skip to main content

Ethereum Mainnet Node Setup Guide

This guide will help you set up an Ethereum full node on the mainnet using automated Ansible playbooks. The setup includes both execution layer (Geth) and consensus layer (Lighthouse/Prysm) clients with MEV-Boost support.

Prerequisites

System Requirements

  • Operating System: Ubuntu 20.04/22.04 LTS x64
  • CPU: 4+ cores (8+ cores recommended)
  • Memory: 32GB RAM minimum (64GB recommended for mainnet)
  • Storage:
    • Execution client: 2TB+ NVMe SSD
    • Consensus client: 500GB+ SSD
  • Network: Stable internet connection with 25+ Mbps
  • Access: Root or sudo privileges

Network Information

ComponentValueDescription
NetworkEthereum MainnetProduction network
Execution ClientGethGo Ethereum implementation
Consensus ClientLighthouse/PrysmBeacon chain validators
MEV-BoostEnabledMEV extraction support
Sync ModeSnap SyncFast synchronization
Storage~2TB+Current mainnet size
tip

This guide uses automated Ansible playbooks for easy deployment and management. The setup is production-ready and includes monitoring, security, and backup configurations.

tip

The following commands are executed as root by default. If you are not a root user, please prepend the commands with sudo.

Installation Method: Ansible Automation

This method uses the ethnode-infra project for automated deployment.

Step 1: Install Prerequisites

sudo -i

# Update system packages
apt update
apt install -y git python3 python3-pip ansible openssh-server curl jq wget aria2

# Install required Ansible collections
ansible-galaxy collection install community.general
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install community.docker

# Verify installations
python3 --version
ansible --version
ssh -V

Step 2: Clone the Repository

# Clone the ethnode-infra repository
git clone https://github.com/ronnynth/ethnode-infra.git
cd ethnode-infra

# Set environment variables
export ETH_NODE_DIR=$(pwd)
export NODE_NAME="ethereum-mainnet-node"
info

The ethnode-infra project provides production-ready Ansible playbooks for deploying Ethereum nodes with best practices for security, monitoring, and maintenance.

Step 3: Configure Inventory

Create an inventory file for your setup:

# Create inventory file
cat > hosts << EOF
[ethereum_nodes]
eth-node-01 ansible_host=localhost ansible_connection=local ansible_user=${USER}

[qcloud]
qcloud-eth-01 ansible_host=localhost ansible_connection=local ansible_user=${USER}
EOF

Step 4: Configure Deployment Variables

Update the deploy.yml file to match your environment:

# Edit deploy.yml
vars:
execution_disk: /dev/sdb # Your actual disk device
consensus_disk: /dev/sdc # Secondary disk or same as execution
network: mainnet # Network selection
checkpoint: https://mainnet.checkpoint.sigp.io

Step 5: Configure Fee Recipient (Important)

Update the fee recipient address in role variables:

# For Lighthouse
cat > roles/lighthouse/vars/main.yml << EOF
---
recipient: "0xYOUR_ETHEREUM_ADDRESS_HERE"
EOF

# For Prysm (if using)
cat > roles/prysm/vars/main.yml << EOF
---
recipient: "0xYOUR_ETHEREUM_ADDRESS_HERE"
EOF
warning

Critical: Replace 0xYOUR_ETHEREUM_ADDRESS_HERE with your actual Ethereum address to receive block rewards and MEV fees.

Step 6: Run the Deployment

Option 1: Full Automated Setup

# Deploy everything
ansible-playbook -i hosts deploy.yml

# This will:
# 1. Install system dependencies (Docker, Go, monitoring tools)
# 2. Configure disk management and mounting
# 3. Install and configure Geth (execution client)
# 4. Install and configure Lighthouse/Prysm (consensus client)
# 5. Set up MEV-Boost with multiple relays
# 6. Configure systemd services
# 7. Set up JWT authentication
# 8. Optimize system parameters

Option 2: Step-by-Step Deployment

# Deploy base system components
ansible-playbook -i hosts deploy.yml --tags "base"

# Deploy Geth execution client
ansible-playbook -i hosts deploy.yml --tags "geth"

# Deploy Lighthouse consensus client
ansible-playbook -i hosts deploy.yml --tags "lighthouse"

# Deploy MEV-Boost
ansible-playbook -i hosts deploy.yml --tags "mev"

Step 7: Start the Services

# Start Geth (execution layer)
systemctl start geth
systemctl enable geth

# Wait for Geth to sync (this can take several hours)
journalctl -u geth -f

# Start Lighthouse (consensus layer)
systemctl start lighthouse
systemctl enable lighthouse

# Start MEV-Boost
systemctl start mev-boost
systemctl enable mev-boost

# Check service status
systemctl status geth lighthouse mev-boost

Step 8: Monitor Synchronization

# Check Geth sync status
curl -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' \
http://localhost:8545

# Check Lighthouse sync status
curl http://localhost:5052/eth/v1/node/syncing

# Check MEV-Boost status
curl http://localhost:18550/eth/v1/builder/status

# View logs
journalctl -u geth -f
journalctl -u lighthouse -f
journalctl -u mev-boost -f

Architecture Overview

The deployment creates a complete Ethereum node infrastructure:

┌─────────────────────────────────────────────────────────────┐
│ Ethereum Node Infrastructure │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌──────────────┐ ┌─────────────────────┐ │
│ │ Geth │ │ Lighthouse │ │ MEV-Boost │ │
│ │ (Execution) │◄─┤ (Consensus) │◄─┤ (Relay) │ │
│ │ │ │ │ │ │ │
│ │ Port: 8545 │ │ Port: 5052 │ │ Port: 18550 │ │
│ │ Port: 8546 │ │ │ │ │ │
│ │ Port: 8551 │ │ │ │ │ │
│ └─────────────┘ └──────────────┘ └─────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ Base System Components │ │
│ │ • Docker │ │
│ │ • Go language runtime │ │
│ │ • System optimization (kernel params, limits) │ │
│ │ • Disk management and mounting │ │
│ │ • Monitoring tools (htop, iotop, prometheus-exporter) │ │
│ └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘

Directory Structure

After deployment, your node will have this structure:

/data/
├── execution/ # Geth execution client data
│ ├── chaindata/ # Blockchain data
│ ├── nodes/ # Network peers
│ ├── geth.ipc # IPC socket
│ └── .jwt.hex # JWT secret for Engine API
├── consensus/ # Lighthouse consensus client data
│ ├── beacon/ # Beacon chain data
│ ├── validators/ # Validator keys (if staking)
│ ├── logs/ # Client logs
│ └── .jwt.hex # JWT secret for Engine API
└── mev-boost/ # MEV-Boost data
├── logs/ # MEV logs
└── .jwt.hex # JWT secret

MEV-Boost Configuration

The setup includes multiple MEV relays for optimal performance:

  • Flashbots - Most popular MEV relay
  • Titan Relay - High performance relay
  • Agnostic Relay - Decentralized relay
  • Ultra Sound Money - Community relay
  • Aestus - Professional relay
  • SecureRPC - Secure relay
  • BloxRoute - Max Profit & Regulated relays
  • Eden Network - Alternative relay

Configuration Customization

Execution Client Options

# The playbook supports multiple execution clients:
# - Geth (default) - Most popular, well-tested
# - Nethermind - Fast sync, .NET ecosystem
# - Besu - Enterprise features, Java-based
# - Erigon - Efficient storage, fast sync

Consensus Client Options

# Switch to Prysm instead of Lighthouse:
# Edit deploy.yml and replace lighthouse role with:
- role: prysm
vars:
base_dir: "{{ consensus_data_dir }}"
tags: ['prysm', 'consensus']

Network Configuration

# For Mainnet (default)
network: mainnet
checkpoint: https://mainnet.checkpoint.sigp.io

# For Holesky testnet
network: holesky
checkpoint: https://holesky.checkpoint.sigp.io

# For Sepolia testnet
network: sepolia
checkpoint: https://sepolia.checkpoint.sigp.io

Service Management

Basic Operations

# Check service status
systemctl status geth
systemctl status lighthouse
systemctl status mev-boost

# View logs
journalctl -u geth -f
journalctl -u lighthouse -f
journalctl -u mev-boost -f

# Restart services
systemctl restart geth
systemctl restart lighthouse
systemctl restart mev-boost

# Stop services
systemctl stop geth lighthouse mev-boost

Updates

# Update Geth
ansible-playbook -i hosts deploy.yml --tags "update.geth"

# Update Lighthouse
ansible-playbook -i hosts deploy.yml --tags "update.lighthouse"

# Update MEV-Boost
ansible-playbook -i hosts deploy.yml --tags "update.mev"

Monitoring and Maintenance

Built-in Monitoring Tools

The playbook installs monitoring tools:

  • htop - Process monitoring
  • iotop - I/O monitoring
  • iftop - Network monitoring
  • prometheus-node-exporter - Metrics export

Performance Monitoring

# Monitor resource usage
htop
iotop
iftop

# Check disk usage
df -h /data/execution
df -h /data/consensus

# Monitor sync progress
journalctl -u geth -f | grep "Imported new chain segment"
journalctl -u lighthouse -f | grep "Synced"

Backup Considerations

Critical data to backup:

# JWT tokens
/data/execution/.jwt.hex
/data/consensus/.jwt.hex
/data/mev-boost/.jwt.hex

# Validator keys (if running validators)
/data/consensus/validators/

# Configuration files
/etc/systemd/system/geth.service
/etc/systemd/system/lighthouse.service
/etc/systemd/system/mev-boost.service

Troubleshooting

Common Issues

  1. Disk not found: Update execution_disk and consensus_disk variables in deploy.yml
  2. Permission denied: Ensure SSH key authentication is working
  3. Port conflicts: Check if ports 8545, 8546, 8551, 5052, 9000, 18550 are available
  4. Sync issues: Verify network connectivity and disk space

Log Analysis

# Check for errors in logs
journalctl -u geth --since "1 hour ago" | grep -i error
journalctl -u lighthouse --since "1 hour ago" | grep -i error
journalctl -u mev-boost --since "1 hour ago" | grep -i error

# Monitor sync progress
journalctl -u geth -f | grep "Imported new chain segment"
journalctl -u lighthouse -f | grep "Synced"

Performance Tuning

  1. I/O Performance: Ensure SSD disks, enable noatime mount option
  2. Network: Optimize peer connections, use fast internet
  3. Memory: Consider increasing if experiencing OOM issues
  4. CPU: Modern multi-core processor recommended

Security Features

JWT Authentication

  • Each client uses unique JWT tokens for secure communication
  • All JWT tokens are randomly generated and unique per deployment
  • Execution ↔ Consensus client authentication

System Hardening

  • Optimized kernel parameters for network performance
  • Increased file descriptor limits
  • Docker daemon security configuration
  • Proper file permissions and ownership

Support Resources

For help and support:


info

This setup creates a production-ready Ethereum node with MEV-Boost support, monitoring, security, and maintenance automation. The node will automatically stay synchronized with the Ethereum mainnet.

warning

Important Notes:

  • Initial sync can take 6-24 hours depending on hardware and network
  • Ensure you have adequate storage space (2TB+ recommended)
  • Monitor resource usage during initial sync
  • Keep your system updated for security
  • Always test on testnets before deploying to mainnet