Docs
  • InfraDAO Overview
  • ⌨️Indexing 101
    • Linux and Ethereum Clients
      • Introduction to Linux
      • Getting started with Ethereum Clients
      • Lab 1: Sync a Gnosis blockchain node
  • ⌨️Archive Nodes 101
    • Overview
    • ⏫Arbitrum
      • 💻Baremetal
      • 🐳Docker
    • 🔼Arbitrum Sepolia
      • 💻Baremetal
    • 🏔️Avalanche
      • 🐳Docker
    • 🔵Base
      • Erigon
        • 💻Baremetal
      • GETH
        • 💻Baremetal
        • 🐳Docker
    • 🫐Base Sepolia
      • 💻Baremetal
      • 🐋Docker
        • 🐋Op-Reth
    • 🔔Binance
      • Erigon
        • 💻Baremetal
    • 💥Blast
      • 💻Baremetal
    • 🧋Boba
      • 💻Baremetal
      • 🐳Docker
    • 🫖BobaBNB
      • 💻Baremetal
      • 🐳Docker
    • 🟨Celo
      • 🐳Docker
    • 🔷Ethereum
      • 🦦Erigon
        • 💻Baremetal
        • 🐳Docker
      • 🦀Reth
        • 💻Baremetal
        • 🐳Docker
    • 🦄Ethereum Sepolia
      • 🐉Erigon
        • 💻Baremetal
      • 🦥Geth
        • 🐳Docker
    • 👻Fantom
      • 🐳Docker
    • ♻️Fuse
      • 💻Baremetal
    • 🦉Gnosis
      • 🦦Erigon
        • 💻Baremetal
    • 📍Iotex
      • 💻Baremetal
    • 🔲Linea
      • 💻Baremetal
      • 🐳Docker
    • Ⓜ️Mode
      • 💻Baremetal
      • 🐳Docker
    • 🌌Moonbeam
      • 💻Baremetal
      • 🐳Docker
    • 🌛Moonriver
      • 💻Baremetal
      • 🐳Docker
    • 🔴Optimism
      • GETH
        • 🖥️Baremetal
        • 🐳Docker
      • Erigon
        • 💻Baremetal
    • 🍎Optimism Sepolia
      • 🐳Docker
      • 💻Baremetal
    • ♾️Polygon
      • 🐳Docker
    • 👾Polygon zkEVM
      • 🐉Erigon
        • 💻Baremetal
        • 🐳Docker
    • 🛡️Ronin
      • 🐳Docker
      • 💻Baremetal
    • 🫚Rootstock
      • 🐳Docker
      • 💻Baremetal
    • 📜Scroll
      • 🐳Docker
      • 💻Baremetal
    • 🦔Sonic
      • 🐳Docker
      • 💻Baremetal
    • 🌟Starknet
      • 🪶Pathfinder
        • 🐳Docker
      • 🧑‍🚒Firehose
        • 💻Baremetal
        • 🐳Docker
      • 🏵️Juno
        • 🐳Docker
    • ✖️X Layer
      • 🐳Docker
      • 💻Baremetal
        • 🦥Erigon
        • 👽ZK-Node
    • 💤zkSync Era
      • 💻Baremetal
      • 🐳Docker
    • ⚡Zora
      • 🐳Docker
      • 💻Baremetal
Powered by GitBook
On this page
  • System Requirements
  • Pre-requisite
  • Commands:
  • Firewall Settings:
  • Set explicit default UFW rules
  • Allow SSH, HTTP, and HTTPS
  • Allow Remote connection
  • Setup Instructions:
  • Example docker compose file:
  • Monitor Logs
  • Sync Status
  • References

Was this helpful?

Edit on GitHub
  1. Archive Nodes 101
  2. Polygon zkEVM
  3. Erigon

Docker

Authors: [ Ankur | Dapplooker]

System Requirements

CPU
OS
RAM
DISK

4 vCPU

Ubuntu 22.04

64 GB

1TB (SSD)

The CDK-Erigon archival node has a size of 104GB on January 29, 2025.

Pre-requisite

Before starting, clean the setup then update and upgrade. Install following:

  • Docker

  • Docker Compose

  • Git

  • Go v1.19 +

  • L1 Ethereum node RPC

Commands:

sudo apt update -y && sudo apt upgrade -y && sudo apt auto-remove -y
sudo apt install docker.io docker-compose git ufw -y 

Firewall Settings:

Set explicit default UFW rules

sudo ufw default deny incoming
sudo ufw default allow outgoing

Allow SSH, HTTP, and HTTPS

sudo ufw allow 22/tcp
sudo ufw allow 80
sudo ufw allow 443

Allow Remote connection

sudo ufw allow from ${REMOTE.HOST.IP} to any port 8545

Setup Instructions:

Clone the CDK Erigon Repository

Clone the repository and navigate to its root directory:

git clone https://github.com/0xPolygonHermez/cdk-erigon.git
cd cdk-erigon/

Build Libraries

Install the relevant libraries for your architecture:

make build-libs

Configure .env file

Create a .env file to configure environment variables:

echo "NETWORK=mainnet" >> .env
echo "L1_RPC_URL=<ETH_RPC_URL>" >> .env

Example docker compose file:

version: '2.2'
services:
  erigon:
    image: hermeznetwork/cdk-erigon:${TAG:-latest}
    user: root
    build:
      args:
        UID: root
        GID: root
      context: .
    command: ${ERIGON_FLAGS-} --config mainnet.yaml --zkevm.l1-rpc-url=<ETH_RPC_URL>
    environment:
      - name=value
    ports:
      - "8545:8545"
    volumes:
      - /root/cdk-erigon/data:/home/erigon/.local/share/erigon
    restart: unless-stopped
    mem_swappiness: 0

Start the Node

 docker compose -f docker-compose-example.yml up -d

Monitor Logs

Monitor Logs of Docker Container

docker ps 
docker logs  cdk-erigon-erigon-1

Sync Status

Run a query to check the latest synchronized L2 block:

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber",
"params":[],"id":83}' http://localhost:8545

Response should look like:

{"jsonrpc":"2.0","id":83,"result":"0x124ff31"}

References

PreviousBaremetalNextRonin

Last updated 3 months ago

Was this helpful?

⌨️
👾
🐉
🐳
LogoGitHub - 0xPolygonHermez/cdk-erigon: Ethereum implementation on the efficiency frontierGitHub
LogoPolygon zkEVM Blockchain ExplorerPolygon zkEVM Blockchain Explorer