forked from OffchainLabs/nitro-testnode
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsmoke-test-caldera.bash
More file actions
executable file
·40 lines (32 loc) · 1.31 KB
/
smoke-test-caldera.bash
File metadata and controls
executable file
·40 lines (32 loc) · 1.31 KB
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
#!/usr/bin/env bash
set -euo pipefail
# check that the relay is working
listen_to_sequencer_feed() {
# Listen to the sequencer feed and check if the sender address is detected
while read -r message; do
# Check if the message contains the specific sender address
if [[ "$message" == *"\"sender\":\"0xdd6bd74674c356345db88c354491c7d3173c6806\""* ]]; then
echo "Sender address detected"
break
fi
done < <(wscat -c ws://127.0.0.1:9652)
}
source ./regression-tests/common.bash
# Run caldera with batch poster, sequencer, full node, validator and an anytrust chain which runs the dasserver
./test-node.bash --init-force --validate --batchposters 1 $(get_espresso_image_flag) --detach --l2-anytrust
docker compose up -d full-node --detach
# Sending L2 transaction through the full-node's api
user=user_l2user
./test-node.bash script send-l2 --l2url ws://full-node:8548 --ethamount 100 --to $user --wait
# Check the balance from full-node's api
userAddress=$(docker compose run scripts print-address --account $user | tail -n 1 | tr -d '\r\n')
while true; do
balance=$(cast balance $userAddress --rpc-url http://127.0.0.1:8947)
if [ ${#balance} -gt 0 ]; then
break
fi
sleep 1
done
listen_to_sequencer_feed
echo "Smoke test succeeded."
# docker compose down