Cannot connect to Mix using web3

givemecreditgivemecredit Member Posts: 20
edited May 2016 in web3-js
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?


  • givemecreditgivemecredit Member Posts: 20
    There seems to be a lot of unanswered posts on this forum. I guess there's a lot of posters. i think the documentation could be a lot better. If you improve the docs, then people can learn, and if people learn, they will write tutorials etc. A simple (up-to-date) 'hello world' dapp tutorial will do. One that illustrates the simplest way to setup a front-end with web3, deploy a contract to the test chain, read and write to the contract, package and deploy the dapp, using the main chain. With this knowledge it should relatively straight forward to start building stuff.
  • givemecreditgivemecredit Member Posts: 20
    edited May 2016
    Ok i see. I just copied the folder + files created by mix into a test project then opened the project in mix and was able to compile the new contract. I'm not able to compile a contract from the browser extension yet though. And i'm not using web3. I guess it gets injected into the browser by mix.

    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.
Sign In or Register to comment.