Skip to content

Commit f22c970

Browse files
Merge pull request #422 from ethereum-optimism/ref-geth-entrypoint-params
Update reference geth entrypoint with variable parameters
2 parents 5189b9a + c3f5ec8 commit f22c970

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ops/entrypoint.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ VERBOSITY=${GETH_VERBOSITY:-3}
55
GETH_DATA_DIR=/db
66
GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata"
77
GETH_KEYSTORE_DIR="$GETH_DATA_DIR/keystore"
8-
CHAIN_ID=$(cat /genesis.json | jq -r .config.chainId)
8+
GENESIS_FILE_PATH="${GENESIS_FILE_PATH:-/genesis.json}"
9+
CHAIN_ID=$(cat "$GENESIS_FILE_PATH" | jq -r .config.chainId)
910
BLOCK_SIGNER_PRIVATE_KEY="3e4bde571b86929bf08e2aaad9a6a1882664cd5e65b96fff7d03e1c4e6dfa15c"
1011
BLOCK_SIGNER_ADDRESS="0xca062b0fd91172d89bcd4bb084ac4e21972cc467"
12+
RPC_PORT="${RPC_PORT:-8545}"
13+
WS_PORT="${WS_PORT:-8546}"
1114

1215
if [ ! -d "$GETH_KEYSTORE_DIR" ]; then
1316
echo "$GETH_KEYSTORE_DIR missing, running account import"
@@ -26,7 +29,7 @@ if [ ! -d "$GETH_CHAINDATA_DIR" ]; then
2629
echo "Initializing genesis."
2730
geth --verbosity="$VERBOSITY" init \
2831
--datadir="$GETH_DATA_DIR" \
29-
"/genesis.json"
32+
"$GENESIS_FILE_PATH"
3033
else
3134
echo "$GETH_CHAINDATA_DIR exists."
3235
fi
@@ -41,11 +44,11 @@ exec geth \
4144
--http.corsdomain="*" \
4245
--http.vhosts="*" \
4346
--http.addr=0.0.0.0 \
44-
--http.port=8545 \
47+
--http.port="$RPC_PORT" \
4548
--http.api=web3,debug,eth,txpool,net,engine \
4649
--ws \
4750
--ws.addr=0.0.0.0 \
48-
--ws.port=8546 \
51+
--ws.port="$WS_PORT" \
4952
--ws.origins="*" \
5053
--ws.api=debug,eth,txpool,net,engine \
5154
--syncmode=full \

0 commit comments

Comments
 (0)