Can you please help me understand a few things about building a web app with Ethereum? I have looked at other posts but i can't find anything helpful.
From what i gather, i first need to install web3.js and BigNumber.js into my app. (my app is currently a browser extension so i just want the ‘vanilla’ scripts). I then need to run a local node. I have installed Mix, and it’s running on localhost:52131. Then from inside my app i have...
var web3 = require('web3');
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
web3 = new Web3(new Web3.providers.HttpProvider("
http://localhost:52131"));
}
if (web3.isConnected()) {
console.log("yeah! we are connected!");
} else {
console.log("Boooo! we are not connected!");
}
It’s not getting connected. I don’t think that is the correct port number but i have tried 8545 also. It seems that web3 is loaded as i can do:- console.log(web3.version.api).
Sorry for the newb questions, but can someone point me in the right direction?
Comments
EDIT: Ok gotcha. There was a hidden file .mix that i didn't see. I copied that across and can now open the browser extension code and compile the contract.