Skip to content

Commit

Permalink
add delay for finding ganache process with a retry
Browse files Browse the repository at this point in the history
  • Loading branch information
kadamidev committed Jan 23, 2025
1 parent f6532e4 commit 7afd039
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions desci-contracts/scripts/startTestChain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
set -euo pipefail
trap "catch" ERR
catch() {
"[startTestChain] script failed!"
echo "[startTestChain] script failed!"
exit 1
}

Expand Down Expand Up @@ -70,7 +70,11 @@ npx ganache \
--wallet.mnemonic="${MNEMONIC}" \
--database.dbPath="/data" \
| grep --line-buffered -v '^eth_.*$' &
GANACHE_PID=$(pgrep -P $$ ganache)

# Wait for ganache process to be findable
until GANACHE_PID=$(pgrep -P $$ ganache); do
sleep 0.1
done

until curl -s -o /dev/null -w '' http://localhost:8545; do
sleep 1
Expand Down

0 comments on commit 7afd039

Please sign in to comment.