net
APIs used to query network configuration.
Last updated
APIs used to query network configuration.
Last updated
The namespace net
provides functions related to the Klaytn networks.
Returns the network identifier (network ID).
Parameters
None
Return Value
Type | Description |
---|---|
Example
Returns true
if the client is actively listening for network connections.
Parameters
None
Return Value
Example
Returns the number of peers currently connected to the client.
Parameters
None
Return Value
Example
Returns the number of connected nodes by type and the total number of connected nodes with key/value pairs.
Parameters
None
Return Value
Example
Return the current klaytn protocol version.
Parameters
None
Return Value
Example
Type | Description |
---|---|
Type | Description |
---|---|
Type | Description |
---|---|
Type | Description |
---|---|
QUANTITY
The integer of the network identifier.
- "1001"
: Klaytn Baobab testnet.
- "8217"
: Klaytn Cypress mainnet.
Boolean
true
when listening, otherwise false
.
QUANTITY
Integer of the number of connected peers.
JSON string
The number of connected peers by type as well as the total number of connected peers.
QUANTITY
The integer of the klaytn protocol version.
- "1001"
: Klaytn Baobab testnet.
- "8217"
: Klaytn Cypress mainnet.