getId¶
web3.eth.net.getId([callback])
web3.bzz.net.getId([callback])
web3.shh.net.getId([callback])
Gets the current network ID.
Parameters¶
none
Returns¶
Promise
returns Number
: The network ID.
Example¶
web3.eth.net.getId()
.then(console.log);
> 1
isListening¶
web3.eth.net.isListening([callback])
web3.bzz.net.isListening([callback])
web3.shh.net.isListening([callback])
Checks if the node is listening for peers.
Parameters¶
none
Returns¶
Promise
returns Boolean
Example¶
web3.eth.isListening()
.then(console.log);
> true