Deploy an erigon rpc

Deployment Overview

  • Erigon RPC can be deployed independently without relying on other mainnet RPC components (CDK / Prover / Database). You can choose to deploy it together with JSON-RPC or separately.

  • Erigon RPC depends on a JSON-RPC and an upstream DataStreamer.

  • Recommended configuration: CPU: 4 vCores, RAM: 32GB, Disk: 1TB, NVMe SSD. Higher IOPS and throughput performance will yield better results. It is recommended to have 250,000 IOPS and 1000 MiB/s throughput.

Deployment Steps

Prepare configuration files

docker compose file

version: "3.5"
networks:
  default:
    name: cdk-erigon
services:
  cdk-erigon-rpc:
    container_name: cdk-erigon-rpc
    image: merlinadmin/cdk-erigon:v1.0.0
    stop_grace_period: 600s
    environment:
      - CDK_ERIGON_SEQUENCER=0
    ports:
      - 9123:8123
      - 7990:6990
    volumes:
      - ./erigon_config/config-rpc.yaml:/usr/src/app/config.yaml
      - ./erigon_config/dynamic-merlinmainnet-allocs.json:/usr/src/app/dynamic-merlinmainnet-allocs.json
      - ./erigon_config/dynamic-merlinmainnet-chainspec.json:/usr/src/app/dynamic-merlinmainnet-chainspec.json
      - ./erigon_config/dynamic-merlinmainnet-conf.json:/usr/src/app/dynamic-merlinmainnet-conf.json
      - ./erigon_data/data:/usr/src/app/data/
    command: >
      cdk-erigon --http.vhosts=* --http.corsdomain=* --ws --config=/usr/src/app/config.yaml
    logging:
        options:
          max-size: "1g"
          max-file: "3"

config-rpc.yaml

datadir: /usr/src/app/data/
chain: dynamic-merlinmainnet
http: true
private.api.addr: localhost:9098
torrent.port: 42070
authrpc.port: 8552
zkevm.l2-chain-id: 4200
zkevm.l2-sequencer-rpc-url: https://rpc.merlinchain.io #can be replaced with local json-rpc
zkevm.l2-datastreamer-url: erigon-rpc.merlinchain.io #datastreamer
zkevm.l1-chain-id: 202401
zkevm.l1-rpc-url: https://mainnet-l1.merlinchain.io

zkevm.address-sequencer: "0x1B46c54ebE88F22cBFf2Bd4eB4545C47Bb2f3017"
zkevm.address-zkevm: "0xBf4B031eb29fc34E2bCb4327F9304BED3600cc46"
zkevm.address-admin: "0x6229976bf881Ee0e2499e8bDbDFd44E396b2aE7d"
zkevm.address-rollup: "0x68DdbE6638d7514a9Ed0B9B2980B65970e532cdB"
zkevm.address-ger-manager: "0x8b97BF5C42739C375a2db080813E9b4C9A4a2c9A"

zkevm.l1-rollup-id: 1
zkevm.l1-first-block: 85544
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-highest-block-type: latest
zkevm.rpc-ratelimit: 300
zkevm.datastream-version: 2
zkevm.rebuild-tree-after: 10000

log.console.verbosity: 3

zkevm.executor-urls: ""
zkevm.executor-strict: false
zkevm.witness-full: true

zkevm.sequencer-block-seal-time: "6s"
zkevm.sequencer-batch-seal-time: "12s"

zkevm.data-stream-host: "localhost"
zkevm.data-stream-port: 6990
zkevm.data-stream-writeTimeout: "100s"
zkevm.default-gas-price: 1000000000
zkevm.max-gas-price: 0
zkevm.gas-price-factor: 0.000001
externalcl: true
http.api: [eth, debug, net, trace, web3, erigon, txpool, zkevm]
http.addr: 0.0.0.0
http.port: 8123
http.vhosts: any
http.corsdomain: any
ws: true
db.read.concurrency: 20000
txpool.globalslots: 100000
networkid: 4200

Static configurations

wget https://rpc-snapshot.merlinchain.io/erigon/dynamic-merlinmainnet-allocs.json
wget https://rpc-snapshot.merlinchain.io/erigon/dynamic-merlinmainnet-chainspec.json
wget https://rpc-snapshot.merlinchain.io/erigon/dynamic-merlinmainnet-conf.json

Snapshot

Download erigon data snapshot

wget https://rpc-snapshot.merlinchain.io/erigon/erigon_data.tar.gz

Launch erigon

  • Ensure that the erigon-config and erigon-data directories are consistent with the volumes configuration in docker-compose.yml.

docker compose up -d cdk-erigon-rpc

Last updated