caver.rpc.net
caver.rpc.net
provides JSON-RPC call with net
name space.
caver.rpc.net.getNetworkId
Returns the network identifier (network ID) of the Klaytn Node.
Parameters
Name | Type | Description |
---|---|---|
callback | function | (optional) Optional callback, returns an error object as the first parameter and the result as the second. |
Return Value
Promise
returns number
Type | Description |
---|---|
number | The network id. |
Example
caver.rpc.net.isListening
Returns true
if the Klaytn Node is actively listening for network connections.
Parameters
Name | Type | Description |
---|---|---|
callback | function | (optional) Optional callback, returns an error object as the first parameter and the result as the second. |
Return Value
Promise
returns boolean
Type | Description |
---|---|
boolean |
|
Example
caver.rpc.net.getPeerCount
Returns the number of peers currently connected to the Klaytn Node.
Parameters
Name | Type | Description |
---|---|---|
callback | function | (optional) Optional callback, returns an error object as the first parameter and the result as the second. |
Return Value
Promise
returns string
Type | Description |
---|---|
string | The number of connected peers in hex. |
Example
caver.rpc.net.getPeerCountByType
Returns the number of connected nodes by type and the total number of connected nodes with key/value pairs.
Parameters
Name | Type | Description |
---|---|---|
callback | function | (optional) Optional callback, returns an error object as the first parameter and the result as the second. |
Return Value
Promise
returns object
Type | Description |
---|---|
object | The number of connected peers by type as well as the total number of connected peers. |
Example
Last updated