bitcoin-cli could not locate RPC credentials

0

I'm running a bitcoind 0.16 and it seem working, blockchain in sync etc.. I've used the "new" rpcauth, which is non deprecated so kind of referennce as explained here: https://github.com/bitcoin/bitcoin/blob/v0.16.0/contrib/debian/examples/bitcoin.conf. I've generated the rpcauth line and the password with ./share/rpcauth/rpcauth.py bob

Copied the rpc line in the ~/.bitcoin/bitcoin.conf file and stored the password elsewhere. The conf file have this [rpc] section:

server=1
rest=1
rpcauth=bob:b2dd077cb54591a2f3139e69a897ac$4e71f08d48b4347cf8eff3815c0e25ae2e9a4340474079f55705f40574f4ec99

I run

./src/bitcoin-cli get blockchaininfo -rpcuser={...} -rpcpassword={...}

The answer is:

error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set.  See -rpcpassword and -stdinrpcpass.  Configuration file: (/home/bitcoin/.bitcoin/bitcoin.conf)

It's like the cli can't read the rpc credentials from the command line. It's not saying "credentials are wrong". Also the conf file is the correct one so...

Any clue?

Daniele Dellafiore

Posted 2018-04-18T07:03:28.923

Reputation: 103

Answers

2

You are using bitcoin-cli incorrectly.

The command line arguments come before the RPC command. Anything that comes after the RPC command will be interpreted as arguments for the RPC, not arguments to bitcoin-cli

So what you should actually be doing is

src/bitcoin-cli -rpcuser={...} -rpcpassword={...} getblockchaininfo

Andrew Chow

Posted 2018-04-18T07:03:28.923

Reputation: 40 910

Rather: src/bitcoin-cli -rpcuser={...} -rpcpassword={...} getblockchaininfoThorkil Værge 2019-05-11T16:13:10.253

0

Try to use the old authentication way which i always been using and has no issue

#rpcuser=USER
#rpcpassword=PASS

zhiyan114

Posted 2018-04-18T07:03:28.923

Reputation: 528