forked from OffchainLabs/nitro-testnode
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsmoke-test-l3.bash
executable file
·31 lines (25 loc) · 1006 Bytes
/
smoke-test-l3.bash
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
#!/usr/bin/env bash
set -euo pipefail
./test-node.bash --init-force --espresso --latest-espresso-image --l3node --l3-token-bridge --l3-fee-token --detach
echo "Sending L3 transaction"
user=user_l3
./test-node.bash script send-l3 --ethamount 5 --to $user --wait
userAddress=$(docker compose run scripts print-address --account $user | tail -n 1 | tr -d '\r\n')
balance=$(cast balance $userAddress --rpc-url http://localhost:3347)
if [ "$balance" -eq 0 ]; then
echo "Transfer failed in l3 node"
exit 1
fi
rollupAddress=$(docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_l3_chain_info.json | tail -n 1 | tr -d '\r\n'")
while true; do
confirmed=$(cast call --rpc-url http://localhost:8547 $rollupAddress 'latestConfirmed()(uint256)')
echo "Number of confirmed staking nodes: $confirmed"
if [ "$confirmed" -gt 0 ]; then
break
else
echo "Waiting for more confirmed nodes ..."
fi
sleep 5
done
echo "Smoke test succeeded."
docker compose down