-
Notifications
You must be signed in to change notification settings - Fork 0
/
read.sh
executable file
·38 lines (29 loc) · 855 Bytes
/
read.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
#!/bin/bash
# Runs READ action (queryConsent) on the last 100 keys in world state
# world state key space (transactions) = 4000
# block size = 20
# total added blocks = 200
# 20 threads; 5 threads for each client
# queried key size = 100 (4000 repetitions)
TARGET_TRANSACTIONS=4000
BLOCK_SIZE=20
echo "START $(date +%FT%T)"
for ((i = 0; i < TARGET_TRANSACTIONS / BLOCK_SIZE; i++)); do
for ((thread = 0; thread < BLOCK_SIZE; thread += 4)); do
# args: [user, identity, start_date]
node queryConsent.js user1 &
pids[${thread}]=$!
node queryConsent.js user2 &
pids[$((thread + 1))]=$!
node queryConsent.js user3 &
pids[$((thread + 2))]=$!
node queryConsent.js user4 &
pids[$((thread + 3))]=$!
done
echo $i
# wait for all pids
for pid in ${pids[*]}; do
wait $pid
done
done
echo "END $(date +%FT%T)"