Skip to content

Commit 43c4055

Browse files
Handle custom RPC (#2)
Co-authored-by: Diego <[email protected]>
1 parent 03587d0 commit 43c4055

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ services:
55
context: op-node
66
args:
77
UPSTREAM_VERSION: v1.1.3
8+
environment:
9+
- CUSTOM_L1_RPC
810
restart: unless-stopped
911
image: "op-node.op-node.dnp.dappnode.eth:0.1.0"

op-node/entrypoint.sh

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
11
#!/bin/sh
22

3-
case $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET in
4-
"geth.dnp.dappnode.eth")
5-
L1_RPC="http://geth.dappnode:8545"
6-
;;
7-
"nethermind.public.dappnode.eth")
8-
L1_RPC="http://nethermind.public.dappnode:8545"
9-
;;
10-
"erigon.dnp.dappnode.eth")
11-
L1_RPC="http://erigon.dappnode:8545"
12-
;;
13-
"besu.public.dappnode.eth")
14-
L1_RPC="http://besu.public.dappnode:8545"
15-
;;
16-
*)
17-
echo "Unknown value for _DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET: $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET"
18-
L1_RPC=$_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET
19-
;;
20-
esac
3+
# If CUSTOM_L1_RPC is set, use it. Otherwise, use the proper value depending on the _DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET variable
4+
if [ ! -z "$CUSTOM_L1_RPC" ]; then
5+
L1_RPC=$CUSTOM_L1_RPC
6+
elif [ ! -z "$_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET" ]; then
7+
case $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET in
8+
"geth.dnp.dappnode.eth")
9+
L1_RPC="http://geth.dappnode:8545"
10+
;;
11+
"nethermind.public.dappnode.eth")
12+
L1_RPC="http://nethermind.public.dappnode:8545"
13+
;;
14+
"erigon.dnp.dappnode.eth")
15+
L1_RPC="http://erigon.dappnode:8545"
16+
;;
17+
"besu.public.dappnode.eth")
18+
L1_RPC="http://besu.public.dappnode:8545"
19+
;;
20+
*)
21+
echo "Unknown value for _DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET: $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET"
22+
sleep 60
23+
exit 1
24+
;;
25+
esac
26+
else
27+
echo "No L1_RPC value set"
28+
sleep 60
29+
exit 1
30+
fi
2131

2232
case $_DAPPNODE_GLOBAL_OP_EXECUTION_CLIENT in
2333
"op-geth.dnp.dappnode.eth")

0 commit comments

Comments
 (0)