Get node network peers
Retrieves data about the node's network peers. By default this returns all peers. Multiple query params are combined using AND conditions
Parameters
Name | Required | Type | Detail |
---|---|---|---|
state | ❌ | Array[String] | Available values : disconnected, connecting, connected, disconnecting |
direction | ❌ | Array[String] | Available values : inbound, outbound |
Result
Returns data about the node's network peers
Example
Request
curl <your-endpoint>/eth/v1/node/peers?state=connected
Return
On success
{
"data": [
{
"peer_id": "16Uiu2HAmTziMP3Ggrqo2SgGnmd6aTo2tQdKxfnreYtV7vg31PP1N",
"enr": "",
"last_seen_p2p_address": "/ip4/3.82.211.16/tcp/39644",
"state": "connected",
"direction": "inbound"
},
{
"peer_id": "16Uiu2HAm2eN8CXLKPphpNRCVJd6v7Pzg1e7pf85a3szpkkrtbZCZ",
"enr": "",
"last_seen_p2p_address": "/ip4/15.204.160.9/tcp/33948",
"state": "connected",
"direction": "inbound"
},
...
{
"peer_id": "16Uiu2HAm7ruMr21pN6Pf3F7dyuqVzbpA9ZN6aGTh6UvBcXXqsxUF",
"enr": "",
"last_seen_p2p_address": "/ip4/3.84.179.201/tcp/61789",
"state": "connected",
"direction": "inbound"
}
]
}