2

I'm in a very frustrating situation. I used to run Bitcoin Core on Windows, without these problems, but ever since I switched to Linux (XFCE), and I of course have Bitcoin Core (GUI) starting automatically, I'm interrupted after like five minutes while typing/working by an indescribably annoying GUI box saying "Loading wallets...". That's in spite of running it with -min to start minimized and not bother me. But it does anyway.

This has become so annoying that I've been forced to remove Bitcoin Core from starting automatically. Instead, I will open it only when I actively need to do a Bitcoin transfer. But then a new problem arises: the blockchain will be many months outdated when I finally open it up, and then it has to sit around for a long time and sync the blockchain before I can do anything with it. Also, I can't use its RPC API if nothing is running.

So instead I'm now starting bitcoind at boot, so that it will run in the background without a GUI and keep the blockchain up to date.

But now, there's a new problem: if I start Bitcoin Core (GUI) while bitcoind is running in the background, I get an error saying that it can't obtain a lock of the blocks dir or something along those lines. Obviously, this is because bitcoind is already working on the block dir.

I can "solve" this by first running a script which calls the RPC API with the "stop" command, so that bitcoind shuts down safely (killing the process is not safe). Then I'm able to open Bitcoin Core (GUI) and start using it.

But, as you can imagine, this is anything but an ideal situation. I now have to both remember to not just start the Bitcoin Core (GUI) program when I need it, but also to first dig up and run that script to first shut down bitcoind. And then, after I'm done in Bitcoin Core (GUI), I need to shut it down and again start bitcoind to go back to the same state as before. It just makes my skin crawl.

Is there some hidden option I can send when opening Bitcoin Core (GUI) so that instead of trying to run its own stuff, it just "hooks into" the existing bitcoind?

0

4 Answers 4

3

There is no way to have them run at the same time. bitcoin-qt is an entirely separate binary that contains the entire contents of bitcoind in addition all of the GUI things. It cannot operate on an existing one since that is not how it communicates with the node part of the software.

However the issue that you are describing could be considered a bug and I would encourage you to open an issue in the GUI issue tracker so that someone more familiar with the GUI can take a look at it and possibly fix it.

2
  • The problem with that is that every single time I create a Github account, for many years now (since MS bought it), it has either been rejected or shadowbanned instantly. I'm unable to file any bugs or make any issue on any project at all. Doesn't matter how many different PAID proxies I try. None of them work.
    – V B
    Aug 13 at 19:43
  • 4
    I have created an issue for you: github.com/bitcoin-core/gui/issues/748
    – Andrew Chow
    Aug 13 at 19:50
1

I will open [the GUI] only when I actively need to do a Bitcoin transfer.

I would consider one of

1

As others have written, you cannot use bitcoin-qt and bitcoind with the same directory at the same time, because both require exclusive access.

While the situation certainly is imperfect, you could make a small tweak to make it more bearable. As you already do, run bitcoind at startup so that your blockchain will be synchronized at all times. Then make yourself a shell command alias that calls bitcoin-cli stop && sleep 120 && bitcoin-qt. When you want to make some payments, call your alias and go get a cup of coffee, touch the grass, or browse the internet for a couple minutes. When you get back, your Bitcoin wallet will have popped up.

Finally, add a cron job to your system that attempts to start bitcoind every 15 minutes. If it’s already running, it will simply error out with Error: Cannot obtain a lock on data directory /home/user/.bitcoin. Bitcoin Core is probably already running. Otherwise, your computer will automatically restart bitcoind a few minutes after you close bitcoin-qt.

This would turn the enervating process of “stopping one program, starting a second, using the second program, stopping the second program and restarting the first program” into one command to kick off starting the GUI, making your transfer, and then simply quitting the GUI when you’re done.

0

Is it possible to run Bitcoin Core (GUI) at the same time as bitcoind?

Nope. Both pieces of software will use a LOCK on databases (levelDB for example). So it will not be possible to run at the same time GUI / Daemon. You should know there would be plenty of bugs if this could be possible...

Like @RedGrittyBrick wrote, using bitcoin-cli can be a solution in order to communicate to your RPC. But a GUI one is easier. Sparrow is nice. However it is an advanced software which displays a lot of technical elements.

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.