1

This is a multi-part question.

I downloaded source code of bitcoin core from github and compiled it on my Windows 10. Then I got bitcoind and bitcoin-qt among other commands. I first run bitcoin-qt and choose a directory(D:\bitcoin) for blockchain data storing. However because I need to use bitcoin-cli tool and bitcoin-qt doesn't expose an RPC service by default, I close bitcoin-qt and start bitcoind.

But then I found that bitcoind didn't download blockchain from where bitcoin-qt stopped(by run bitcoin-cli -getinfo). How can I make bitcoind download that way? (I use bitcoind -datadir=D:\bitcoin to do that, is it right?)

Another question is where should I put my configure file. In my home directory(C:\Users\MyName) or just in the same data directory(D:\bitcoin)? Does bitcoind and bitcoin-qt use the same configure file?

  • Not sure about the details on windows, but best is to point both to the same config file and datadir. Just setting -datadir should accomplish that. But I think by default, they should both use the same already, so not sure why that would not already work. Unless maybe you're starting one as Administrator and the other not (or a different user altogether). If bitcoind is running as a service, check which user it's running as (in service properties). – Jannes Apr 7 at 12:32
1

bitcoin-qt and bitcoind are built from the same source code. They largely use the same settings, data directory, and configuration file.

However, bitcoin-qt has a set of options that are specific to it. These settings are stored in a separate Qt defined location (on Windows, it's stored in the registry). bitcoind cannot read these settings. If you set your data directory by choosing the location in the dialog box that appears the first time you started, the data directory location is stored in the Qt specific settings so bitcoind cannot read it.

You can set the data directory for bitcoind by creating a bitcoin.conf file in the default data directory location (on Windows, that's %APPDATA%/Bitcoin) and adding the line

datadir=<path>

where <path> is the path to where you want the data directory to be.

Or by adding -datadir=<path> to the command you are using to start bitcoind.

I use bitcoind -datadir=D:\bitcoin to do that, is it right?

Yes, that is correct.

In my home directory (C:\Users\MyName) or just in the same data directory (D:\bitcoin)?

You should put the config file in the data directory that the software will open initially. If you are setting -datadir in your startup command or the datadir is specified in your Qt settings, then you should put the config file in the data directory.

If not, you should put it in the default data directory location which is C:\Users\<username>\AppData\Roaming\Bitcoin.

Does bitcoind and bitcoin-qt use the same configure file?

Yes.

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.