blockbook icon indicating copy to clipboard operation
blockbook copied to clipboard

A proper way of syncing on Erigon full node

Open Sahaquielxo opened this issue 6 months ago • 2 comments

Hi, I'd appreciate if you help me to figure out proper steps to set up Blockbook with Erigon. My node is running in full mode (--prune.mode=full), there are all my custom parameters for docker:

      - --prune.mode=full
      - --torrent.port=42069
      - --torrent.download.rate=100mb
      - --torrent.conns.perfile=16
      - --torrent.download.slots=64
      - --maxpeers=100
      - --nat=extip:x.x.x.x
      - --http
      - --http.addr=0.0.0.0
      - --http.port=28545
      - --http.api=eth,erigon,engine,net,web3,debug,trace,txpool
      - --http.vhosts=localhost,erigon,192.168.0.12,10.0.0.12
      - --ws
      - --ws.port=28546
      - --datadir=/data
      - --authrpc.addr=0.0.0.0
      - --authrpc.port=28551
      - --authrpc.jwtsecret=/secrets/jwt.hex
      - --authrpc.vhosts=localhost,erigon,*
      - --authrpc.timeouts.read=60s
      - --authrpc.timeouts.idle=5m
      - --private.api.addr=0.0.0.0:9090
      - --port=31303
      - --beacon.api=beacon,config,debug,node,lighthouse
      - --beacon.api.addr=0.0.0.0
      - --beacon.api.port=5555
      - --maxpeers=80
      - --caplin.discovery.port=12000
      - --caplin.discovery.tcpport=13000

I've also started blockbook v0.5.0 as:

      blockbook
        -blockchaincfg=/configs/ethereum-classic.json
        -datadir=/data
        -sync
        -internal=0.0.0.0:9030
        -public=0.0.0.0:9130
        -explorer=1
        -logtostderr
        -workers=1
        -enablesubnewtx
        -extendedindex
        -debug=1

And my ethereum-classic.json:

{
    "address_aliases": true,
    "consensusNodeVersion": "http://erigon:5555/eth/v1/node/version",
    "eip1559Fees": true,
    "fiat_rates": "coingecko",
    "fiat_rates_params": "{\"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}",
    "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH",
    "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/",
    "mempoolTxTimeoutHours": 48,
    "queryBackendOnMempoolResync": false,
    "coin_name": "Ethereum",
    "coin_shortcut": "ETH",
    "coin_label": "Ethereum",
    "rpc_url": "ws://erigon:28546",
    "rpc_user": "",
    "rpc_pass": "",
    "rpc_timeout": 25,
    "parse": true,
    "message_queue_binding": "",
    "subversion": "",
    "address_format": "",

    "mempool_workers": 8,
    "mempool_sub_workers": 2,
    "block_addresses_to_keep": 300
}

And don't quite get what's going on after: both processes are running fine, Blockbok syncs 46146 blocks within a minute and then kind of hangs:

% curl -sS http://10.0.0.12:38332/api/v2/ | jq .
{
  "blockbook": {
    "coin": "Ethereum",
    "network": "ETH",
    "host": "df5781377100",
    "version": "devel",
    "gitCommit": "local",
    "buildTime": "2023-10-01T00:00:00Z",
    "syncMode": true,
    "initialSync": false,
    "inSync": false,
    "bestHeight": 46146,
    "lastBlockTime": "2025-08-23T09:12:31.898516233Z",
    "inSyncMempool": true,
    "lastMempoolTime": "2025-08-24T16:45:54.198894088Z",
    "mempoolSize": 1157704,
    "decimals": 18,
    "dbSize": 10410641,
    "hasFiatRates": true,
    "hasTokenFiatRates": true,
    "about": "Blockbook - blockchain indexer for Trezor Suite https://trezor.io/trezor-suite. Do not use for any other purpose."
  },
  "backend": {
    "chain": "mainnet",
    "blocks": 23212230,
    "bestBlockHash": "0x1f7a5353f448ea3e7609c129dbf0e166451213915076674482a0c4adfdea1850",
    "difficulty": "0",
    "version": "erigon/3.0.15/linux-amd64/go1.23.11",
    "consensus_version": "Caplin/v3.0.15 linux/amd64"
  }
}

And nothing happens then, for the last 30 hours in logs I see:

I0824 16:42:55.264859       1 sync.go:143] resync: local at 46146 is behind
E0824 16:42:55.266654       1 blockbook.go:528] syncIndexLoop Block not found
I0824 16:42:56.298122       1 mempool_ethereum_type.go:131] Mempool: resync 1155615 transactions in mempool
I0824 16:42:57.506844       1 mempool_ethereum_type.go:131] Mempool: resync 1155637 transactions in mempool
I0824 16:42:58.898491       1 mempool_ethereum_type.go:131] Mempool: resync 1155653 transactions in mempool
I0824 16:43:00.398507       1 mempool_ethereum_type.go:131] Mempool: resync 1155667 transactions in mempool
I0824 16:43:01.499822       1 mempool_ethereum_type.go:131] Mempool: resync 1155692 transactions in mempool
I0824 16:43:02.698822       1 mempool_ethereum_type.go:131] Mempool: resync 1155710 transactions in mempool
I0824 16:43:03.541525       1 sync.go:143] resync: local at 46146 is behind
E0824 16:43:03.543083       1 blockbook.go:524] syncIndexLoop Block not found, will retry...

As I understood, blockbook in my configuration tries to sync from genesis. But my fully synced node isn't archived, so it doesn't contain all blocks. I've read docs, looked at opened and closed issues I didn't get how to properly run Blockbook with my node congifuration. Am I supposed to pass -blockheight=X and start syncing from the earliest available block on my node, or just wait?

Thanks a lot.

Sahaquielxo avatar Aug 24 '25 16:08 Sahaquielxo

We experienced a similar behaviour. I believe this might be due to the bulk import reaching for the 23 million blocks, try declaring intervals in your blockbook configuration:

[Service]
ExecStart=
ExecStart=/opt/coins/blockbook/ethereum_archive/bin/blockbook \
        -blockchaincfg=/opt/coins/blockbook/ethereum_archive/config/blockchaincfg.json \
        -datadir=/opt/coins/data/ethereum_archive/blockbook/db -sync -internal=:9016 -public=:9116 \
        -certfile=/opt/coins/blockbook/ethereum_archive/cert/blockbook -explorer= -log_dir=/opt/coins/blockbook/ethereum_archive/logs \
        -blockheight=2500000 \
        -blockuntil=80000000 \
        -sync=false \
        -workers=16

makstr avatar Aug 25 '25 22:08 makstr

Hi @Sahaquielxo, does the issue still persist?

etimofeeva avatar Oct 22 '25 21:10 etimofeeva