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.jshttps://github.com/ethereum/wiki/wiki/JavaScript-APIThese 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
<script type="text/javascript" src="../node_modules/bignumber.js/bignumber.min.js"></script>
In geth, use the command
admin.startRPC("127.0.0.1", 8545, "*", "web3,db,net,etc")
which should return "True"This got it working for me