hoprnet / hoprnet

HOPR is an open incentivized mixnet which enables privacy-preserving point-to-point data exchange. HOPR is similar to Tor but actually private, decentralized and economically sustainable.
https://hoprnet.org
GNU General Public License v3.0
213 stars 91 forks source link

API /peers add last latency and version of an automatic ping to the peers array #5529

Closed mjadach-iv closed 1 year ago

mjadach-iv commented 1 year ago

Is your feature related to a problem?

Will be a lot easier to remaster Network Dashbaord data gathering

Describe the feature you'd like

Add more fileds in the API /peers call: last latency and last version which a HOPRd node gets by automatic pinging of other nodes on the network.

Teebor-Choka commented 1 year ago

The GET /node/peers fetches the following information:

  return {
    peerId: info.peer_id(),
    peerAddress: address?.to_string(),
    multiAddr: multiaddr ? multiaddr.toString() : '',
    heartbeats: {
      sent: Number(info.heartbeats_sent),
      success: Number(info.heartbeats_succeeded)
    },
    lastSeen: Number(info.last_seen),
    quality: info.quality(),
    backoff: info.backoff,
    isNew: info.heartbeats_sent === BigInt(0),
    reportedVersion: info.metadata().get(peer_metadata_protocol_version_name()) ?? 'unknown'
  }