2

I've created a docker container of an ubuntu machine, loaded it up with all the dependencies specified in the unix build doc and then built bitcoin and run it with the following command:

./src/bitcoind

after that there's no output or evidence that anything is happening, the terminal is just hanging there, clearly something is going on- but I don't know/can't see what it is.

how can I examine the activity? For instance, see the coins that are being generated in my wallet, etc.

I've tried this proposed solution, i.e. to write

bitcoind getinfo

but I got the error

Error: There is no RPC client functionality in bitcoind anymore. Use the bitcoin-cli utility instead.

Regarding -regtest

I tried with:

./src/bitcoin-cli -regtest &

and I got the error:

too few parameters (need at least command)
smatthewenglish
  • 1,133
  • 10
  • 23

1 Answers1

5

the terminal is just hanging there

Yes, if you want it to run in the background, you need to run with the -daemon flag.

how can I examine the activity?

You can look at the debug.log file (in the datadir), or you can run with the -printtoconsole flag. You can increase the verbosity using the -debug flag (or specify a specific category, for example -debug=mempool; to see the various debug categories and more, use -help).

For instance, see the coins that are being generated in my wallet, etc.

The built-in miner was removed in Bitcoin Core v0.13.0, as it was not even useful for testing purposes anymore. If you want coins, you'll need to either buy them, get someone to send you some, or run a mining setup (which at the time of writing almost certainly requires custom ASIC hardware).

I've tried this proposed solution, i.e. to write

bitcoind getinfo

You need to use bitcoin-cli now to communicate with bitcoind (since a few years ago...). The getinfo command still works but is deprecated. More specific information can be obtained using the RPC calls:

  • getblockchaininfo
  • getpeerinfo
  • getnetworkinfo
  • getwalletinfo
  • gettxoutsetinfo
  • getaddednodeinfo
  • getmempoolinfo
Pieter Wuille
  • 105,497
  • 9
  • 194
  • 308
  • I think I sort of got what I was looking for with this one ./src/bitcoin-cli getinfo, but actually I don't want to connect to the real bitcoin network, I want to start over from scratch, create my own personal testnet, do you know how to do this? – smatthewenglish Apr 18 '17 at 13:40
  • so then does that mean that I can't use bitcoin core for creating a testnet, since it can't mine? – smatthewenglish Apr 18 '17 at 13:44
  • how to get around this error 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 18 '17 at 13:47
  • That means bitcoind is not running (or perhaps you're running it with -testnet or -regtest but not passing that same argument to bitcoin-cli?). – Pieter Wuille Apr 18 '17 at 13:48
  • And you can always run external mining software (like bfgminer) to construct blocks; it's much faster than any code we're able to maintain in Core. If it's just for a local testnet (-regtest mode), you can use the built-in generate RPC still (but only for chains where the difficulty is trivially low). – Pieter Wuille Apr 18 '17 at 13:56
  • ah, ok. thank you for these insights. do you know what steps I would need to take to generate a fresh testnet from scratch? what I'd like to do eventually is have my own version of a real fork that I can make changes to- but I guess I might start by just creating my own version of bitcoin on a small network with some of my own machines – smatthewenglish Apr 18 '17 at 14:17
  • 2
    I would suggest to start in -regtest mode. You'll get an empty chain with only a genesis block, and no default connections anywhere. You can then use -connect to add nodes to your network and experiment. If you're further ahead, modify chainparams.cpp to add a definition for your own network and logic to select it. – Pieter Wuille Apr 18 '17 at 14:21
  • do you know what I should do to chainparams.cpp to define my own network? – smatthewenglish Apr 18 '17 at 16:11
  • That's far too much to explain in comments of an answer here. I suggest you study the source code and experiment with regtest first. – Pieter Wuille Apr 18 '17 at 16:17
  • I've tried to start with 'regtest' and I got again that rpc error, and something about not enough arguments, do you know some resource I could look at about this? – smatthewenglish Apr 19 '17 at 11:37
  • https://bitcoin.org/en/developer-examples#regtest-mode – Pieter Wuille Apr 19 '17 at 11:38
  • I read that and tried those examples but it's what generated that not enough arguments error- also sometimes it refers to 'bitcoind' and sometimes 'cli', what about this one: https://bitcoin.stackexchange.com/questions/28107/bitcoin-is-not-connected-in-regtest-mode – smatthewenglish Apr 19 '17 at 11:40
  • Can you open a new question with the exact commands you're running and error messages you get? – Pieter Wuille Apr 19 '17 at 11:43
  • yes, sure I'll do that – smatthewenglish Apr 19 '17 at 11:44
  • https://bitcoin.stackexchange.com/questions/52857/trouble-with-bitcoin-cli-regtest – smatthewenglish Apr 19 '17 at 11:48