mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-25 03:01:22 +00:00
Added some more useful tools/scripts, mostly for Linux-based curious node owners
This commit is contained in:
13
tools/peer-heights
Executable file
13
tools/peer-heights
Executable 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"))"'
|
Reference in New Issue
Block a user