githubEdit

net_listening - Celo

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 Celo 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

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

Response Definition

Field
Type
Description

result

boolean

true if listening

Use Cases

  • Check node connectivity

  • Health monitoring

  • Network diagnostics

Error Handling

Error Code
Description

-32603

Internal error

Last updated

Was this helpful?