From 8b82985f56d74a3734896d80ffac3a24ed9dc050 Mon Sep 17 00:00:00 2001 From: Yukai Tu Date: Wed, 28 Feb 2024 11:31:19 -0800 Subject: [PATCH] Add snapsync bootnodes to op-geth (#208) Co-authored-by: Yukai Tu --- .env.mainnet | 1 + .env.sepolia | 1 + geth-entrypoint | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.env.mainnet b/.env.mainnet index 022785e..c6ea4ca 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -1,5 +1,6 @@ OP_GETH_GENESIS_FILE_PATH=mainnet/genesis-l2.json OP_GETH_SEQUENCER_HTTP=https://mainnet-sequencer.base.org +OP_GETH_BOOTNODES=enode://87a32fd13bd596b2ffca97020e31aef4ddcc1bbd4b95bb633d16c1329f654f34049ed240a36b449fda5e5225d70fe40bc667f53c304b71f8e68fc9d448690b51@3.231.138.188:30301,enode://ca21ea8f176adb2e229ce2d700830c844af0ea941a1d8152a9513b966fe525e809c3a6c73a2c18a12b74ed6ec4380edf91662778fe0b79f6a591236e49e176f9@184.72.129.189:30301,enode://acf4507a211ba7c1e52cdf4eef62cdc3c32e7c9c47998954f7ba024026f9a6b2150cd3f0b734d9c78e507ab70d59ba61dfe5c45e1078c7ad0775fb251d7735a2@3.220.145.177:30301,enode://8a5a5006159bf079d06a04e5eceab2a1ce6e0f721875b2a9c96905336219dbe14203d38f70f3754686a6324f786c2f9852d8c0dd3adac2d080f4db35efc678c5@3.231.11.52:30301,enode://cdadbe835308ad3557f9a1de8db411da1a260a98f8421d62da90e71da66e55e98aaa8e90aa7ce01b408a54e4bd2253d701218081ded3dbe5efbbc7b41d7cef79@54.198.153.150:30301 # [optional] used to enable geth stats: # OP_GETH_ETH_STATS=nodename:secret@host:port diff --git a/.env.sepolia b/.env.sepolia index a74a035..a644e95 100644 --- a/.env.sepolia +++ b/.env.sepolia @@ -1,5 +1,6 @@ OP_GETH_GENESIS_FILE_PATH=sepolia/genesis-l2.json OP_GETH_SEQUENCER_HTTP=https://sepolia-sequencer.base.org +OP_GETH_BOOTNODES=enode://548f715f3fc388a7c917ba644a2f16270f1ede48a5d88a4d14ea287cc916068363f3092e39936f1a3e7885198bef0e5af951f1d7b1041ce8ba4010917777e71f@18.210.176.114:30301,enode://6f10052847a966a725c9f4adf6716f9141155b99a0fb487fea3f51498f4c2a2cb8d534e680ee678f9447db85b93ff7c74562762c3714783a7233ac448603b25f@107.21.251.55:30301 # [optional] used to enable geth stats: # OP_GETH_ETH_STATS=nodename:secret@host:port diff --git a/geth-entrypoint b/geth-entrypoint index f401025..9ea5290 100755 --- a/geth-entrypoint +++ b/geth-entrypoint @@ -11,6 +11,7 @@ HOST_IP="0.0.0.0" P2P_PORT="${P2P_PORT:-30303}" ADDITIONAL_ARGS="" OP_GETH_GCMODE="${OP_GETH_GCMODE:-archive}" +OP_GETH_SYNCMODE="${OP_GETH_SYNCMODE:-snap}" if [[ -z "$OP_NODE_NETWORK" ]]; then echo "expected OP_NODE_NETWORK to be set" 1>&2 @@ -33,6 +34,10 @@ if [ "${OP_GETH_STATE_SCHEME+x}" = x ]; then ADDITIONAL_ARGS="$ADDITIONAL_ARGS --state.scheme=$OP_GETH_STATE_SCHEME" fi +if [ "${OP_GETH_BOOTNODES+x}" = x ]; then + ADDITIONAL_ARGS="$ADDITIONAL_ARGS --bootnodes=$OP_GETH_BOOTNODES" +fi + exec ./geth \ --datadir="$GETH_DATA_DIR" \ --verbosity="$VERBOSITY" \ @@ -54,9 +59,8 @@ exec ./geth \ --metrics \ --metrics.addr=0.0.0.0 \ --metrics.port="$METRICS_PORT" \ - --syncmode=full \ + --syncmode="$OP_GETH_SYNCMODE" \ --gcmode="$OP_GETH_GCMODE" \ - --nodiscover \ --maxpeers=100 \ --nat=extip:$HOST_IP \ --rollup.sequencerhttp="$OP_GETH_SEQUENCER_HTTP" \