Skip to content

Commit

Permalink
Handle custom RPC (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego <dsimog01@estudiantes.unileon.es>
  • Loading branch information
dappnodedev and dsimog01 authored Sep 20, 2023
1 parent 03587d0 commit 43c4055
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ services:
context: op-node
args:
UPSTREAM_VERSION: v1.1.3
environment:
- CUSTOM_L1_RPC
restart: unless-stopped
image: "op-node.op-node.dnp.dappnode.eth:0.1.0"
46 changes: 28 additions & 18 deletions op-node/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
#!/bin/sh

case $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET in
"geth.dnp.dappnode.eth")
L1_RPC="http://geth.dappnode:8545"
;;
"nethermind.public.dappnode.eth")
L1_RPC="http://nethermind.public.dappnode:8545"
;;
"erigon.dnp.dappnode.eth")
L1_RPC="http://erigon.dappnode:8545"
;;
"besu.public.dappnode.eth")
L1_RPC="http://besu.public.dappnode:8545"
;;
*)
echo "Unknown value for _DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET: $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET"
L1_RPC=$_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET
;;
esac
# If CUSTOM_L1_RPC is set, use it. Otherwise, use the proper value depending on the _DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET variable
if [ ! -z "$CUSTOM_L1_RPC" ]; then
L1_RPC=$CUSTOM_L1_RPC
elif [ ! -z "$_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET" ]; then
case $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET in
"geth.dnp.dappnode.eth")
L1_RPC="http://geth.dappnode:8545"
;;
"nethermind.public.dappnode.eth")
L1_RPC="http://nethermind.public.dappnode:8545"
;;
"erigon.dnp.dappnode.eth")
L1_RPC="http://erigon.dappnode:8545"
;;
"besu.public.dappnode.eth")
L1_RPC="http://besu.public.dappnode:8545"
;;
*)
echo "Unknown value for _DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET: $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET"
sleep 60
exit 1
;;
esac
else
echo "No L1_RPC value set"
sleep 60
exit 1
fi

case $_DAPPNODE_GLOBAL_OP_EXECUTION_CLIENT in
"op-geth.dnp.dappnode.eth")
Expand Down

0 comments on commit 43c4055

Please sign in to comment.