Cannot connect my front-end to my back-end on a simple example.

notsosmartcontractnotsosmartcontract Posts: 2Member
Hello,

I'm right now making some tests. I got a private ethereum testnet.
I start the node running:
geth --identity "node" --rpc --rpcport 8000 --rpccorsdomain "*" --datadir "myfolder" --port "30303" --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,eth,net,web3" --autodag --networkid 10165211 --nat "any" --solc /usr/bin/solc console

Then i got my standard script:
var Web3 = require('web3');
var web3 = new Web3();
var provider = new web3.providers.HttpProvider('http://localhost:8000');
web3.setProvider(provider);
if(!web3.currentProvider.isConnected())
{
console.log("Error: not conected");
}
else
{
//code here
}
I got node.js installed.
I got web3 installed using npm install web3.
I checked the $NODE_PATH.
I checked the web3 modules are on the right node_modules folder.


But i still cannot connect.
Any idea?

Comments

Sign In or Register to comment.