Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io'));
- let isListening = await web3.eth.net.isListening();
- let numPeers = await web3.eth.net.getPeerCount();
- console.log( "node " + infuraUrl + " listening: " + isListening.toString() + " with " + numPeers + " peers");
- let isListening = await web3.eth.net.isListening();
- ^^^^
- SyntaxError: Unexpected identifier
- at createScript (vm.js:80:10)
- at Object.runInThisContext (vm.js:139:10)
- at Module._compile (module.js:607:28)
- at Object.Module._extensions..js (module.js:654:10)
- at Module.load (module.js:556:32)
- at tryModuleLoad (module.js:499:12)
- at Function.Module._load (module.js:491:3)
- at Function.Module.runMain (module.js:684:10)
- at startup (bootstrap_node.js:187:16)
- at bootstrap_node.js:608:3
- web3 = new Web3(new Web3.providers.HttpProvider(infuraUrl));
- console.log("web 3 version " + web3.version);
- async function logMetaData(){
- let isListening = await web3.eth.net.isListening();
- let numPeers = await web3.eth.net.getPeerCount();
- console.log( "node " + infuraUrl + " listening: " + isListening.toString() + " with " + numPeers + " peers");
- };
- logMetaData();
Add Comment
Please, Sign In to add comment