info_get_peers

This method returns a list of peers connected to the node.

This method will use 15 Compute Units.


Reference: Here

Parameters

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "info_get_peers",
  "params": []
}

Returns

  • api_version - string RPC API version

  • peers - map of peer IDs to network addresses

    • address - integer network address

    • node_id - integer peer ID

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "api_version": "1.4.13",
    "peers": [
      {
        "address": "127.0.0.1:54321",
        "node_id": "tls:0101..0101"
      }
    ]
  }
}   
curl https://mainnet.casper.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"id":1,"jsonrpc":"2.0","method":"info_get_peers","params":[]}'

Last updated