caver.rpc.net
caver.rpc.net
provides JSON-RPC call with net
name space.
caver.rpc.net.getNetworkId
caver.rpc.net.getNetworkId([callback])
Returns the network identifier (network ID) of the kaia 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.getNetworkId().then(console.log)1001