Added some more useful tools/scripts, mostly for Linux-based curious node owners

This commit is contained in:
catbref
2020-07-17 12:22:48 +01:00
parent 4cc0e7845f
commit 6f2dd6c8d0
3 changed files with 453 additions and 0 deletions

13
tools/peer-heights Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Requires: 'qort' script in PATH, and 'jq' utility installed
set -e
# Any extra args passed to us are also passed to 'qort', just prior to '-p peers'
qort $@ -p peers | \
jq -r 'def lpad($len):
tostring | ($len - length) as $l | (" " * $l)[:$l] + .;
.[] |
select(has("lastHeight")) |
"\(.address | lpad(22)) (\(.version)), height \(.lastHeight), sig: \(.lastBlockSignature[0:8]), ts \(.lastBlockTimestamp / 1e3 | strftime("%Y-%m-%d %H:%M:%S"))"'