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.

https://github.com/ethereum/web3.js
https://github.com/ethereum/wiki/wiki/JavaScript-API

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) https://github.com/ethereum/web3.js/blob/master/example/balance.html 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.


Comments

Sign In or Register to comment.