Step by Step - guide to connect a web site to a geth node?

mikkaaamikkaaa Member Posts: 34
Before the dapp-browser Mist is available, this web3 library seems the way to go on building a bridge from contract to a frontend (web site).

But, I cannot get the very basic examples to work.

These sources lack a few major points:

1) What is the exact command to start geth to run the examples? I have used geth --rpc console 2 while mining etc.

2) have the line

web3.setProvider(new web3.providers.HttpProvider());

Should it be?:

web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));

3) Anyway to hide web3.setProvider and other javascript code from the page source viewable for the user. If the geth node address is a public, that could be a security problem.

Maybe I'm asking the obvious questions here, but it shouldn't be too much trouble to add at least the geth starting argument to the tutorials. The best case scenario would be to have step by step guide with no assumptions leaved blank.


Sign In or Register to comment.