Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring getpeerinfo up to date #65

Open
roylee17 opened this issue Jun 15, 2022 · 0 comments
Open

Bring getpeerinfo up to date #65

roylee17 opened this issue Jun 15, 2022 · 0 comments
Labels
rpc RPC related issues

Comments

@roylee17
Copy link
Collaborator

roylee17 commented Jun 15, 2022

The latest spec (v22.0.0) has updated with quite a lot attributes. We should at least bring lbcd to match lbrycrd, which is based on v0.17.0.

On lbcd:

  {
    "id": 106,
    "addr": "118.93.55.42:9246",
    "addrlocal": "192.168.86.242:61671",
    "services": "00001037",
    "relaytxes": true,
    "lastsend": 1655326305,
    "lastrecv": 1655326304,
    "bytessent": 560414,
    "bytesrecv": 1373028,
    "conntime": 1655311849,
    "timeoffset": 0,
    "pingtime": 165848,
    "version": 70015,
    "subver": "/LBRY:0.17.4.6/",
    "inbound": false,
    "startingheight": 1176898,
    "currentheight": 1176989,
    "banscore": 0,
    "feefilter": 1000,
    "syncnode": false
  },

On lbrycrd:

 {
    "id": 617,
    "addr": "15.235.15.215:9246",
    "addrlocal": "71.38.8.245:62719",
    "addrbind": "192.168.86.242:62719",
    "services": "000000000000004d",
    "relaytxes": true,
    "lastsend": 1655326388,
    "lastrecv": 1655326391,
    "bytessent": 305318,
    "bytesrecv": 873263,
    "conntime": 1655318051,
    "timeoffset": 0,
    "pingtime": 0.079597,
    "minping": 0.078185,
    "version": 70013,
    "subver": "/btcwire:0.5.0/LBRY.GO:0.22.200(Pascals Wager)/",
    "inbound": false,
    "addnode": false,
    "startingheight": 1176941,
    "banscore": 0,
    "synced_headers": 1176994,
    "synced_blocks": 1176994,
    "inflight": [],
    "whitelisted": false,
    "bytessent_per_msg": {
      "addr": 55,
      "feefilter": 32,
      "getaddr": 24,
      "getdata": 28154,
      "getheaders": 1085,
      "inv": 195918,
      "ping": 2240,
      "pong": 2208,
      "sendheaders": 24,
      "tx": 75429,
      "verack": 24,
      "version": 125
    },
    "bytesrecv_per_msg": {
      "addr": 7617,
      "getblocks": 50995,
      "getdata": 7929,
      "headers": 7452,
      "inv": 233643,
      "notfound": 2353,
      "ping": 2208,
      "pong": 2240,
      "tx": 558644,
      "verack": 24,
      "version": 158
    }

Latest spec:

[                                     (json array)
  {                                   (json object)
    "id" : n,                         (numeric) Peer index
    "addr" : "str",                   (string) (host:port) The IP address and port of the peer
    "addrbind" : "str",               (string) (ip:port) Bind address of the connection to the peer
    "addrlocal" : "str",              (string) (ip:port) Local address as reported by the peer
    "network" : "str",                (string) Network (ipv4, ipv6, onion, i2p, not_publicly_routable)
    "mapped_as" : n,                  (numeric) The AS in the BGP route to the peer used for diversifying
                                      peer selection (only available if the asmap config flag is set)
    "services" : "hex",               (string) The services offered
    "servicesnames" : [               (json array) the services offered, in human-readable form
      "str",                          (string) the service name if it is recognised
      ...
    ],
    "relaytxes" : true|false,         (boolean) Whether peer has asked us to relay transactions to it
    "lastsend" : xxx,                 (numeric) The UNIX epoch time of the last send
    "lastrecv" : xxx,                 (numeric) The UNIX epoch time of the last receive
    "last_transaction" : xxx,         (numeric) The UNIX epoch time of the last valid transaction received from this peer
    "last_block" : xxx,               (numeric) The UNIX epoch time of the last block received from this peer
    "bytessent" : n,                  (numeric) The total bytes sent
    "bytesrecv" : n,                  (numeric) The total bytes received
    "conntime" : xxx,                 (numeric) The UNIX epoch time of the connection
    "timeoffset" : n,                 (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" : n,                    (numeric) The peer version, such as 70001
    "subver" : "str",                 (string) The string version
    "inbound" : true|false,           (boolean) Inbound (true) or Outbound (false)
    "bip152_hb_to" : true|false,      (boolean) Whether we selected peer as (compact blocks) high-bandwidth peer
    "bip152_hb_from" : true|false,    (boolean) Whether peer selected us as (compact blocks) high-bandwidth peer
    "startingheight" : n,             (numeric) The starting height (block) of the peer
    "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" : [                    (json array)
      n,                              (numeric) The heights of blocks we're currently asking from this peer
      ...
    ],
    "permissions" : [                 (json array) Any special permissions that have been granted to this peer
      "str",                          (string) bloomfilter (allow requesting BIP37 filtered blocks and transactions),
                                      noban (do not ban for misbehavior; implies download),
                                      forcerelay (relay transactions that are already in the mempool; implies relay),
                                      relay (relay even in -blocksonly mode, and unlimited transaction announcements),
                                      mempool (allow requesting BIP35 mempool contents),
                                      download (allow getheaders during IBD, no disconnect after maxuploadtarget limit),
                                      addr (responses to GETADDR avoid hitting the cache and contain random records with the most up-to-date info).
                                      
      ...
    ],
    "minfeefilter" : n,               (numeric) The minimum fee rate for transactions this peer accepts
    "bytessent_per_msg" : {           (json object)
      "msg" : n,                      (numeric) The total bytes sent aggregated by message type
                                      When a message type is not listed in this json object, the bytes sent are 0.
                                      Only known message types can appear as keys in the object.
      ...
    },
    "bytesrecv_per_msg" : {           (json object)
      "msg" : n,                      (numeric) The total bytes received aggregated by message type
                                      When a message type is not listed in this json object, the bytes received are 0.
                                      Only known message types can appear as keys in the object and all bytes received
                                      of unknown message types are listed under '*other*'.
      ...
    },
    "connection_type" : "str"         (string) Type of connection: 
                                      outbound-full-relay (default automatic connections),
                                      block-relay-only (does not relay transactions or addresses),
                                      inbound (initiated by the peer),
                                      manual (added via addnode RPC or -addnode/-connect configuration options),
                                      addr-fetch (short-lived automatic connection for soliciting addresses),
                                      feeler (short-lived automatic connection for testing addresses).
                                      Please note this output is unlikely to be stable in upcoming releases as we iterate to
                                      best capture connection behaviors.
  },
  ...
]
@roylee17 roylee17 added the rpc RPC related issues label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rpc RPC related issues
Projects
None yet
Development

No branches or pull requests

1 participant