Bitcoind and bitcoin-cli Assignment

#1

Welcome to this assignment. Try to complete the tasks below. Feel free to discuss and ask questions in this thread.

  1. We have already used some commands in previous lectures, let’s find them in the list and verify how they are described. Can you find getnewaddress and getbalance in the list? Does the description fir what the commands do?
  2. Try to execute dumpwallet in order to store keys in a file.
  3. Try to execute dumpprivkey on an address you generated with getnewaddress.
1 Like

#2
  1. We have already used some commands in previous lectures, let’s find them in the list and verify how they are described. Can you find getnewaddress and getbalance in the list? Does the description fir what the commands do?

    The description confirms what the commands do but also specify extra parameters to use with the commands.

    also with the following line you can get info about any command:
    ./bitcoin-cli -regtest help <command>
    for ex: ./bitcoin-cli -regtest help getbalance

  2. Try to execute dumpwallet in order to store keys in a file.
    ./bitcoin-cli -regtest dumpwallet "<path and filename>"

  3. Try to execute dumpprivkey on an address you generated with getnewaddress.
    ./bitcoin-cli -regtest dumpprivkey <address>

1 Like

#3

1. We have already used some commands in previous lectures, let’s find them in the list and verify how they are described. Can you find getnewaddress and getbalance in the list? Does the description fit what the commands do?

They’re listed alphabetically and the description does match the action.

2. Try to execute dumpwallet in order to store keys in a file.
./bitcoin-cli -regtest dumpwallet “mykeys”

3. Try to execute dumpprivkey on an address you generated with getnewaddress.
./bitcoin-cli -regtest dumpprivkey [address]

@Capaburro listed a help feature which is very… well… helpful. Thanks

Even though the dumpwallet command was executed and even when run a second time provides information that the file exists and cannot be overwritten, I cannot find the actual file in the /daemon directory… strange. Any suggestion??

0 Likes

#4
  1. Yes they’re on the list with extra description about using an optional [account] parameter.

  2. > .\bitcoin-cli.exe -regtest dumpwallet "test_dumped_keys" The dumped file test_dumped_keys has a long list of the keys, around 2000 in fact, probably pre-generated by the -regtest mode.

  3. The private key is successfully printed to the console

> .\bitcoin-cli.exe -regtest getnewaddress
2N7CmzJhfLkD3bejEkZZgLqNGZv9PJGuXLm
> .\bitcoin-cli.exe -regtest dumpprivkey 2N7CmzJhfLkD3bejEkZZgLqNGZv9PJGuXLm
cMb7PBygXHH1zZ...
0 Likes