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.
5 Answers
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
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
To avoid the Error
Invalid JSON RPC response: undefined error
in the Solidity browser just run geth with the option --rpccorsdomain *
-
@lalala @The Officious BokkyPooBah I have similar problem : link However, I receive this error in
Terminal
(Ubuntu). Thanks Jul 4, 2018 at 8:16
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
-
-
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 -
1It seems that I cannot connect, because I use https not http. Thank you for your help:)– ToshiAug 6, 2016 at 7:07
When I used Parity, I had to do two things to get it to work with Remix:
- appending this command line argument:
--jsonrpc-cors="all"
- allowing unauthenticated scripts to be loaded as per the photo below
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).