forked from mehdius1364/node
-
Notifications
You must be signed in to change notification settings - Fork 5
/
op-node-entrypoint
executable file
·47 lines (37 loc) · 1.19 KB
/
op-node-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
#!/bin/sh
set -eu
# wait until local geth comes up (authed so will return 401 without token)
until [ "$(curl -s -w '%{http_code}' -o /dev/null "${OP_NODE_L2_ENGINE_RPC//ws/http}")" -eq 401 ]; do
echo "waiting for geth to be ready"
sleep 5
done
# public-facing P2P node, advertise public IP address
PUBLIC_IP=$(curl -s v4.ident.me)
export OP_NODE_P2P_ADVERTISE_IP=$PUBLIC_IP
CHAIN_ID=$(jq -r .config.chainId < "$OP_GETH_GENESIS_FILE_PATH")
if [ "${CHAIN_ID}" = "919" ]; then
export OP_NODE_ROLLUP_CONFIG=""
export OP_NODE_NETWORK="mode-sepolia"
fi
if [ "${CHAIN_ID}" = "34443" ]; then
export OP_NODE_ROLLUP_CONFIG=""
export OP_NODE_NETWORK="mode-mainnet"
fi
if [ "${CHAIN_ID}" = "999999999" ]; then
export OP_NODE_ROLLUP_CONFIG=""
export OP_NODE_NETWORK="zora-sepolia"
fi
if [ "${CHAIN_ID}" = "7777777" ]; then
export OP_NODE_ROLLUP_CONFIG=""
export OP_NODE_NETWORK="zora-mainnet"
fi
if [ "${CHAIN_ID}" = "58008" ]; then
export OP_NODE_ROLLUP_CONFIG=""
export OP_NODE_NETWORK="pgn-sepolia"
fi
if [ "${CHAIN_ID}" = "424" ]; then
export OP_NODE_ROLLUP_CONFIG=""
export OP_NODE_NETWORK="pgn-mainnet"
fi
echo "$CONDUIT_OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"
exec op-node