13

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

17

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

  • 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? – lalala Feb 19 '16 at 7:35
  • Did you run Geth yet? It needs to be run in order to create the folders. – Maran Feb 19 '16 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. – lalala Feb 19 '16 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? – lalala Feb 19 '16 at 8:23
  • Please start Geth and keep it running. The file should be there. – Maran Feb 19 '16 at 8:44
7

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.

  • geth attach ipc:path/to/geth.ipc Not sure if --ipcpath flag still works – FugueWeb Jun 18 '17 at 5:10
  • 1
    geth attach <path of ipc> – Ketan Parmar Jan 22 '18 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? – tem Apr 13 '18 at 3:48
  • 1
    @tymac I can confirm that this is consistent with what I've observed on my mac. – Doug Apr 16 '18 at 22:12

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.