Skip to main content

getpeerinfo

Command#

pacprotocol-cli getpeerinfo

Returns data about each connected network node as a json array of objects.

Examples#

pacprotocol-cli getpeerinfo
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:1111/

Result#

[
{
"id": n, #(numeric) Peer index
"addr":"host:port", #(string) The IP address and port of the peer
"addrbind":"ip:port", #(string) Bind address of the connection to the peer
"addrlocal":"ip:port", #(string) Local address as reported by the peer
"services":"xxxxxxxxxxxxxxxx", #(string) The services offered
"verified_proregtx_hash": h, #(hex) Only present when the peer is a masternode and succesfully
authenticated via MNAUTH. In this case, this field contains the
protx hash of the masternode
"verified_pubkey_hash": h, #(hex) Only present when the peer is a masternode and succesfully
authenticated via MNAUTH. In this case, this field contains the
hash of the masternode's operator public key
"relaytxes":true|false, #(boolean) Whether peer has asked us to relay transactions to it
"lastsend": ttt, #(numeric) The time in seconds since epoch #(Jan 1 1970 GMT) of the last send
"lastrecv": ttt, #(numeric) The time in seconds since epoch #(Jan 1 1970 GMT) of the last receive
"bytessent": n, #(numeric) The total bytes sent
"bytesrecv": n, #(numeric) The total bytes received
"conntime": ttt, #(numeric) The connection time in seconds since epoch #(Jan 1 1970 GMT)
"timeoffset": ttt, #(numeric) The time offset in seconds
"pingtime": n, #(numeric) ping time #(if available)
"minping": n, #(numeric) minimum observed ping time #(if any at all)
"pingwait": n, #(numeric) ping wait #(if non-zero)
"version": v, #(numeric) The peer version, such as 70001
"subver": "/pacprotocol:x.x.x/", #(string) The string version
"inbound": true|false, #(boolean) Inbound #(true) or Outbound #(false)
"addnode": true|false, #(boolean) Whether connection was due to addnode/-connect or if it was an automatic/inbound connection
"masternode": true|false, #(boolean) Whether connection was due to masternode connection attempt
"startingheight": n, #(numeric) The starting height #(block) of the peer
"banscore": n, #(numeric) The ban score
"synced_headers": n, #(numeric) The last header we have in common with this peer
"synced_blocks": n, #(numeric) The last block we have in common with this peer
"inflight": [
n, #(numeric) The heights of blocks we're currently asking from this peer
...
],
"whitelisted": true|false, #(boolean) Whether the peer is whitelisted
"bytessent_per_msg": {
"addr": n, #(numeric) The total bytes sent aggregated by message type
...
},
"bytesrecv_per_msg": {
"addr": n, #(numeric) The total bytes received aggregated by message type
...
}
}
,...
]

Running following help command

pacprotocol-cli help getpeerinfo

Will produce following output:

getpeerinfo
Returns data about each connected network node as a json array of objects.
Result:
[
{
"id": n, (numeric) Peer index
"addr":"host:port", (string) The IP address and port of the peer
"addrbind":"ip:port", (string) Bind address of the connection to the peer
"addrlocal":"ip:port", (string) Local address as reported by the peer
"services":"xxxxxxxxxxxxxxxx", (string) The services offered
"verified_proregtx_hash": h, (hex) Only present when the peer is a masternode and succesfully
authenticated via MNAUTH. In this case, this field contains the
protx hash of the masternode
"verified_pubkey_hash": h, (hex) Only present when the peer is a masternode and succesfully
authenticated via MNAUTH. In this case, this field contains the
hash of the masternode's operator public key
"relaytxes":true|false, (boolean) Whether peer has asked us to relay transactions to it
"lastsend": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send
"lastrecv": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive
"bytessent": n, (numeric) The total bytes sent
"bytesrecv": n, (numeric) The total bytes received
"conntime": ttt, (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT)
"timeoffset": ttt, (numeric) The time offset in seconds
"pingtime": n, (numeric) ping time (if available)
"minping": n, (numeric) minimum observed ping time (if any at all)
"pingwait": n, (numeric) ping wait (if non-zero)
"version": v, (numeric) The peer version, such as 70001
"subver": "/pacprotocol:x.x.x/", (string) The string version
"inbound": true|false, (boolean) Inbound (true) or Outbound (false)
"addnode": true|false, (boolean) Whether connection was due to addnode/-connect or if it was an automatic/inbound connection
"masternode": true|false, (boolean) Whether connection was due to masternode connection attempt
"startingheight": n, (numeric) The starting height (block) of the peer
"banscore": n, (numeric) The ban score
"synced_headers": n, (numeric) The last header we have in common with this peer
"synced_blocks": n, (numeric) The last block we have in common with this peer
"inflight": [
n, (numeric) The heights of blocks we're currently asking from this peer
...
],
"whitelisted": true|false, (boolean) Whether the peer is whitelisted
"bytessent_per_msg": {
"addr": n, (numeric) The total bytes sent aggregated by message type
...
},
"bytesrecv_per_msg": {
"addr": n, (numeric) The total bytes received aggregated by message type
...
}
}
,...
]
Examples:
> pacprotocol-cli getpeerinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:1111/