-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvisualizeMempool.sh
More file actions
82 lines (66 loc) · 1.96 KB
/
visualizeMempool.sh
File metadata and controls
82 lines (66 loc) · 1.96 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
block="${1}" #1 represent 1st argument
size=($(./toCurl.sh getrawmempool | jq -r 'length'))
currentBlock=($(./toCurl.sh getblockcount))
while true
do
if [[ "$size" -gt 0 ]];then
a=($(./toCurl.sh getrawmempool))
numTx=$size
a=("${a[@]}")
countTransparent=0
countSprout=0
countSapling=0
countOrchard=0
echo
echo "Current Block: $currentBlock"
echo "Number of tx's in mempool: $numTx"
echo "----------------------------------"
while [[ "$size" -ge 1 ]]
do
tx=$(echo ${a[size]} | tr -d ',' | tr -d '"')
result=$(./getType.sh $tx)
if [[ "$result" == *"Transparent"* ]]; then
if [[ "$result" == *"Sprout"* ]]; then
# non pure, record only shielded Pool
countSprout=$((countSprout+1))
elif [[ "$result" == *"Sapling"* ]]; then
# non pure, record only shielded Pool
countSapling=$((countSapling+1))
elif [[ "$result" == *"Orchard"* ]]; then
# non pure, record only shielded Pool
countOrchard=$((countOrchard+1))
else
#pure transparent tx
countTransparent=$((countTransparent+1))
fi
elif [[ "$result" == *"Sprout"* ]]; then
countSprout=$((countSprout+1))
elif [[ "$result" == *"Sapling"* ]]; then
countSapling=$((countSapling+1))
elif [[ "$result" == *"Orchard"* ]]; then
countOrchard=$((countOrchard+1))
else
#edge case
:
fi
echo "Tx $size : $result"
size=$(( $size - 1 ))
done
echo
echo "----------------------------------"
echo "Summary:"
echo
echo "Transparent tx's: $countTransparent"
echo "Sprout tx's : $countSprout"
echo "Sapling tx's : $countSapling"
echo "Orchard tx's : $countOrchard"
else
echo "Current Block: $currentBlock"
echo "No tx's in mempool!"
fi
sleep 5
size=($(./toCurl.sh getrawmempool | jq -r 'length'))
currentBlock=($(./toCurl.sh getblockcount))
clear
done