I have been trying to set up my dapp, and have not found any resource that explains it thoroughly. I want to connect my application to ethereum using Geth and web3. So far, my index.js file looks like this:
var Web3 = require('web3')
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider)
} else {
web3 = new Web3(new
Web3.providers.HttpProvider('http://localhost:8545'))
}
And I type:
geth --testnet --rpc
to initiate the node in my command line. I have an npm script that runs geth and compiles index.js at the same time. Is there something I am missing? I also have another question. What is the correct way to import web3 using ES6 modules (import ... from ...)?