Last updated

peers

[Source]

The peers command returns a list of all other rippled servers currently connected to this one over the Peer Protocol, including information on their connection and sync status.

The peers method is an admin method that cannot be run by unprivileged users!

Request Format

An example of the request format:

  1. WebSocket
  2. Commandline
{
    "id": 2,
    "command": "peers"
}

The request includes no additional parameters.

Response Format

An example of a successful response:

  1. WebSocket
  2. JSON-RPC
  3. Commandline
{
  "id": "peers_example",
  "result": {
    "cluster": {},
    "peers": [
      {
        "address": "5.189.239.203:51235",
        "complete_ledgers": "51813132 - 51815132",
        "ledger": "99A1E29C9F235DCCBB087F85F11756BECA606A756C22AB826AB1F319C470C3E3",
        "load": 157,
        "metrics": {
          "avg_bps_recv": "10255",
          "avg_bps_sent": "2015",
          "total_bytes_recv": "356809",
          "total_bytes_sent": "74208"
        },
        "public_key": "n94ht2A9aBoARRhk1rwypZNVXJDiMN4qzs1Bd5KsQaSnN3WVy8Tw",
        "uptime": 2,
        "version": "rippled-1.4.0"
      },
      {
        "address": "[::ffff:50.22.123.222]:51235",
        "complete_ledgers": "32570 - 51815131",
        "ledger": "99A1E29C9F235DCCBB087F85F11756BECA606A756C22AB826AB1F319C470C3E3",
        "load": 219,
        "metrics": {
          "avg_bps_recv": "7223",
          "avg_bps_sent": "6742",
          "total_bytes_recv": "593148",
          "total_bytes_sent": "204540"
        },
        "public_key": "n9LbkoB9ReSbaA9SGL317fm6CvjLcFG8hGoierLYfwiCDsEXHcP3",
        "uptime": 3,
        "version": "rippled-1.3.1"
      },
      {
        "address": "51.89.153.154:51235",
        "complete_ledgers": "51814130 - 51815130",
        "ledger": "808800914218F5622ED5F639BC0EEDF9530E47C6F81CD1EB3866FA1496F62B9C",
        "load": 27,
        "metrics": {
          "avg_bps_recv": "172748",
          "avg_bps_sent": "7355",
          "total_bytes_recv": "5455031",
          "total_bytes_sent": "234276"
        },
        "public_key": "n944vHEtDhPm4Bd9rPowZMJduR9XrpxKS9AKHFfcJtKRVAdhfFfD",
        "uptime": 8,
        "version": "rippled-1.4.0"
      },
      {
        "address": "192.151.157.20:51235",
        "complete_ledgers": "51813128 - 51815128",
        "latency": 8000,
        "load": 70,
        "metrics": {
          "avg_bps_recv": "463258",
          "avg_bps_sent": "21954",
          "total_bytes_recv": "13910029",
          "total_bytes_sent": "678908"
        },
        "public_key": "n9JbUWaFZDi1UxFexJXf1D9dRpn8UK6pTNwRxBCjEvLEwQa384uP",
        "uptime": 19,
        "version": "rippled-1.3.1"
      },
      {
        "address": "[::ffff:94.237.45.66]:51235",
        "complete_ledgers": "51815004 - 51815131",
        "ledger": "99A1E29C9F235DCCBB087F85F11756BECA606A756C22AB826AB1F319C470C3E3",
        "load": 202,
        "metrics": {
          "avg_bps_recv": "18258",
          "avg_bps_sent": "1903",
          "total_bytes_recv": "1184272",
          "total_bytes_sent": "65101"
        },
        "public_key": "n9Lg83FYh8YDivG9TcgXhq5Y3PwunmRqVfvibd19Ko9uu3DtqLBM",
        "uptime": 2,
        "version": "rippled-1.3.1"
      },
      {
        "address": "[::ffff:149.56.21.37]:51235",
        "complete_ledgers": "51478129 - 51815129",
        "ledger": "462FA0B34723C12EBE4DC9974B397D6A21D4F1770DE3CD584D4E33DBC83FC247",
        "load": 182,
        "metrics": {
          "avg_bps_recv": "132648",
          "avg_bps_sent": "13935",
          "total_bytes_recv": "3983628",
          "total_bytes_sent": "433757"
        },
        "public_key": "n94Dutms7xoSgWjbjYftDJGXvc5jaeYZq3J7o1Jwo35dZAyuzNWT",
        "uptime": 14,
        "version": "rippled-1.3.1"
      },
      {
        "address": "77.117.40.191:51235",
        "complete_ledgers": "51812267 - 51815071",
        "latency": 30555,
        "ledger": "0562C7A1898196FDC60B8DB1838961BFBA6B9304B1510E6030B32A4FB38400FB",
        "load": 3783,
        "metrics": {
          "avg_bps_recv": "495673",
          "avg_bps_sent": "57527",
          "total_bytes_recv": "17137378",
          "total_bytes_sent": "4140188"
        },
        "public_key": "n9LELaTdzKwfzhvHZKKrD3ZEJtWABSg4ocAT4dz5Vg5JgAVGwVdd",
        "uptime": 73,
        "version": "rippled-1.4.0"
      },
      {
        "address": "[::ffff:94.237.49.50]:51235",
        "complete_ledgers": "51815002 - 51815130",
        "latency": 8000,
        "ledger": "C6030B52471F8076F88A90C6FC2B2998794B32023FAC69FF573437D6D1470961",
        "load": 1563,
        "metrics": {
          "avg_bps_recv": "215539",
          "avg_bps_sent": "25705",
          "total_bytes_recv": "23134383",
          "total_bytes_sent": "2738880"
        },
        "public_key": "n9MLzBWq7WNM2sdpRKY2Tr3EJfxwSwsnDEpxU3auGJHgvq3Bit6S",
        "uptime": 112,
        "version": "rippled-1.3.1"
      }
    ]
  },
  "status": "success",
  "type": "response"
}

The response follows the standard format, with a successful result containing a JSON object with the following fields:

FieldTypeDescription
clusterObjectSummary of other rippled servers in the same cluster, if configured as a cluster.
peersArrayArray of peer objects.

Each field of the cluster object is the public key of that rippled server's identifying key pair. (This is the same value that that server returns as pubkey_node in the server_info method.) The contents of that field are an object with the following fields:

FieldTypeDescription
tagStringThe display name for this cluster member as defined in the config file.
feeNumber(May be omitted) The load multiplier this cluster member is applying to the transaction cost
ageNumberThe number of seconds since the last cluster report from this cluster member.

Each member of the peers array is a peer object with the following fields:

FieldTypeDescription
addressStringThe IP address and port where this peer is connected
clusterBoolean(May be omitted) If true, the current server and the peer server are part of the same rippled cluster.
nameString(May be omitted) If the peer is part of the same cluster, this is the display name for that server as defined in the config file.
complete_ledgersStringRange expression indicating the ledger indexes of the ledger versions the peer rippled server has available
inboundBoolean(May be omitted) If true, the peer is connecting to the local server.
latencyNumberThe network latency to the peer (in milliseconds)
ledgerStringThe identifying hash of the peer's most recently closed ledger
loadNumberA measure of the amount of load the peer server is putting on the local server. Larger numbers indicate more load. (The units by which load is measured are not formally defined.)
protocolString(May be omitted) The protocol version that the peer is using, if not the same as the local server.
metricsObjectDetails on the amount of data sent to and received from this peer. See the description of the metrics object below for details.
public_keyString(May be omitted) A public key that can be used to verify the integrity of the peer's messages. This is not the same key that is used for validations, but it follows the same format.
sanityString(May be omitted) Whether this peer is following the same rules and ledger history as the current server. A value of insane probably indicates that the peer is part of a parallel network. The value unknown indicates that the current server is unsure whether the peer is compatible.
statusString(May be omitted) The most recent status message from the peer. Could be connecting, connected, monitoring, validating, or shutting.
uptimeNumberThe number of seconds that your rippled server has been continuously connected to this peer.
versionstring(May be omitted) The rippled version number of the peer server

The metrics object contains the following fields:

FieldTypeDescription
avg_bps_recvStringThe average bytes per second of data received from this peer.
avg_bps_sentStringThe average bytes per second of data sent to this peer.
total_bytes_recvStringThe total number of bytes of data received from this peer.
total_bytes_sentStringThe total number of bytes of data sent to this peer.

Note: All of the fields in the metrics object are 64-bit unsigned integers serialized to string format so that they do not lose precision in JSON encoding/decoding.

Possible Errors