2

I have changed the configuration directory for bitcoind.

However when I make a bitcion-cli request:

bitcoin-cli getblockcount

I get an error about RPC credentials using ~/.bitcoin/bitcoin/conf

So for me to actually run the command with the correct config and authnetication cookie I have to specify the configuration directory explicitly every time. Is there a way to make it implicit?

bitcoin-cli -conf=/media/btc/bitcoin/bitcoin.conf getblockcount
581510
tread
  • 176
  • 10

1 Answers1

4

In this case I would create an alias?

$ alias BCLI="bitcoin-cli -conf=/media/btc/bitcoin/bitcoin.conf"
$ BCLI getblockcount

On Windows you may use doskey.

MCCCS
  • 10,206
  • 5
  • 27
  • 56
  • 2
    It's also common practice to use the same name when using alias for setting default options: alias bitcoin-cli="bitcoin-cli -conf.... If one ever wants to call the non-alias command, it's just a matter of prefixing the command name with a backslash to prevent alias expansion: $ \bitcoin-cli ... – JoL Jan 04 '21 at 18:02