Polygon
Polygon
Polygon
Free tier covers personal projects. Pay-as-you-go scales without a card.
net_listening returns a boolean indicating whether a Polygon PoS node is actively listening for incoming peer-to-peer connections. A true result means the Bor client's P2P stack is open and able to gossip blocks and transactions with the rest of the Polygon network that settles MATIC fees. It is the simplest liveness probe in the net namespace. Call it against the Polygon mainnet endpoint at https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) as a quick confirmation that the node behind your requests is online.
This method takes no parameters. Pass an empty array [].
| Type | Description |
|---|---|
| boolean | `true` if the client is listening for P2P connections, `false` otherwise. |
Try it live in the Polygon playground.
true only means the node is listening for connections, not that it actually has peers or is in sync with the Polygon head. Pair it with net_peerCount to confirm real connectivity, and eth_syncing to confirm the node is current.true and reflects the gateway rather than the precise state of any single underlying node.