lightstreams-network / lightchain

Fast proof-of-authority blockchain based on go-ethereum and tendermint
https://lightstreams.network
GNU General Public License v3.0
55 stars 16 forks source link

Change IPC path #142

Open emizzle opened 5 years ago

emizzle commented 5 years ago

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?

ggarri commented 5 years ago

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.

emizzle commented 5 years ago

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.

ggarri commented 5 years ago

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
emizzle commented 5 years ago

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