My Geth tutorial Greeter contract runs fine from the command line. I tried to make a front end that just outputs the string from Greeter, but the browser console returns the error, 'NS_ERROR_UNKNOWN_PROTOCOL.'
I tried the suggestions from here:
How to connect a web site to a geth node?
using --rpccorsdomain and --rpcaddr flags referencing localhost and port 8080 which my bootstrap frontend references, but same error.
Other ideas? Any working examples of backend blockchain contracts to front end UI's?
Thanks.
UPDATE to clarify, here are my configuration/execution steps:
Installed web3.js into project using Bower. Verified it is referenced in project index.html.
Ran CLI GETH Client with: geth –rpc –rpcaddr localhost --rpcport 8545 --rpccorsdomain “http://127.0.0.1:8080” observed it is syncing properly - running “net” in attached console shows 11 peers.
Run an http-server from project folder: http-server –p 8080
My project’s app.js file sets up HttpProvider following docs guidance:
// Dependencies var Web3 = require('web3'); // Initialize connection var web3 = new Web3(); if (typeof web3 !== 'undefined') { web3 = new Web3(web3.currentProvider); } else { // set the provider you want from Web3.providers web3 = new Web3(new Web3.providers.HttpProvider('http://127.0.0.1:8545')); }
HTML page function call includes: console.log("HttpProvider: " + web3.currentProvider)
The app.js function log output: “HttpProvider: undefined”
Clearly, I’m misconfigured, but how?
http://
?