I'm running parity with the --jsonrpc flag which listens on port 8545 by default.

I'm trying to attach a geth instance, like described in the the docs:

Attach a console to a running geth instance. By default this happens over IPC on the default IPC endpoint but when necessary a custom endpoint could be specified:

geth attach                   # connect over IPC on default endpoint
geth attach ipc:/some/path    # connect over IPC on custom endpoint
geth attach http://host:8545  # connect over HTTP
geth attach ws://host:8546    # connect over websocket

But I get a fatal error:

Fatal: Unable to attach to geth node - Invalid endpoint

This is my tested commands:

 ~ $ geth attach
Fatal: Unable to attach to geth node - Invalid endpoint
 ~ $ geth attach http://localhost:8545
Fatal: Unable to attach to geth node - Invalid endpoint
 ~ $ geth attach ws://localhost:8545
Fatal: Unable to attach to geth node - Invalid endpoint

How to attach geth to a local RPC on port 8545?

3 Answers 3


#Via Geth:

When you run your Parity node, use the --geth flag, for example, parity --geth.

Then go into another window and run geth attach.

The output of this is:

Welcome to the Geth JavaScript console!

The great thing about Parity is that you don't need to worry about turning on JSON-RPC, as it's on by default.

#Via Node:

Another approach is to use the NodeJS web3 library, which provides the same functionality. From Parity Quick Start:

npm install web3
node # Enter REPL
Web3 = require("web3");
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

Now you can interact with Parity the same as the Javascript Console:

web3.eth.getBlockNumber().then(blockNumber => console.log(blockNumber)) // Regular Geth command, except connected to Parity
  • Nice, --geth did the trick.
    – q9f
    Jul 3, 2016 at 11:39
  • for web3 1.0.0 : web3.eth.isSyncing().then(console.log)
    – Karan
    Dec 2, 2018 at 12:02
  • most web3 command returns promises : so print callback res
    – Karan
    Dec 2, 2018 at 12:03

Recently released version 1.1 of Parity supports modules/rpc_modules RPC method and allows you to geth attach <rpcaddress> (geth 1.3.6 and 1.4.0 are supported).

Release details: https://blog.ethcore.io/announcing-parity-1-1/


Geth 1.3.6

$ geth attach rpc://localhost

Geth 1.4.0

$ geth attach http://localhost:8545

  • Hum, Fatal: Unable to attach to geth node - dial unix /home/user/.ethereum/geth.ipc: connect: connection refused. Seems not ready yet.
    – q9f
    May 4, 2016 at 10:10
  • You need to specify HTTP rpc endpoint: geth attach rpc://localhost 1.3.6 or geth attach http://localhost:8545 1.4.0
    – todr
    May 4, 2016 at 11:11
  • Feel free to use the edit button to improve your answer.
    – q9f
    May 4, 2016 at 11:12


I don't think that you will be able to connect geth attach (version 1.3.6) to parity (version Parity/v1.0.2-beta/x86_64-linux-gnu/rustc1.7.0).


I tested using geth attach to connect to parity --rpc and I got the following message

Fatal: Unable to initialize console - Unable to parse module response - <nil>

So I did a trace using tcpdump and the results follow.

I started parity with the following options:

parity --datadir datadir --rpc --rpcapi "web3,eth,net,personal"  --rpccorsdomain "*"

I started tcpdump using the following command (meaning dump data in ASCII format on the interface lo ( and port 8545):

sudo tcpdump -A -i lo port 8545

I started geth using the following command:

geth attach rpc:

And here are the results from tcpdump (tidied):

IP localhost.38186 > localhost.8545
User-Agent: Go-http-client/1.1
Content-Length: 57
Content-Type: application/json
Accept-Encoding: gzip


localhost.8545 > localhost.38186
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Tue, 26 Apr 2016 09:51:20 GMT
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Access-Control-Allow-Headers: origin, content-type, accept

{"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not found","data":null},"id":1}

geth is asking parity for the support modules, but parity does not understand the "modules" command, so geth gives up.

I've tried using a few different options, but the results are similar.

I traced through the source code for geth and found that cmd/geth/js.go has a welcome() method that will request from the connected RPC instance what modules are supported. This is what you would normally see when you connect geth attach to geth --rpc:

    modules: db:1.0 eth:1.0 net:1.0 web3:1.0

But parity does not seem to support this JSON-RPC method.

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.