12

I'd like to connect private geth node from browser-solidity, however it returned the error Invalid JSON RPC response: "". Please check the following picture for details.

Could you tell me how to solve the problem? enter image description here

0

5 Answers 5

6

I got the same error. My problem is that in Chrome browser HTTPS Everywhere was turned on, which turns

http://ethereum.github.io/browser-solidity/#version=soljson-v0.4.7+commit.822622cf.js 

into

https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.7+commit.822622cf.js. 

Turning off HTTPS Everywhere fixed the issue.

1
5

I've found the reason. It seems that because I use https, it cannot connect my local node. When I try by http, I can connect.

If this page is served via https and you access your node via http, it might not work. In this case, try cloning the repository and serving it via http
4

To avoid the Error

Invalid JSON RPC response: undefined error 

in the Solidity browser just run geth with the option --rpccorsdomain *

1
  • @lalala @The Officious BokkyPooBah I have similar problem : link However, I receive this error in Terminal (Ubuntu). Thanks
    – Questioner
    Jul 4, 2018 at 8:16
3

Related question from OP: Cannot access geth by JSON-RPC. It returns {"jsonrpc":"2.0","error":{"code":-32600,"message":"EOF"}} .

The following worked for me.

user@Kumquat:~$ cd /tmp
user@Kumquat:/tmp$ geth --dev --datadir mydir account new
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase: 
Repeat passphrase: 
Address: {7f059ae83a49c1478245b2277b06d44acd2ab664}
user@Kumquat:/tmp$ geth --dev --datadir mydir --rpc --rpcaddr "localhost" --rpcport "8545" --rpccorsdomain "*" --mine --minerthreads 1 --unlock 0 console
...
Unlocking account 0 | Attempt 1/3
Passphrase: 
// ENTER PASSWORD ABOVE

And in Browser-Solidity: enter image description here

3
  • Thx, but it can't solve the problem yet.
    – Toshi
    Aug 6, 2016 at 7:05
  • What browser are you using? Turn on the developer console and watch the messages when the error occurs. What do you see? And can you post the exact command line you are using for starting your geth instance. Aug 6, 2016 at 7:05
  • 1
    It seems that I cannot connect, because I use https not http. Thank you for your help:)
    – Toshi
    Aug 6, 2016 at 7:07
0

When I used Parity, I had to do two things to get it to work with Remix:

  1. appending this command line argument: --jsonrpc-cors="all"
  2. allowing unauthenticated scripts to be loaded as per the photo below

enter image description here

Note: The above settings are somewhat open/insecure, so please consider using them only for deploying to a testnet, or for toy examples.

It would perhaps be safest to host and run your own Remix instance locally (taking all the necessary precautions in acquiring the code, etc).

Your Answer

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

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