Wait for chain endpoint to be up before starting go-nitro node
This commit is contained in:
parent
3afab3fa1c
commit
54d8624c94
@ -1,6 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
@ -30,6 +29,21 @@ fi
|
|||||||
|
|
||||||
echo "Running Nitro node"
|
echo "Running Nitro node"
|
||||||
|
|
||||||
# TODO Wait for chain endpoint to come up
|
# Wait till chain endpoint is available
|
||||||
|
retry_interval=5
|
||||||
|
while true; do
|
||||||
|
# Assuming CERC_NITRO_CHAIN_URL is of format <ws|http>://host:port
|
||||||
|
ws_host=$(echo "$CERC_NITRO_CHAIN_URL" | awk -F '://' '{print $2}' | cut -d ':' -f 1)
|
||||||
|
ws_port=$(echo "$CERC_NITRO_CHAIN_URL" | awk -F '://' '{print $2}' | cut -d ':' -f 2)
|
||||||
|
nc -z -w 1 "$ws_host" "$ws_port"
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Chain endpoint is available"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Chain endpoint not yet available, retrying in $retry_interval seconds..."
|
||||||
|
sleep $retry_interval
|
||||||
|
done
|
||||||
|
|
||||||
./nitro -chainurl ${CERC_NITRO_CHAIN_URL} -msgport 3005 -rpcport 4005 -wsmsgport 5005 -pk ${CERC_NITRO_PK} -chainpk ${CERC_NITRO_CHAIN_PK} -naaddress ${NA_ADDRESS} -vpaaddress ${VPA_ADDRESS} -caaddress ${CA_ADDRESS} -usedurablestore ${CERC_NITRO_USE_DURABLE_STORE} -durablestorefolder ${CERC_NITRO_DURABLE_STORE_FOLDER}
|
./nitro -chainurl ${CERC_NITRO_CHAIN_URL} -msgport 3005 -rpcport 4005 -wsmsgport 5005 -pk ${CERC_NITRO_PK} -chainpk ${CERC_NITRO_CHAIN_PK} -naaddress ${NA_ADDRESS} -vpaaddress ${VPA_ADDRESS} -caaddress ${CA_ADDRESS} -usedurablestore ${CERC_NITRO_USE_DURABLE_STORE} -durablestorefolder ${CERC_NITRO_DURABLE_STORE_FOLDER}
|
||||||
|
@ -164,7 +164,7 @@ Stack components:
|
|||||||
|
|
||||||
* Change the amount besides `PAY` button in debug panel to `>=100` for phisher reports next
|
* Change the amount besides `PAY` button in debug panel to `>=100` for phisher reports next
|
||||||
|
|
||||||
* Perform a phisher report and check the watcher logs for received payments; the RPC mutation request is sent to geth node and is not charged:
|
* Perform a phisher report and check the watcher logs for received payments:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Expected output:
|
# Expected output:
|
||||||
@ -272,4 +272,4 @@ Stack components:
|
|||||||
await clearNodeStorage()
|
await clearNodeStorage()
|
||||||
```
|
```
|
||||||
|
|
||||||
* On a restart, clear activity tab data in MetaMask for concerned accounts
|
* On a fresh restart, clear activity tab data in MetaMask for concerned accounts
|
||||||
|
Loading…
Reference in New Issue
Block a user