net_listening - Somnia

Example code for the net_listening JSON-RPC method. Complete guide on how to use net_listening JSON-RPC in GetBlock Web3 documentation

This method returns true if the client is actively listening for network connections on the Somnia network.

Parameters

  • None

Request Example

cURL
curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "method": "net_listening",
  "params": []
}'

Response Example

response.json
{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "result": true
}

Use Cases

  • Node health checks

  • Connection validation

  • Monitoring node status

Last updated

Was this helpful?