description |
---|
Author: [ jLeopoldA ] |
CPU | OS | RAM | DISK |
---|---|---|---|
4 Core | Ubunutu 24.04.1 LTS | 16GB | 128GB |
{% hint style="info" %} The Polygon zkEVM archive node has a size of 103GB as of 1/15/2025 {% endhint %}
{% hint style="info" %} CDK-Erigon requires the installation of Go. {% endhint %}
sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp
sudo ufw allow 8545
sudo ufw allow 30303/tcp && sudo ufw allow 30303/udp
sudo ufw enable
sudo ufw status verbose
# This will return the latest version of GO
curl -s https://go.dev/VERSION?m=text
# Example response
go1.23.3
time 2024-11-06T18:46:45Z
# Downloading using the above example response
wget https://go.dev/d1/go1.23.3.linux-amd64.tar.gz
# Example command if the above version is different
wget https://go.dev/d1/VERSION.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go.1.23.3.linux-amd64.tar.gz
echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go version
# Example response
go version go1.23.3 linux/amd64
cd /root
git clone https://github.com/0xPolygonHermez/cdk-erigon
cd cdk-erigon/cmd/cdk-erigon
go build -o erigon
mkdir -p /var/lib/zkevm/db/
mkdir /root/config/
nano /root/config/config.yaml
datadir: /var/lib/zkevm/db/
chain: hermez-mainnet
http: true
private.api.addr: localhost:9091
zkevm.l2-chain-id: 1101
zkevm.l2-sequencer-rpc-url: https://zkevm-rpc.com
zkevm.l2-datastreamer-url: stream.zkevm-rpc.com:6900
zkevm.l1-chain-id: 1
zkevm.l1-rpc-url: {YOUR_L1_RPC_URL_HERE}
zkevm.address-sequencer: "0x148Ee7dAF16574cD020aFa34CC658f8F3fbd2800"
zkevm.address-zkevm: "0x519E42c24163192Dca44CD3fBDCEBF6be9130987"
zkevm.address-rollup: "0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2"
zkevm.address-ger-manager: "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb"
zkevm.default-gas-price: 1000000000
zkevm.max-gas-price: 0
zkevm.gas-price-factor: 0.0375
zkevm.l1-rollup-id: 1
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 16896700
zkevm.datastream-version: 2
# debug.timers: true # Uncomment to enable timers
externalcl: true
http.port: 8545
http.api: [eth, debug, net, trace, web3, erigon, zkevm]
http.addr: 0.0.0.0
http.vhosts: any
http.corsdomain: any
ws: true
sudo nano /etc/systemd/system/erigon.service
Paste the below configuration and save by entering ctrl+X and Y+ENTER
[Unit]
Description=Zkevm Node
After=network.target
StartLimitIntervalSec=200
StartLimitBurst=5
[Service]
Type=simple
Restart=on-failure
RestartSec=5
TimeoutSec=900
User=root
Nice=0
LimitNOFILE=200000
WorkingDirectory=/root/cdk-erigon/
ExecStart=/root/cdk-erigon/cmd/cdk-erigon/erigon \
--config="/root/config/config.yaml"
KillSignal=SIGTERM
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload # Refresh after systemd configuration changes
sudo systemctl enable erigon.service # Enable erigon.service at start up
sudo systemctl start erigon.service # Starts erigon.service
sudo systemctl stop erigon.service # Stops erigon.service
sudo systemctl restart erigon.service # Restarts erigon.service
journalctl -fu erigon.service -xe
journalctl -fu erigon.service -o cat
{% hint style="info" %} CDK-Erigon does take time to process blocks before you can fully query it. {% endhint %}
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://localhost:8545
# Example response
{"jsonrpc":"2.0","id":1,"result":"0x40e2d5"}
{% embed url="https://github.com/0xPolygonHermez/cdk-erigon" %}