Skip to content

Commit

Permalink
Add snapsync bootnodes to op-geth (#208)
Browse files Browse the repository at this point in the history
Co-authored-by: Yukai Tu <[email protected]>
  • Loading branch information
xiaoxiaff and yukaitu-cb authored Feb 28, 2024
1 parent 88f93a8 commit 8b82985
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions .env.sepolia
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions geth-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" \
Expand All @@ -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" \
Expand Down

0 comments on commit 8b82985

Please sign in to comment.