-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·36 lines (28 loc) · 864 Bytes
/
test.sh
File metadata and controls
executable file
·36 lines (28 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Setup nvm and install pre-req
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
nvm install --lts
npm install
set -e # Exit immediately if any command fails
# Spawn Bitcoind, and provide execution permission.
docker compose up -d
sleep 10
echo "Waiting for bitcoind to be fully initialized..."
while true; do
result=$(curl --silent --user alice:password --data-binary \
'{"jsonrpc":"1.0","id":"ping","method":"getblockchaininfo","params":[]}' \
-H 'content-type: text/plain;' http://127.0.0.1:18443)
if echo "$result" | grep -q '"chain"'; then
echo "bitcoind is ready."
break
else
echo "bitcoind not ready yet, retrying in 3s..."
sleep 3
fi
done
chmod +x ./python/run-python.sh
chmod +x ./run.sh
# Run the test scripts
/bin/bash run.sh
npm run test
# Stop the docker.
docker compose down -v