net_peerCount - Avalanche

net_peerCount. Retrieve the number of peers currently connected to the node

net_peerCount - avalanche [Value: 0CU]
Retrieves the number of peers currently connected to the client
Use cases

Use cases

  • Retrieve a list of managed accounts
  • Verify available accounts on the connected node
  • Populate account dropdown menus
Constraints

Constraints

  • Requires node with account management capability
  • Risk of exposing addresses
  • Depends on node's current account configuration
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl https://avalanche.drpc.org \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":67}'
'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 67,
  "result": "0x8"  
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
ParametersThis method does not accept any parameters.

Response

200
The number of peers connected to the client, returned as a hexadecimal string.

Response params

object
idinteger
jsonrpcstring
resultstring