Skip to content

Commit e5a439e

Browse files
committed
fix
1 parent d624ccd commit e5a439e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

reth/reth-entrypoint

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,16 @@ if [[ "$RETH_HISTORICAL_PROOFS" == "true" && -n "$RETH_HISTORICAL_PROOFS_STORAGE
6464
MAX_WAIT=$((60 * 60 * 6)) # 6 hours (static file manager init is slow)
6565

6666
# wait for json-rpc to return a block number greater than 0 (synced beyond genesis)
67-
while curl -s -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", false],"id":1}' http://127.0.0.1:"$RPC_PORT" | grep -q '"number":"0x0"'; do
68-
echo "waiting for reth node to sync beyond genesis block"
67+
while true; do
68+
RESPONSE=$(curl -s -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", false],"id":1}' http://127.0.0.1:"$RPC_PORT")
69+
if [ $? -ne 0 ]; then
70+
echo "waiting for reth node to start up"
71+
elif echo "$RESPONSE" | grep -q '"number":"0x0"'; then
72+
echo "waiting for reth node to sync beyond genesis block"
73+
else
74+
# curl succeeded and block number is not 0x0
75+
break
76+
fi
6977
sleep 1
7078
MAX_WAIT=$((MAX_WAIT - 1))
7179
if [ "$MAX_WAIT" -eq 0 ]; then

0 commit comments

Comments
 (0)