Skip to content

Commit

Permalink
Merge pull request #4 from dappnode/dappnodedev/avoid-restart
Browse files Browse the repository at this point in the history
Avoid restart
  • Loading branch information
pablomendezroyo authored Sep 26, 2023
2 parents 43c4055 + 64ad848 commit 29b3465
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions op-node/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,22 @@ case $_DAPPNODE_GLOBAL_OP_EXECUTION_CLIENT in
;;
esac

exec op-node --network=mainnet \
--l1=$L1_RPC \
--l2=$L2_ENGINE \
--l2.jwt-secret=$JWT_PATH \
--rpc.addr=0.0.0.0 \
--rpc.port=9545 \
${EXTRA_FLAGS}
while true; do
op-node --network=mainnet \
--l1="$L1_RPC" \
--l2="$L2_ENGINE" \
--l2.jwt-secret="$JWT_PATH" \
--rpc.addr=0.0.0.0 \
--rpc.port=9545 \
${EXTRA_FLAGS}

STATUS=$?

if [ $STATUS -ne 0 ]; then
echo "[ERROR - entrypoint ] op-node command failed with status $STATUS. Retrying in 1 minute..."
echo "[ERROR - entrypoint ] L2 Client might be unreachable or not ready yet (downloading chain data can take hours)"
sleep 60
else
break
fi
done

0 comments on commit 29b3465

Please sign in to comment.