2
These are the commands I'm running after building a clean ubuntu docker image with all the dependencies:
./src/bitcoin-cli -regtest &
It yields the error:
error: too few parameters (need at least command)
Next I ran:
./src/bitcoin-cli -regtest -daemon
which resulted in:
error: too few parameters (need at least command)
finally:
./src/bitcoin-cli -regtest 101 &
yields:
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)
These commands have been taken from the following resource:
https://bitcoin.org/en/developer-examples#regtest-mode
There's a question here, and a corresponding answer that provides a script to start regtest, is that a good solution?
Next step
so I ran first:
bitcoind -regtest -daemon
and I got the output:
Bitcoin server starting
then I tried:
bitcoin-cli -regtest getinfo
which resulted in:
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)
these commands also generated the same output as above:
./src/bitcoin-cli -regtest help
./src/bitcoin-cli -regtest 101
so I've created the following file:
vim /root/.bitcoin/bitcoin.conf
it's literally just this:
rpcpassword=123
*also tried with this:
server=1
rpcuser=root
rpcpassword=password
rpcconnect=127.0.0.1
rpcport=8332
and now issued the command:
bitcoin-cli -regtest getinfo
which resulted in the following:
error: couldn't connect to server: unknown (code -1)
(make sure server is running and you are connecting to the correct RPC port)
you're exactly right that I was confused about
idandcli, In Next step in the OP I tried to follow your guidance but also I seem to have messed it up, or it otherwise didn't work, I tried to write exactly what I've done, do you see what I've done wrong? – smatthewenglish – 2017-04-19T12:31:33.753You can't change bitcoin.conf while bitcoind is running. Either no rpcuser/rpcpassport is set when bitcoind starts, and it'll use cookie authentication, or it is set, and both bitcoind and bitcoin-rpc will use it. – Pieter Wuille – 2017-04-19T13:05:20.357
aha- ok. also I started the network like this: https://bitcoin.stackexchange.com/questions/45881/how-to-setup-bitcoin-network-using-regtest which seemed to be better- but now it crashes because the size of my docker container is too small :/ need to figure out how to resize it
– smatthewenglish – 2017-04-19T13:09:07.947