Skip to content

Latest commit

 

History

History
140 lines (100 loc) · 2.76 KB

File metadata and controls

140 lines (100 loc) · 2.76 KB

🐳 Docker

Authors: [ Ankur | Dapplooker]

System Requirements

CPUOSRAMDISK
4 vCPUUbuntu 22.0464 GB1TB (SSD)

{% hint style="info" %} The CDK-Erigon archival node has a size of 104GB on January 29, 2025. {% endhint %}

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:

{% code overflow="wrap" %}

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

{% endcode %}

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:

  1. 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/
  1. Build Libraries

    Install the relevant libraries for your architecture:

make build-libs
  1. 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
  1. 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