Authors: [ Ankur | Dapplooker]
CPU | OS | RAM | DISK |
---|---|---|---|
4 vCPU | Ubuntu 22.04 | 64 GB | 1TB (SSD) |
{% hint style="info" %} The CDK-Erigon archival node has a size of 104GB on January 29, 2025. {% endhint %}
Before starting, clean the setup then update and upgrade. Install following:
- Docker
- Docker Compose
- Git
- Go v1.19 +
- L1 Ethereum node RPC
{% 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 %}
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp
sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow from ${REMOTE.HOST.IP} to any port 8545
-
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
fileCreate a
.env
file to configure environment variables:
echo "NETWORK=mainnet" >> .env
echo "L1_RPC_URL=<ETH_RPC_URL>" >> .env
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 of Docker Container
docker ps
docker logs cdk-erigon-erigon-1
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"}
- Github CDK Erigon : GitHub repository CDK Erigon
- Block Explorer : CDK Erigon Block explorer