5

I've installed ethereumjs-testrpc and I'm running it with testrpc in my terminal, which I'm pretty sure is working because it outputs Listening on localhost:8545 after listing all the test accounts' addresses and private keys.

Now I'd like to test some of my contracts on Remix, and I'm setting the "Environment" field (in the "Run" tab) to "Web3 Provider", but when I use the default input of http://localhost:8545 for the provider endpoint, Remix spits out "Not possible to connect to the Web3 provider. Make sure the provider is running and a connection is open (via IPC or RPC)."

Am I missing any steps in setting this up correctly, or is Remix not supposed to be used with testrpc? Thanks

3
  • 1
    That workflow usually works fine for me. (I just tried it again now.)
    – user19510
    Oct 21, 2017 at 20:53
  • 1
    I'm having the same problem right now. Was following a course on Udemy which requires this as a step, but didn't work for me. Did you solve it?
    – luislhl
    Nov 12, 2017 at 17:17
  • Yep, see @luislhl's answer at ethereum.stackexchange.com/a/30540/11106
    – feihcsim
    Nov 30, 2017 at 22:58

5 Answers 5

5

This answer in another thread solved it to me.

Basically the problem occurs when you use HTTPS version of Remix, which makes the browser block localhost because of mixed content (HTTP inside HTTPS).

If you use HTTP version of Remix, it works fine.

The error may be caused by Remix run from https (https://remix.ethereum.org). If so, it should be fixed by switching to http (i.e. http://remix.ethereum.org)

3

If the default doesn't work then you could try installing Metamask. You can then connect Metamask to the default port localhost:8545. (You can import the mnemonic that you used to initialise testrpc in Metamask to connect.) Now you can use the injected web3 in Remix (under Run -> Environment select Injected Web3).

1
  • marking your answer as correct for now because it's a viable workaround but id still like to figure out how to get it working with testrpc directly!
    – feihcsim
    Oct 25, 2017 at 18:42
1

check this and go for the zip file for offline usage of remix/browser-solidity (btw: can someone tell me the difference?). worked for me with testrpc.

1

Remove the https from the address it should look like "http://remix.ethereum.org/#version=soljson-v0.4.18+commit.9cf6e910.js" it will connect to test RPC and show you the given accounts. enter image description here

0

If anything doesn't work, make sure that your testrpc is running in your CMD. It shows an error because probably you forget to open the connection or have closed it after process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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