Skip to main content
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();