-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17456d2
commit df6f73e
Showing
1 changed file
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
# poll the nitro endpoint until we get a 0 return code | ||
while true | ||
do | ||
# poll the nitro endpoint until we get a 0 return code or 30mins have passed, in that case exit 1 | ||
start_time=$(date +%s) | ||
timeout=20 | ||
|
||
while (( $(date +%s) - start_time <= timeout )); do | ||
curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":45678,"method":"eth_chainId","params":[]}' 'http://localhost:8547' | ||
if [ "$?" -eq "0" ]; then | ||
exit 0 | ||
else | ||
sleep 20 | ||
fi | ||
done | ||
done | ||
|
||
exit 1 |