3

I've tried to access geth by rpc.

$ geth --dev --datadir mydir --rpc --rpcaddr "localhost" --rpcport "8545" --rpccorsdomain "*" console

However it has returned the error. Could you tell me how to solve the problem?

{"jsonrpc":"2.0","error":{"code":-32600,"message":"EOF"}}

Update I've got connected by rpc, however on the browser-solidity I cannot connect my private node.

enter image description here

  • What is the JSON-RPC request you executed? – Bokky WeAreAllAssange PooBah Aug 6 '16 at 2:17
  • http://localhost:8545 – lalala Aug 6 '16 at 2:20
  • Is the answer correct? – lalala Aug 6 '16 at 2:21
4

I suspect it is the command you are using.

This works:

user@Kumquat:~$ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545
{"jsonrpc":"2.0","id":1,"result":{"currentBlock":"0x1eb260","highestBlock":"0x1eb478","knownStates":"0x0","pulledStates":"0x0","startingBlock":"0x1eaea3"}}

And this does not work:

user@Kumquat:~$ curl '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545
curl: (3) [globbing] nested brace in column 50
{"jsonrpc":"2.0","error":{"code":-32600,"message":"EOF"}}

Here are some simple commands you can test with:

user@Kumquat:~$ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_coinbase","params":[],"id":1}' http://localhost:8545
{"jsonrpc":"2.0","id":1,"result":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}

user@Kumquat:~$ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1}' http://localhost:8545
{"jsonrpc":"2.0","id":1,"result":"0x4a817c800"}
  • $ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545 {"jsonrpc":"2.0","id":1,"result":false} – lalala Aug 6 '16 at 2:25
  • Yup. Your command is working perfectly. Your private node is not syncing and so the result is false. – Bokky WeAreAllAssange PooBah Aug 6 '16 at 2:26
  • It seems doesn't work. I'll try debugging it. – lalala Aug 6 '16 at 2:27
  • 1
    $ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_coinbase","params":[],"id":1}' localhost:8545 {"jsonrpc":"2.0","id":1,"result":"0x86d13ef4629e9b855a8045cd8b2f67ba6a736ba6"} – lalala Aug 6 '16 at 3:42
  • 1
    I've questioned! Plz check it:) ethereum.stackexchange.com/questions/7796/… – lalala Aug 6 '16 at 4:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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