ruimarinho / docker-bitcoin-core

A bitcoin-core docker image
https://hub.docker.com/r/ruimarinho/bitcoin-core/
MIT License
367 stars 213 forks source link

Exposing ports example fails with 401 #129

Closed galderz closed 2 years ago

galderz commented 2 years ago

I'm trying to run bitcoind exposing the ports as explained in the README here, but when I do the curl I'm getting 401:

docker run --rm -it -p 18443:18443 -p 18444:18444 ruimarinho/bitcoin-core -printtoconsole -regtest=1 -rpcallowip=172.17.0.0/16 -rpcbind=0.0.0.0 '-rpcauth=foo:7d9ba5ae63c3d4dc30583ff4fe65a67e$9e3634e81c11659e3de036d0bf88f89cd169c1039e6e09607562d54765c649cc'
...
curl -v --data-binary '{"jsonrpc":"1.0","id":"1","method":"getnetworkinfo","params":[]}' http://foo:qDDZdeQ5vw9XXFeVnXT4PZ--tGN2xNjjR4nrtyszZx0=@127.0.0.1:18443
*   Trying 127.0.0.1:18443...
* Connected to 127.0.0.1 (127.0.0.1) port 18443 (#0)
* Server auth using Basic with user 'foo'
> POST / HTTP/1.1
> Host: 127.0.0.1:18443
> Authorization: Basic Zm9vOnFERFpkZVE1dnc5WFhGZVZuWFQ0UFotLXRHTjJ4TmpqUjRucnR5c3paeDA9
> User-Agent: curl/7.79.1
> Accept: */*
> Content-Length: 64
> Content-Type: application/x-www-form-urlencoded
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 401 Unauthorized
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="jsonrpc"
< Date: Wed, 29 Jun 2022 15:09:38 GMT
< Content-Length: 0
< Content-Type: text/html; charset=ISO-8859-1
<
* Connection #0 to host 127.0.0.1 left intact

Any idea what could be wrong? Does the README need updating?

galderz commented 2 years ago

My bad, I still had a bitcoind node running from a couple of weeks ago when I went on holiday lol