Skip to content

Commit 79fd911

Browse files
committed
test: add script to test multiple clients
Signed-off-by: Arnaud Bailly <arnaud@pankzsoft.com>
1 parent ea28195 commit 79fd911

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

scripts/multi-client.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
trap "exit" INT TERM ERR
5+
trap "kill 0" EXIT
6+
7+
NUM_NODES=$1
8+
9+
for i in $(seq 1 $NUM_NODES); do
10+
NODE_ID=amaru-$i
11+
amaru bootstrap --ledger-dir "${NODE_ID}/ledger.db" --chain-dir "${NODE_ID}/chain.db" --network preview
12+
amaru --service-name $NODE_ID --with-open-telemetry daemon --peer-address localhost:3000 --listen-address localhost:$(( 4000 + $i)) --ledger-dir "${NODE_ID}/ledger.db" --chain-dir "${NODE_ID}/chain.db" --network preview > $NODE_ID.log 2>&1 &
13+
PID=$!
14+
echo $(date -Iseconds) ": launched $NODE_ID (pid=$PID)"
15+
sleep 60
16+
done
17+
18+
wait

0 commit comments

Comments
 (0)