0

I am runing the mist wallet app.

In Terminal (macos), I also want to start a miner process geth --etherbase 1 --mine --port 0

But geth --mine failed with this error message:

Fatal: Error starting protocol stack: datadir already used by another process

Is there anyway I can have both programs to run concurrently?

1
  • I dont think that is possible, because both process would want to modify the blocks at the same time, may be you can try with separate datadir, not sure though.
    – niksmac
    Dec 2, 2017 at 7:16

2 Answers 2

1

This is possible:

1) Start geth in Terminal first:

> geth --mine

2) Launch Mist, but also from Terminal so you can pass commands to make it connect to the IPC created by geth. On my computer, it looks something like this:

> /Applications/Mist.app/Contents/MacOS/Mist --rpc ~/Library/Ethereum/geth.ipc

Note: you need to change the paths above to correspond with where those files are on your computer and where you're calling them from, as well as the network.

The geth.ipc file is only created/shows up after you have started geth.


For example, another example of this with testnet is:

Terminal 1

> geth --testnet --mine

Terminal 2 (from home folder)

> cd /Applications
> Mist.app/Contents/MacOS/Mist --rpc ~/Library/Ethereum/testnet/geth.ipc
0

Just run command $ps aux | grep "geth" Then you will see some progress about geth. and you can kill them by command #kill -s 9 "PID number".Then restart the geth.

1
  • 1
    Don't kill Geth with kill -9. It sends a SIGKILL, which could result in a corrupt database. Use either a SIGTERM or SIGINT signal which can be handled gracefully. Jun 6, 2018 at 6:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.