-
Notifications
You must be signed in to change notification settings - Fork 23
/
notarystats_html.sh
executable file
·92 lines (78 loc) · 3.52 KB
/
notarystats_html.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
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
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
komodo_cli=/home/decker/komodo/src/komodo-cli
chips_cli=/home/decker/chips3/src/chips-cli
bitcoin_cli=/usr/local/bin/bitcoin-cli
gamecredits_cli=/home/decker/GameCredits/src/gamecredits-cli
# ----------------------
function getstats_kmd ()
{
txcount=1000
# $1 - coin name (empty for KMD)
# -- in grep is for stop processing statements, https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash/11382#11382
if [ "$1" == "KMD" ] || [ "$1" == "" ]
then
name=" "
name_str="KMD"
else
name=" -ac_name=$1"
name_str=$1
fi
ntrz_count=$($komodo_cli $name listtransactions "" $txcount | grep -- -0.00098800 | wc -l)
utxo_count=$($komodo_cli $name listunspent | grep .0001 | wc -l)
#balance=$($komodo_cli $name getinfo | grep balance)
balance=$($komodo_cli $name getinfo | jq .balance)
height=$($komodo_cli $name getinfo | jq .blocks)
echo "<tr><td class=\"title\">$name_str</td><td>$ntrz_count</td><td>$utxo_count</td><td>$balance</td><td>$height</td></tr>"
}
function getstats_btc ()
{
txcount=1000
ntrz_count=$($bitcoin_cli listtransactions "" $txcount | grep -- -0.00098800 | wc -l)
utxo_count=$($bitcoin_cli listunspent | grep .0001 | wc -l)
#balance=$($bitcoin_cli getinfo | grep balance)
balance=$($bitcoin_cli getinfo | jq .balance)
height=$($bitcoin_cli getinfo | jq .blocks)
echo "<tr><td class=\"title\">BTC</td><td>$ntrz_count</td><td>$utxo_count</td><td>$balance</td><td>$height</td></tr>"
}
function getstats_chips ()
{
txcount=1000
ntrz_count=$($chips_cli listtransactions "" $txcount | grep -- -0.00098800 | wc -l)
utxo_count=$($chips_cli listunspent | grep .0001 | wc -l)
#balance=$($chips_cli getinfo | grep balance)
balance=$($chips_cli getinfo | jq .balance)
height=$($chips_cli getinfo | jq .blocks)
echo "<tr><td class=\"title\">CHIPS</td><td>$ntrz_count</td><td>$utxo_count</td><td>$balance</td><td>$height</td></tr>"
}
function getstats_game ()
{
txcount=1000
ntrz_count=$($gamecredits_cli listtransactions "" $txcount | grep -- -0.00988000 | wc -l)
utxo_count=$($gamecredits_cli listunspent | grep .001 | wc -l)
#balance=$($gamecredits_cli getinfo | grep balance)
balance=$($gamecredits_cli getinfo | jq .balance)
height=$($gamecredits_cli getinfo | jq .blocks)
echo "<tr><td class=\"title\">GAME</td><td>$ntrz_count</td><td>$utxo_count</td><td>$balance</td><td>$height</td></tr>"
}
cat <<EOF
<style type="text/css">
<!--
table.design1{font-family:Verdana,Geneva,sans-serif;font-size:12px;border-collapse:collapse;max-width:600px}table.design1 td{padding:8px;border:1px solid #9E9E9E;text-align:left}table.design1 td.title{padding:8px;background:#d0d7e0;font-weight:700}table.design1 tr.headline td{text-align:center;padding:16px 8px;background:#e8e5de;font-weight:700;font-size:13px}table.design1 span{color:#1477fe;font-weight:700}table.design1 .green{background-color:#00e676}table.design1 .red{background-color:#FF6F00}
-->
</style>
<table align="center" border="0" cellpadding="1" cellspacing="1" class="design1" style="border-collapse: collapse;">
<tbody>
<tr class="headline"><td width="20%"></td><td style="text-align: center;">NTRZd</td><td style="text-align: center;">UTXOs</td><td style="text-align: center;">Balance</td><td style="text-align: center;">Height</td></tr>
EOF
getstats_btc
getstats_chips
getstats_game
declare -a kmd_coins=(KMD REVS SUPERNET DEX PANGEA JUMBLR BET CRYPTO HODL MSHARK BOTS MGW COQUI WLC KV CEAL MESH MNZ AXO ETOMIC BTCH PIZZA BEER NINJA OOT BNTN CHAIN PRLPAY DSEC)
for i in "${kmd_coins[@]}"
do
getstats_kmd "$i"
done
cat <<EOF
</tbody>
</table>
EOF