forked from mehdius1364/node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
op-geth-entrypoint
executable file
·92 lines (79 loc) · 2.67 KB
/
op-geth-entrypoint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh
set -eu
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=$(jq -r .config.chainId < "$OP_GETH_GENESIS_FILE_PATH")
RPC_PORT="${RPC_PORT:-8545}"
WS_PORT="${WS_PORT:-8546}"
AUTHRPC_PORT="${AUTHRPC_PORT:-8551}"
METRICS_PORT="${METRICS_PORT:-6060}"
HOST_IP="0.0.0.0"
P2P_PORT="${P2P_PORT:-30303}"
ADDITIONAL_ARGS=""
mkdir -p $GETH_DATA_DIR
if [ ! -d "$GETH_CHAINDATA_DIR" ]; then
echo "$GETH_CHAINDATA_DIR missing, running init"
echo "Initializing genesis."
geth --verbosity="$VERBOSITY" init \
--datadir="$GETH_DATA_DIR" \
"$OP_GETH_GENESIS_FILE_PATH"
else
echo "$GETH_CHAINDATA_DIR exists."
fi
echo "$CONDUIT_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
if [ "${OP_GETH_ALLOW_UNPROTECTED_TXS+x}" = x ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --rpc.allow-unprotected-txs=$OP_GETH_ALLOW_UNPROTECTED_TXS"
fi
if [ "${CHAIN_ID}" = "919" ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --rollup.superchain-upgrades --op-network mode-sepolia --rollup.halt=major"
fi
if [ "${CHAIN_ID}" = "34443" ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --override.canyon=1704992401 --rollup.halt=major"
fi
if [ "${CHAIN_ID}" = "999999999" ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --rollup.superchain-upgrades --op-network zora-sepolia --rollup.halt=major"
fi
if [ "${CHAIN_ID}" = "7777777" ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --rollup.superchain-upgrades --op-network zora-mainnet --rollup.halt=major"
fi
if [ "${CHAIN_ID}" = "58008" ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --rollup.superchain-upgrades --op-network pgn-sepolia --rollup.halt=major"
fi
if [ "${CHAIN_ID}" = "424" ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS --rollup.superchain-upgrades --op-network pgn-mainnet --rollup.halt=major"
fi
exec geth \
--datadir="$GETH_DATA_DIR" \
--verbosity="$VERBOSITY" \
--http \
--http.corsdomain="*" \
--http.vhosts="*" \
--http.addr=0.0.0.0 \
--http.port="$RPC_PORT" \
--http.api=web3,debug,eth,net,engine \
--authrpc.addr=0.0.0.0 \
--authrpc.port="$AUTHRPC_PORT" \
--authrpc.vhosts="*" \
--authrpc.jwtsecret="$OP_NODE_L2_ENGINE_AUTH" \
--ws \
--ws.addr=0.0.0.0 \
--ws.port="$WS_PORT" \
--ws.origins="*" \
--ws.api=debug,eth,net,engine \
--metrics \
--metrics.addr=0.0.0.0 \
--metrics.port="$METRICS_PORT" \
--syncmode=full \
--gcmode=archive \
--nodiscover \
--maxpeers=100 \
--nat=extip:$HOST_IP \
--networkid="$CHAIN_ID" \
--rollup.sequencerhttp="$OP_GETH_SEQUENCER_HTTP" \
--port="$P2P_PORT" \
$ADDITIONAL_ARGS # intentionally unquoted