Skip to content

Commit 4429997

Browse files
author
Michael de Hoog
authored
Add optional ethstats argument (#35)
1 parent 57a7c49 commit 4429997

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
- OP_GETH_SEQUENCER_HTTP=https://goerli.base.org
1313
- OP_NODE_L2_ENGINE_AUTH=/tmp/engine-auth-jwt
1414
- OP_NODE_L2_ENGINE_AUTH_RAW=688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a # for localdev only
15+
# - OP_GETH_ETH_STATS=nodename:secret@host:port # optional
1516
node:
1617
build: .
1718
depends_on:

geth-entrypoint.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ VERBOSITY=${GETH_VERBOSITY:-3}
55
GETH_DATA_DIR=/data
66
GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata"
77
OP_GETH_GENESIS_FILE_PATH="${OP_GETH_GENESIS_FILE_PATH:-/genesis.json}"
8-
CHAIN_ID=$(cat "$OP_GETH_GENESIS_FILE_PATH" | jq -r .config.chainId)
8+
CHAIN_ID=$(jq -r .config.chainId < "$OP_GETH_GENESIS_FILE_PATH")
99
RPC_PORT="${RPC_PORT:-8545}"
1010
WS_PORT="${WS_PORT:-8546}"
1111
AUTHRPC_PORT="${AUTHRPC_PORT:-8551}"
1212
HOST_IP="0.0.0.0"
13+
ADDITIONAL_ARGS=""
1314

1415
mkdir -p $GETH_DATA_DIR
1516

@@ -25,6 +26,10 @@ fi
2526

2627
echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"
2728

29+
if [ "${OP_GETH_ETH_STATS+x}" = x ]; then
30+
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --ethstats=$OP_GETH_ETH_STATS"
31+
fi
32+
2833
./geth \
2934
--datadir="$GETH_DATA_DIR" \
3035
--verbosity="$VERBOSITY" \
@@ -49,4 +54,5 @@ echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"
4954
--maxpeers=100 \
5055
--nat=extip:$HOST_IP \
5156
--networkid="$CHAIN_ID" \
52-
--rollup.sequencerhttp="$OP_GETH_SEQUENCER_HTTP"
57+
--rollup.sequencerhttp="$OP_GETH_SEQUENCER_HTTP" \
58+
$ADDITIONAL_ARGS # intentionally unquoted

0 commit comments

Comments
 (0)