POST
/
6df1a1b3061097e66349993a96b8e535
curl --request POST \
  --url https://aurora-mainnet.core.chainstack.com/6df1a1b3061097e66349993a96b8e535 \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "net_listening",
  "params": []
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}

Aurora API method that returns a boolean value indicating whether the client is currently listening for network connections or not. The net_listening method can be useful in many scenarios where monitoring the status of a client’s network connection is important to ensure it works properly.

Get you own node endpoint today

Start 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

  • none

Response

  • boolean — a boolean value that indicates whether a node is actively seeking peer connections. true if the client is actively listening for connections, false if not.

net_listening code examples

const { Web3 } = require("web3");

const NODE_URL = "CHAINSTACK_NODE_URL";

const web3 = new Web3(NODE_URL);



async function isListening() {

  const listens = await web3.eth.net.isListening()

  console.log(listens);

}



isListening();

Use case

A method like net_listening can be used to monitor the network status of the Aurora node a developer connects to. Imagine a blockchain explorer where users can search for transactions, addresses, and other information on the blockchain. To provide accurate information to its users, the website needs to be able to monitor the current status of its connection.

Body

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

Response

200 - application/json
The boolean value that indicates whether or not a node is currently actively seeking peer connections.
jsonrpc
string
id
integer
result
string