6

I had an error to run on web3 provider (localhost:8545)

Not possible to connect to the Web3 provider. Make sure the provider is running and a connection is open (via IPC or RPC).

So I figured out like below.

I'm running geth on my local and I gave some options to connect with remix and testnet.

$ geth —testnet —rpc —rpcapi “db, net, web3, personal” —rpccorsdomain “https://remix.ethereum.org” console

I gave the -rpccorsdomain becuase the remix is on https.

anyway, check the 'web3 prover' on Run tab in remix IDE.

Then, modified the address like 'http://127.0.0.1:8545' not the 'http://localhost:8545'.

I don't know the reason why but it worked anyway when I fixed like that. I made my accounts and did something.

However, I had to redownload the geth again in some reason. (I've changed my pc). and I'm syncing the blocks right now. I think the syncing is not finished yet because the the blockNumber is 0.

> eth.blockNumber
0

so... I'm waiting now but I'm wondering that the error could occur when eth.syncing is not completely done.

Don
  • 3,876
  • 10
  • 47
  • 76
rachel_hong
  • 471
  • 2
  • 6
  • 15
  • 1
    There's a lot of "I had this problem then fixed it like this" comments in this question. I have no idea what's being asked. Please edit your question to be more concise. See https://stackoverflow.com/help/how-to-ask. – Adam Kipnis Jan 16 '18 at 16:17

9 Answers9

10

HTTPS won't let you connect to TestRPC running on HTTP. So you need to run the IDE with HTTP.

http://remix.ethereum.org/
Guim
  • 628
  • 2
  • 12
  • 26
3

Just remove HTTPS from address bar and just use HTTP, and it will work :-)

Ref: https://ethereum.stackexchange.com/users/32516/cryptoparticle

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/18842456) – Dariusz Woźniak Feb 16 '18 at 12:35
  • Thanks for the comment. Formatted the answer :-) – CryptoParticle Feb 16 '18 at 12:42
1

As everyone mentioned above, remove HTTPS from the address bar and use HTTP. Also, I ran it on http://localhost:8545

geth --datadir . --port <your_port_no> --networkid 1234 --rpc --rpcport "8545" --rpccorsdomain "*" console 2>console.log

I use this and it always works for me.

NOTE: network id is useless if you are using only one node, anyway there is no harm if you just leave it there. Do let me know if you face any other issue further.

Sahil Shah
  • 97
  • 1
  • 6
1

Install remixd sudo npm install -g @remix-project/remixd

Install ganache-cli yarn global add ganache-cli

Run remixd remixd -s /tmp/ --remix-ide https://remix.ethereum.org

Run ganache ganache-cli -f https://bsc-dataseed.binance.org/

Go to https://remix.ethereum.org/

Now head over to Remix. On this page, go to the plugins section by clicking on the icon that looks like a plug. Search the plugins for “remixd” and click “activate”.

En "Deploy & run transactions" Select Web3 provider

Andrey
  • 345
  • 2
  • 7
0

According to this link, sometimes the issues turns out to be the order of input parameters. localhost:8545 can be launched when geth is started like:

> geth --datadir ~/ethereum-private-network/chaindata --nodiscover --rpc
 --rpccorsdomain "*" --unlock 0 --mine 1
Urja Pawar
  • 1,087
  • 1
  • 15
  • 29
0
geth --nodiscover --networkid 2212 --unlock 0x9789c48ccf003c3a4687121087cbf83bedc5c604 --mine --rpc --rpcapi eth,net,web3,personal --rpcaddr "localhost" --rpcport 7545 --rpccorsdomain="*"

it works for me

halfelf
  • 9,737
  • 13
  • 54
  • 63
jerry
  • 1
0

Open network tab in Inspect tool, then on connect try see the result. On my case I saw this response

jsonrpc "2.0"
id  16057
error   
 code   -32601
 message    "the method net_listening does not exist/is not available"

thus you can see what exactly error happen and do not guess

Oleksandr IY
  • 2,783
  • 6
  • 32
  • 53
0

if you have even changed from https to http but still facing same issue then, make sure to disable add blocker if you are using any, just in case when using brave browser turn off the brave shields.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 15 '22 at 14:23
0
Error while connecting to the provider, provider not connected

if the message was right like above and you are running not in Chrome, that's the case

I've been pass the problem. hope it help!

Irwan
  • 104
  • 8