Skip to content

Commit

Permalink
Add optional ethstats argument (base#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog authored Mar 27, 2023
1 parent 57a7c49 commit 4429997
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
- OP_GETH_SEQUENCER_HTTP=https://goerli.base.org
- OP_NODE_L2_ENGINE_AUTH=/tmp/engine-auth-jwt
- OP_NODE_L2_ENGINE_AUTH_RAW=688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a # for localdev only
# - OP_GETH_ETH_STATS=nodename:secret@host:port # optional
node:
build: .
depends_on:
Expand Down
10 changes: 8 additions & 2 deletions geth-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ VERBOSITY=${GETH_VERBOSITY:-3}
GETH_DATA_DIR=/data
GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata"
OP_GETH_GENESIS_FILE_PATH="${OP_GETH_GENESIS_FILE_PATH:-/genesis.json}"
CHAIN_ID=$(cat "$OP_GETH_GENESIS_FILE_PATH" | jq -r .config.chainId)
CHAIN_ID=$(jq -r .config.chainId < "$OP_GETH_GENESIS_FILE_PATH")
RPC_PORT="${RPC_PORT:-8545}"
WS_PORT="${WS_PORT:-8546}"
AUTHRPC_PORT="${AUTHRPC_PORT:-8551}"
HOST_IP="0.0.0.0"
ADDITIONAL_ARGS=""

mkdir -p $GETH_DATA_DIR

Expand All @@ -25,6 +26,10 @@ fi

echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"

if [ "${OP_GETH_ETH_STATS+x}" = x ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --ethstats=$OP_GETH_ETH_STATS"
fi

./geth \
--datadir="$GETH_DATA_DIR" \
--verbosity="$VERBOSITY" \
Expand All @@ -49,4 +54,5 @@ echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"
--maxpeers=100 \
--nat=extip:$HOST_IP \
--networkid="$CHAIN_ID" \
--rollup.sequencerhttp="$OP_GETH_SEQUENCER_HTTP"
--rollup.sequencerhttp="$OP_GETH_SEQUENCER_HTTP" \
$ADDITIONAL_ARGS # intentionally unquoted

0 comments on commit 4429997

Please sign in to comment.