3

I have created a small DAPP and it works fine with a geth rpc node running. However - I want to make it also compatible with the current MIST version (the November developer release)

It seems like there are different options to include the web3 object. I have chosen this one:

// 2. optional use web3 from mist, OR load if outside of mist
  if(typeof web3 === 'undefined')
     web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

So my assumption is: if the DAPP is loaded within MIST web3 does already exist and is not overwritten. However - It still does not work and I get a:

Error: Invalid JSON RPC response: ""

So the question is: what are the steps to make a DAPP compatible with MIST?

3

web3 is already present in Mist, but not Web3, so you would use the provider of the web3 object and use your own Web3 version you added from your package:

 if(typeof web3 !== 'undefined')
    web3 = new Web3(web3.currentProvider);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.