I need to create server in nodejs that will create transaction to blockchain and i have trouble to connect my nodejs app with ganache. Look at my code:
const Web3 = require('web3'); var web3 = new Web3.providers.HttpProvider('http://localhost:7545'); // ganache address console.log(web3.eth.accounts); // should print 10 accounts but its error like eth is undefined
In my dependencies
Using this code on client-side works, what am i missing?