forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wallet-sanity.sh
executable file
·48 lines (41 loc) · 922 Bytes
/
wallet-sanity.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
#
# solana-cli integration sanity test
#
set -e
cd "$(dirname "$0")"/..
# shellcheck source=multinode-demo/common.sh
source multinode-demo/common.sh
if [[ -z $1 ]]; then # no network argument, use localhost by default
args=(--url http://127.0.0.1:8899)
else
args=("$@")
fi
args+=(--keypair "$SOLANA_CONFIG_DIR"/faucet.json)
node_readiness=false
timeout=60
while [[ $timeout -gt 0 ]]; do
set +e
output=$($solana_cli "${args[@]}" transaction-count --commitment finalized)
rc=$?
set -e
if [[ $rc -eq 0 && -n $output ]]; then
node_readiness=true
break
fi
sleep 2
(( timeout=timeout-2 ))
done
if ! "$node_readiness"; then
echo "Timed out waiting for cluster to start"
exit 1
fi
(
set -x
$solana_cli "${args[@]}" address
$solana_cli "${args[@]}" balance
$solana_cli "${args[@]}" ping --count 5 --interval 0
$solana_cli "${args[@]}" balance
)
echo PASS
exit 0