bitcoindevkit / bitcoin-regtest-box

Simple bitcoin regtest docker images for integration testing with github actions
11 stars 8 forks source link

Error: could not locate RPC credentials. No authentication cookie could be found #11

Open chris-pollard opened 3 years ago

chris-pollard commented 3 years ago

Hi there, I am a newb to bitcoindevkit and its also my first time using docker but I've come across a roadblock with the authentication cookie not being recognised when starting up regtest. I followed along with the blog post (https://bitcoindevkit.org/blog/2021/06/using-bdk-to-create-bip157-spv-wallet-aka-neutrino/) and managed to spin up docker container. But when I try to run the command "docker exec -it bdk-box /root/bitcoin-cli -regtest getnetworkinfo" it gives the following error:

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

Any suggestions? Thank you.

notmandatory commented 3 years ago

Looks like we need to update the blog post.. but for now you can work around this issue by adding the container bitcoind username (admin) and password (passw) like this:

docker exec -it bdk-box /root/bitcoin-cli -regtest -rpcuser=admin -rpcpassword=passw  getnetworkinfo

You'll need to add -rpcuser=admin -rpcpassword=passw to all the docker exec bitcoin-cli commands in the blog post.