0

This is what happens after I run this command bitcoind --regtest --printtoconsole, my guess is that it's something to do with bitcoin.conf

enter image description here

My bitcoin.conf file looks like this:

server=1
rpcuser=root
rpcpassword=password
rpcconnect=127.0.0.1
rpcport=8332

If you need more context, these are my other questions: trouble with bitcoin cli regtest and interacting with bitcoin over docker

smatthewenglish
  • 1,133
  • 10
  • 23
  • I don't see anything wrong. – Pieter Wuille Apr 19 '17 at 15:33
  • but- I get this- `bitcoin-cli -regtest getinfo error: couldn't connect to server: unknown (code -1) (make sure server is running and you are connecting to the correct RPC port)` – smatthewenglish Apr 19 '17 at 15:33
  • Try removing the rpcconnect line. rpcconnect is an option to bitcoin-cli, not bitcoind. – Pieter Wuille Apr 19 '17 at 15:48
  • ah- I removed it but- same error :/ – smatthewenglish Apr 19 '17 at 15:49
  • In fact, you can delete your bitcoin.conf entirely. bitcoind will create its own password if you don't set one (cookie), and bitcoin-cli can find it. All the other options are default. So I suggest just delete bitcoin.conf, restart bitcoind, and then try again. – Pieter Wuille Apr 19 '17 at 15:52
  • when I delete it I get the error `bitcoin-cli -regtest getinfo` >> `error: Could not locate RPC credentials. No authentication cookie could be found, and no rpcpassword is set in the configuration file (/root/.bitcoin/bitcoin.conf)` – smatthewenglish Apr 19 '17 at 15:59
  • What version of bitcoind is running? It's in the first line of debug.log. – Pieter Wuille Apr 19 '17 at 16:20
  • Bitcoin version v0.14.99.0-c91ca0a – smatthewenglish Apr 20 '17 at 08:02
  • I think I need to do something like [described here](https://bitcoin.stackexchange.com/questions/28107/bitcoin-is-not-connected-in-regtest-mode), do you think it's right? – smatthewenglish Apr 20 '17 at 14:24
  • I don't understand what the problem is for you. But no, that link doesn't help. bitcoin-cli fails to connect to your bitcoind entirely. That answer is about needing multiple nodes in your network before you can have all functionality. – Pieter Wuille Apr 20 '17 at 14:26
  • I'm trying to run it on this docker image https://hub.docker.com/r/smatthewenglish/oakcoin/tags/ it's just an ubuntu image with the latest version of bitcoin cloned from github – smatthewenglish Apr 20 '17 at 19:44

1 Answers1

0

just do this...

To use bitcoind and bitcoin-cli, you will need to add a RPC password to your bitcoin.conf file. Both programs will read from the same file if both run on the same system as the same user, so any long random password will work:

  rpcpassword=change_this_to_a_long_random_password

in the future I'll be sure to RTFM

smatthewenglish
  • 1,133
  • 10
  • 23