2

On Elementary OS Loki 0.4.1 I've downloaded and installed bitcoind as per the official guide from bitcoin.org .

However, I in my case I don't have enough space on my internal SSD to store the whole blockchain, so I want to download it and maintain it on an external hooked up HDD.

When I run the bitcoind -daemon -datadir=path_to_external_hdd_folder the Bitcoin server starts up successfully and starts downloading the blockchain to that specified folder (In the logs I can see the height is growing and so is the size of the selected datadir which I passed in as an argument)

My problem is - when I try to run commands by running bitcoin-cli getblockchaininfo for example, I get the error:

error: Could not locate RPC credentials. No authentication cookie could be found, and no rpcpassword is set in the configuration file (/home/martin/.bitcoin/bitcoin.conf)

What's weird is that when I move the .cookie file from my external drive to /home/martin/.bitcoin/bitcoin.conf the commands start working.

This is a temporary solution though, I wouldn't like to move that file everytime I startup the bitcoin server.

Do I maybe need to pass in an extra argument to bitcoind -daemon?

I've tried passing -rpccookiefile=path_to_cookie_file_on_External_hdd to it but that didn't work.

Note: My bitcoin.conf file is empty.

UPDATE 1 I tried setting -conf when starting bitcoind but that didn't work either.

  • I have added an answer. Note that some of the parameters you have tried only accept a file input and will not accept a path. – Willtech Jan 28 '18 at 0:55
  • Previous user with same issue found a workaround for their scenario: bitcoin.stackexchange.com/questions/53194/… – Willtech Jan 28 '18 at 0:59
1

You need to pass the same -datadir option to bitcoin-cli as to bitcoind. This will enable it to find the cookie file, but also potential other relevant changes you could have made to bitcoin.conf like rpcport. (I know you haven't, but this approach is compatible with those).

0

Bitcoind is searching for the .cookie file in the configuration directory.

If you'd like to specify a path for the configuration that's not the default (i.e. In your hard drive), you can do so with the -conf=/path/to/bitcoin.conf

  • I still get the same result. I'm updating the question to note that my bitcoin.conf file is completely empty. – Martin K Jan 27 '18 at 21:20
0

If this is a bug (it sounds like it is!) please open an issue for Bitcoin Core on the official Bitcoin Core repository issue page.

Please specifically identify as much information in the issue you log as you have here in your question including:

Version and Source
v0.xx.x downloaded from/compiled from

Expected Operation
bitcoind should look in the -datadir= location for the RPC cookie.

What Happens
bitcoind looks in the default location for the RPC cookie and RPC expects bitcoin.conf will be in the default location when checking for credentials.

Everything should be expected in the -datadir= location.

Setting -rpccookiefile= to the correct path matching the specified -datadir= location does not work.

Steps to reproduce
Most of your question and any other details.

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.