[Ethereum] How to use testrpc as the environment in Remix

remixtestrpc

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

Best Answer

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)

Related Topic