forked from mempool/mempool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck
More file actions
executable file
·56 lines (56 loc) · 2.55 KB
/
Copy pathcheck
File metadata and controls
executable file
·56 lines (56 loc) · 2.55 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
#!/usr/bin/env zsh
check_mempoolspace_frontend_git_hash() {
echo -n $(curl -s --connect-to "::node${1}.${2}.mempool.space:443" https://mempool.space/en-US/resources/config.js|grep GIT_COMMIT_HASH_MEMPOOL_SPACE|cut -d "'" -f2|cut -c1-8)
}
check_mempoolfoss_frontend_git_hash() {
echo -n $(curl -s "https://node${1}.${2}.mempool.space/resources/config.js"|grep GIT_COMMIT_HASH|cut -d "'" -f2|cut -c1-8)
}
check_mempoolfoss_backend_git_hash() {
echo -n $(curl -s "https://node${1}.${2}.mempool.space/api/v1/backend-info"|jq -r .gitCommit 2>/dev/null|cut -c1-8)
}
check_mempoolspace_frontend_md5_hash() {
echo -n $(curl -s --connect-to "::node${1}.${2}.mempool.space:443" https://mempool.space|md5|cut -c1-8)
}
check_mempoolfoss_frontend_md5_hash() {
echo -n $(curl -s https://node${1}.${2}.mempool.space|md5|cut -c1-8)
}
check_mempool_electrs_git_hash() {
echo -n $(curl -s -i https://node${1}.${2}.mempool.space/api/mempool|grep -i x-powered-by|cut -d ' ' -f3|cut -d '-' -f3|tr -d '\r'|tr -d '\n')
}
check_mempool_electrs_negative_balance() {
echo -n $(curl -s https://node${1}.${2}.mempool.space/api/address/35Ty15fzBPGQvKnXZMLYvr41Fq2FTdU54a|jq .chain_stats.spent_txo_sum|tr -d '\r'|tr -d '\n')
}
check_liquid_electrs_git_hash() {
echo -n $(curl -s -i --connect-to "::node${1}.${2}.mempool.space:443" https://liquid.network/api/mempool|grep -i x-powered-by|cut -d ' ' -f3|cut -d '-' -f3|tr -d '\r'|tr -d '\n')
}
check_contributors_md5_hash() {
echo -n $(curl -s --connect-to "::node${1}.${2}.mempool.space:443" https://mempool.space/api/v1/contributors|md5|cut -c1-8)
}
for site in hnl sv1 fra tk7 va1 sg1;do
echo "${site}"
for node in 201 202 203 204 205 206 207 208 209 210 211 212 213 214;do
[ "${site}" = "sv1" ] && [ "${node}" -lt 202 ] && continue
[ "${site}" = "sv1" ] && [ "${node}" -gt 203 ] && continue
[ "${site}" = "sg1" ] && [ "${node}" -gt 204 ] && continue
[ "${site}" = "hnl" ] && [ "${node}" -gt 204 ] && continue
[ "${site}" = "tk7" ] && [ "${node}" -gt 206 ] && continue
echo -n "node${node}.${site}: "
# check_mempoolspace_frontend_git_hash $node $site
# echo -n " "
# check_mempoolfoss_frontend_git_hash $node $site
# echo -n " "
# check_mempoolfoss_backend_git_hash $node $site
# echo -n " "
# check_mempoolspace_frontend_md5_hash $node $site
# echo -n " "
# check_mempoolfoss_frontend_md5_hash $node $site
# echo -n " "
check_mempool_electrs_git_hash $node $site
echo -n " "
# check_liquid_electrs_git_hash $node $site
# echo -n " "
# check_contributors_md5_hash $node $site
check_mempool_electrs_negative_balance $node $site
echo
done
done