Can someone tell me why await
is not working here?
const Web3 = require('web3');
web3 = new Web3(new Web3.providers.HttpProvider("http://<ip>:8545"));
let accounts = (async () => await web3.eth.getAccounts())();
// await was not working, here I get a promise
console.log(accounts);
// if I wait with a timeout I get my accounts
setTimeout(() => console.log(accounts), 5000);