Skip to content

Commit 29b3465

Browse files
Merge pull request #4 from dappnode/dappnodedev/avoid-restart
Avoid restart
2 parents 43c4055 + 64ad848 commit 29b3465

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

op-node/entrypoint.sh

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,22 @@ case $_DAPPNODE_GLOBAL_OP_EXECUTION_CLIENT in
4545
;;
4646
esac
4747

48-
exec op-node --network=mainnet \
49-
--l1=$L1_RPC \
50-
--l2=$L2_ENGINE \
51-
--l2.jwt-secret=$JWT_PATH \
52-
--rpc.addr=0.0.0.0 \
53-
--rpc.port=9545 \
54-
${EXTRA_FLAGS}
48+
while true; do
49+
op-node --network=mainnet \
50+
--l1="$L1_RPC" \
51+
--l2="$L2_ENGINE" \
52+
--l2.jwt-secret="$JWT_PATH" \
53+
--rpc.addr=0.0.0.0 \
54+
--rpc.port=9545 \
55+
${EXTRA_FLAGS}
56+
57+
STATUS=$?
58+
59+
if [ $STATUS -ne 0 ]; then
60+
echo "[ERROR - entrypoint ] op-node command failed with status $STATUS. Retrying in 1 minute..."
61+
echo "[ERROR - entrypoint ] L2 Client might be unreachable or not ready yet (downloading chain data can take hours)"
62+
sleep 60
63+
else
64+
break
65+
fi
66+
done

0 commit comments

Comments
 (0)