November 2019
Beginner
436 pages
8h 52m
English
We already have a web3 client instance. We can use the following API to gather information about the current node:
web3.eth.getNodeInfo(callback)
Let's see how this works in the React application that we are building:
const web3 = new Web3('ws://localhost:7545');console.log(web3);web3.eth.getNodeInfo(function(error, result) { if (error) { console.error(error); } else { console.log('result', result); }});
result EthereumJS TestRPC/v2.8.0/ethereum-js
You are making good progress so far. Let's display the node information in the user interface on startup. ...
Read now
Unlock full access