geth init fixes when genesis available. and that fixes reth too

This commit is contained in:
goldsquid
2026-06-07 12:58:54 +07:00
parent 4b03b4cdbc
commit 2a194909da
82 changed files with 895 additions and 145 deletions

View File

@@ -31,6 +31,22 @@ x-logging-defaults: &logging-defaults
# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
services:
xlayer-testnet-archive-init:
image: alpine:3.21
user: root
entrypoint: [/bin/sh, -c]
command:
- |
apk add --no-cache curl wget
mkdir -p /config
[ -f /config/genesis.json ] || wget -qO- "https://okg-pub-hk.oss-cn-hongkong.aliyuncs.com/cdn/chain/xlayer/snapshot/merged.genesis.json.tar.gz" | tar -xzf - -O --wildcards "*.json" > /config/genesis.json
restart: no
networks:
- chains
volumes:
- ./op/xlayer/testnet:/config
logging: *logging-defaults
xlayer-testnet-archive:
image: ${XLAYER_GETH_IMAGE:-xlayer/op-geth}:${XLAYER_TESTNET_GETH_VERSION:-v0.1.4}
sysctls:
@@ -55,7 +71,7 @@ services:
- GENESIS_URL=https://okg-pub-hk.oss-cn-hongkong.aliyuncs.com/cdn/chain/xlayer/snapshot/merged.genesis.json.tar.gz
- GETH_ROLLUP_DISABLETXPOOLGOSSIP=true
- GETH_ROLLUP_SEQUENCERHTTP=https://testrpc.xlayer.tech
entrypoint: /bin/sh -c 'mkdir -p /config && [ ! -f /config/genesis.json ] && wget -qO- "https://okg-pub-hk.oss-cn-hongkong.aliyuncs.com/cdn/chain/xlayer/snapshot/merged.genesis.json.tar.gz" | tar -xzf - -O --wildcards "*.json" > /config/genesis.json; [ ! -d /data/geth ] && geth --gcmode=archive --db.engine=leveldb --datadir /data init --state.scheme=hash /config/genesis.json; exec geth "$@"' --
entrypoint: /bin/sh -c '[ -f /config/genesis.json ] && geth --db.engine=leveldb --gcmode=archive --datadir /data init --state.scheme=hash /config/genesis.json; exec geth "$@"' --
command:
- --config=/config/geth.toml
- --datadir=/data
@@ -86,6 +102,9 @@ services:
- --authrpc.vhosts=*
restart: unless-stopped
stop_grace_period: 5m
depends_on:
xlayer-testnet-archive-init:
condition: service_completed_successfully
networks:
- chains
volumes: