lightchain icon indicating copy to clipboard operation
lightchain copied to clipboard

Change IPC path

Open emizzle opened this issue 6 years ago • 4 comments

System information

Lightchain version: Version: 1.1.0-beta MainNet (but running off fork https://github.com/0x13a/lightchain/tree/fix/upgrade-geth)
OS & version: OSX Mojave 10.14.4 / Kernel Version 18.5.0
Go version: go version go1.12.5 darwin/amd64
Branch: https://github.com/0x13a/lightchain/tree/fix/upgrade-geth
Commit hash: cb8e32e6209e8aaf302ac21d67cabe014b667b3e

Steps to reproduce the behaviour

  1. lightchain init --force --standalone
  2. lightchain run --rpc --rpcport=8555 --rpcaddr=localhost --rpcapi=eth,web3,net,debug,personal,shh --ws --wsport=8556 --wsaddr=localhost
INFO [05-16|11:43:22.533] IPC endpoint opened                      url=/Users/emizzle/.lightchain/database/geth.ipc
INFO [05-16|11:43:22.682] HTTP endpoint opened                     url=http://localhost:8555                        cors= vhosts=localhost
INFO [05-16|11:43:22.686] WebSocket endpoint opened                url=ws://127.0.0.1:8556

Is there any way we can set the IPC path?

emizzle avatar May 16 '19 02:05 emizzle

Hi @emizzle

As you could see from our lightchain documentation during the initialization of your node you could specify a different datadir using the argument --datadir=[CHOSEN_DIR], by default it is set to ${HOME}/.lightchain.

During the execution of your lightchain node, lightchain run, you can specify which data directory(datadir) is to use using the same argument --datadir . The IPC socket is always created under ${datadir}/database/geth.ipc and that cannot be modified.

In case that explanation does not fullfill your needs, would you mind to detail why you would require the IPC socket to be located on a path outside of the regular data directory one? Maybe we could help.

ggarri avatar May 16 '19 08:05 ggarri

We use an IPC path that is shared with an external application (Embark). When Embark spins up a geth node, we pass in the path to the IPC socket, ie --ipcpath=/var/folders/b3/v732nxrx2fn3vfmm_vwpm1v00000gn/T/embark-0d2878de/geth.ipc. So, while your suggestion makes sense, it doesn't make sense to restrict the IPC path to the --datadir, when it has no constraint for being there.

Ideally, ${datadir}/database/geth.ipc would be the default value, with the option to override the path using the --ipcpath CLI option.

emizzle avatar May 17 '19 03:05 emizzle

Thanks for the explanation. I moved to the project feature pool in order to prioritize its development.

I hope that is not a blocker for you, as an easy workaround, in the meantime, would be to create a symbolic link such as follow:

ln -nsf ${datadir}/database/geth.ipc /var/folders/b3/../T/embark-0d2878de/geth.ipc

ggarri avatar May 17 '19 06:05 ggarri

Thanks so much @ggarri, the workaround will work great for now! Looking forward to seeing this feature developed in.

emizzle avatar May 20 '19 13:05 emizzle