[Ethereum] for using web3.js it is necessary to install geth into your system

blockchaingo-ethereumnodejsweb3js

for using web3.js it is necessary to install geth into your system or it automatically connect with geth or ethereum blockchain?

var web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))

here we connect something.
In this command we are connecting to what?
are we connecting to ethereum public chain or something else?

Best Answer

No, it isn't. You can test web3 with e.g. testrpc which also runs on port 8545 so you can connect to it in the same fashion. It makes testing way faster, more lightweight and cheaper (no real money for gas). If you want to work with some public blockchain (main chain or testnet) you could consider infura - but beware of centralization that you might not want!

Related Topic