17

I'd like to access geth.ipc file in order to connect geth via IPC. I've got an advice and it suggested me to access geth.ipc, but I've not found it on my mac. Could you tell me when that file is produced? Btw, I installed go-ethereum by git as follows.

git clone https://github.com/ethereum/go-ethereum

The image shows my Ethereum directory. Doesn't it contain geth.ipc right? enter image description here

3 Answers 3

21

The IPC file is only present when Geth is actually running. So be sure to start Geth and you should see a message like.

I0219 09:45:48.128503 node/node.go:290] IPC endpoint opened: /Users/username/Library/Ethereum/geth.ipc

The location displayed here depends on your operating system. These are the other options.

macOS

~/Library/Ethereum/

Linux

~/.ethereum/

Windows

~/AppData/Roaming/Ethereum

6
  • Thx Maran. But, I cannot find it on ~/Library/Ethereum. Could you tell me when the dierectory(~/Library/Ethereum) was installed? When I did git clone https://github.com/ethereum/go-ethereum?
    – Toshi
    Commented Feb 19, 2016 at 7:35
  • Did you run Geth yet? It needs to be run in order to create the folders.
    – Maran
    Commented Feb 19, 2016 at 8:07
  • I did. It seems that, because I didn't update ethereum, the geth.ipc didn't exist on my mac. Now, I'm running brew upgrade.
    – Toshi
    Commented Feb 19, 2016 at 8:13
  • I've updated question.I've checked Ethereum directory after brew update && brew upgrade and brew update && brew reinstall ethereum . However, it contains geth.ipc. Should I reinstall Ethereum?
    – Toshi
    Commented Feb 19, 2016 at 8:23
  • Please start Geth and keep it running. The file should be there.
    – Maran
    Commented Feb 19, 2016 at 8:44
10

IPC is short for inter-process communication and is no standard file in your installation or environment but rather a domain socket.

After you installed geth the ipc socket is not automatically created and its also not considerable a permanent resource.

The geth.ipc socket only exists as long as geth is running. You can specify the ipc path with the --ipcpath "/path/to/my/geth.ipc" flag. You can control the available apis with the --ipcapi flag. You can disable IPC with --ipcdisable. From geth --help:

--ipcdisable                            Disable the IPC-RPC server
--ipcapi "admin,eth,debug,miner,net,shh,txpool,personal,web3"   API's offered over the IPC-RPC interface
--ipcpath "geth.ipc"                        Filename for IPC socket/pipe within the datadir (explicit paths escape it)

Read more on the go-ethereum wiki on management apis.

5
  • geth attach ipc:path/to/geth.ipc Not sure if --ipcpath flag still works
    – FugueWeb
    Commented Jun 18, 2017 at 5:10
  • 1
    geth attach <path of ipc> Commented Jan 22, 2018 at 6:02
  • It looks like this is the actual correct answer. This file is not a permanent file but a socket and does not exist as a file. At least not on a macOS file system. I have looked everywhere in my system including invisible files and it does not exist. I am currently running geth. Can anyone confirm that this file actually does not reside on the filesystem?
    – Edison
    Commented Apr 13, 2018 at 3:48
  • 1
    @tymac I can confirm that this is consistent with what I've observed on my mac.
    – Doug
    Commented Apr 16, 2018 at 22:12
  • @FugueWeb geth attach connects to a remote geth instance. I have no .ipc file since geth somehow refuses to create it... I need it to create this rendezvous/socket file. And geth attach gives simply this (path is not important as I have no other geth instance): Fatal: Unable to attach to remote geth: dial unix path/to/geth.ipc: connect: no such file or directory Commented Feb 27, 2021 at 5:56
0

For window10,

the path is in format \.\pipe\xxxxx.ipc

If you have this in your config.toml

[Node]
IPCPath = "geth.ipc"

you could do

geth_windows.exe attach \\.\pipe\geth.ipc

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.