Skip to main content
POST
net_peerCount
This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see Hyperliquid methods for the full availability breakdown.
The net_peerCount JSON-RPC method returns the number of peers currently connected to the client. This method provides information about the node’s network connectivity and can be used to monitor network health, connectivity status, and the decentralization level of the blockchain network.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

This method takes no parameters. The params field should be an empty array.

Response

The method returns the number of connected peers as a hexadecimal string.

Response structure

Peer count:
  • Returns the number of connected peers as a hexadecimal string
  • Convert from hex to decimal for human-readable count
  • Example: “0x2a” equals 42 peers in decimal

Peer connectivity interpretation

Network health indicators:
  • Higher peer count generally indicates better network connectivity
  • Zero peers may indicate network connectivity issues
  • Peer count fluctuates based on network conditions and node behavior
Decentralization metrics:
  • Peer count reflects the distributed nature of the network
  • More peers typically mean better data availability and redundancy
  • Useful for assessing network resilience and decentralization

Usage example

Basic implementation

Example request

Use your own endpoint in your code. The code examples use a placeholder Chainstack endpoint (YOUR_CHAINSTACK_ENDPOINT) — replace it with your own Hyperliquid node endpoint from the Chainstack console. The curl above uses a shared public endpoint for quick checks only; do not use it in production.

Use cases

The net_peerCount method is useful for applications that need to:
  • Network monitoring: Monitor blockchain network health and connectivity
  • Node diagnostics: Diagnose node connectivity and network issues
  • Performance optimization: Optimize application behavior based on network conditions
  • Health checks: Implement health checks for blockchain applications
  • Alert systems: Create alerts for network connectivity issues
  • Load balancing: Make load balancing decisions based on network health
  • Monitoring dashboards: Build network monitoring and status dashboards
  • DevOps tools: Monitor blockchain infrastructure health
  • Research analytics: Analyze network decentralization and topology
  • Automatic failover: Implement failover logic based on connectivity
  • Network statistics: Generate network connectivity statistics and reports
  • Quality assurance: Test network connectivity in different environments
  • Troubleshooting: Diagnose network-related issues and connectivity problems
  • Infrastructure monitoring: Monitor blockchain node infrastructure health
  • SLA monitoring: Monitor service level agreements for network connectivity
This method provides essential network connectivity information, enabling robust network monitoring and health assessment on the Hyperliquid EVM platform.

Body

application/json
jsonrpc
enum<string>
default:2.0
required

JSON-RPC version

Available options:
2.0
method
enum<string>
default:net_peerCount
required

The RPC method name

Available options:
net_peerCount
id
integer
default:1
required

Request identifier

params
array

Parameters (empty array for net_peerCount)

Response

200 - application/json

Successful response with peer count

jsonrpc
string

JSON-RPC version

id
integer

Request identifier

result
string

The number of connected peers as a hexadecimal string

Last modified on June 24, 2026