Polygon
Polygon
Polygon
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
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.
此方法不需要任何参数,传入空数组 [] 即可。
| 类型 | 描述 |
|---|---|
| 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.