1

I need to test a DAPP which will run in Mist, but I don't want to run it in TestNet or MainNet, I want to run it in a ethereum-js testrpc instance. Is it possible to do that? Does anybody has tried it?

1

I finally got the answer. You just have to call:

web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));

And then you have your web3 instance connected to your testrpc instance connected.

1
  • Do you have to put that in your html/javascript? Or is there a way to run it in Mist so, for example, Mist lists the accounts and their balances? Oct 8 '16 at 18:09
0

Yes, it is. Use it as a library (make sure testrpc is running beforehand and web3 is installed):

var Web3 = require('web3');
web3 = new Web3(web3.currentProvider);
var TestRPC = require("ethereumjs-testrpc");
web3.setProvider(TestRPC.provider());

You can then make transactions to the contract.

2
  • 1
    Comments are not for extended discussion; this conversation has been moved to chat.
    – Afr
    Jul 26 '16 at 12:41
  • Your "moved to chat" link goes to a page not found. Oct 8 '16 at 18:07

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.