This page uses machine translation from English, which may contain errors or unclear language. For the most accurate information, please see the original English version. Some content may be in the original English due to frequent updates. Help us improve this page's translation by joining our effort on Crowdin. (Crowdin translation page, Contributing guide)
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