The net API provides insight about the networking aspect of the client.
Returns an indication if the node is listening for network connections.
Console
net.listening
RPC
{"method": "net_listening"}
Returns the number of connected peers.
net.peerCount
{"method": "net_peerCount"}
Returns the devp2p network ID (e.g. 1 for mainnet, 5 for goerli).
net.version
{"method": "net_version"}
Last updated 2 years ago
Was this helpful?