Peer ID isn't easily searchable from Nodes endpoint
https://gitlab.com/thorchain/tss/go-tss/-/blob/v1.5.6/blame/policy.go#L52
peerID, err := conversion.GetPeerIDFromPubKey(item)
A node's (Bifrost) Peer ID is I believe calculated directly from its (secp256k1) pubkey.
Also, nodes display their Peer IDs at [IP address]:6040/p2pid , another sense in which the Peer ID is not secret.
When trying to understand a Bifrost log, interpreting an unknown Peer ID may require checking these /p2pid endpoints one by one, a painstaking process.
If trying to interpret an earlier log referring to a node now offline, the /p2pid endpoint of that node may no longer be available.
I thus propose that the code for the /nodes endpoint (similarly reflected in the /node/ endpoint) import "gitlab.com/thorchain/tss/go-tss/conversion" and display the Peer ID for easy searching
(and/or jq
summarisation, e.g.
curl https://thornode-v1.ninerealms.com/thorchain/nodes?height=9321120 | jq 'sort_by(.total_bond | tonumber) | reverse' | jq '.[] | select((.status == "Active") or (.status == "Ready")) | [.node_address, .total_bond, .ip_address, .pub_key_set.secp256k1]' -c
except with .peer_id
.)).
The location might be under the pubkey-related lines, specifically being peer_id between validator_cons_pub_key and active_block_height .
As this would be additive (not removing or replacing any previous field) I hope there would be no API disruption.
**A further thought:**
For the field name, is peer_id (Bifrost PeerID term) or p2pid ( /p2pid endpoint term) preferable?