2022-07-27 07:38:03 -05:00
|
|
|
---
|
|
|
|
title: net Namespace
|
2022-08-22 03:40:56 -05:00
|
|
|
description: Documentation for the JSON-RPC API "net" namespace
|
2022-07-27 07:38:03 -05:00
|
|
|
---
|
|
|
|
|
|
|
|
The `net` API provides insight about the networking aspect of the client.
|
|
|
|
|
|
|
|
|
|
|
|
### net_listening
|
|
|
|
|
|
|
|
Returns an indication if the node is listening for network connections.
|
|
|
|
|
|
|
|
| Client | Method invocation |
|
|
|
|
|:--------|-------------------------------|
|
|
|
|
| Console | `net.listening` |
|
|
|
|
| RPC | `{"method": "net_listening"}` |
|
|
|
|
|
|
|
|
### net_peerCount
|
|
|
|
|
|
|
|
Returns the number of connected peers.
|
|
|
|
|
|
|
|
| Client | Method invocation |
|
|
|
|
|:--------|-------------------------------|
|
|
|
|
| Console | `net.peerCount` |
|
|
|
|
| RPC | `{"method": "net_peerCount"}` |
|
|
|
|
|
|
|
|
### net_version
|
|
|
|
|
|
|
|
Returns the devp2p network ID (e.g. 1 for mainnet, 5 for goerli).
|
|
|
|
|
|
|
|
| Client | Method invocation |
|
|
|
|
|:--------|-----------------------------|
|
|
|
|
| Console | `net.version` |
|
|
|
|
| RPC | `{"method": "net_version"}` |
|