Skip to main content
POST
net_listening
curl --request POST \
  --url https://rpc.testnet.tempo.xyz/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "net_listening",
  "params": [],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": true
}
Tempo API method that returns true if the client is actively listening for network connections.

Parameters

None.

Response

  • resulttrue if the client is listening, false otherwise

net_listening code examples

const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);

const checkListening = async () => {
    const listening = await provider.send("net_listening", []);
    console.log(`Node is listening: ${listening}`);
  };

checkListening();

Body

application/json
jsonrpc
string
default:2.0
method
string
default:net_listening
params
any[]
id
integer
default:1

Response

200 - application/json

Listening status

jsonrpc
string
id
integer
result
boolean

true if the client is actively listening for network connections