Some commands did, but the ones in the assignment haven’t really changed much.
You can always use the help
command: bitcoin-cli help <COMMANDNAME>
Some commands did, but the ones in the assignment haven’t really changed much.
You can always use the help
command: bitcoin-cli help <COMMANDNAME>
feels a lot linux-like, which I like.
I use regnet for the test and both getnewaddress and getbalance worked perfecly.
I use command line ./bitcoin-cli -regtest dumpwallet mykeys and regtest create a file name mykeys and succesfully copy all my wallet private key in it.I didn’t know that it would create a file by itself. Just by curiosity the file is 512 KB is this normal?
3.I use ./bitcoin-cli -regtest dumpprivkey with the new address i generated and it give a different address (my private wallet key).
Hmmm, never checked its size tbh it should grow as you use the wallet and generates more addresses. At first you should have 100 keys inside, you can check by opening it with a text editor.
I had expected that “bitcoin-cli -help” itself would return a list and description of the commands. But I’ve seen no way to get this list out of bitcoin-cli. So it looks like we have to look after the commands and their description online.
I did so but don’t understand the content of the file yet. It cointains roughly 4000 lines. I had expected only a handful, maybe one per “getnewaddress” command I’ve made.
Probably I’ll understand better later in the course.
Worked fine. Here’s my private key on the mainnet:
(just joking)
1.)
Yes think the description fits.
2.)
./bitcoin-cli -regtest dumpwallet filename
This exports a human readable file. This includes the private masterkey, all private keys and public keys.
3.)
./bitcoin-cli -regtest dumpprivkey bcrt1…
This shows the private key of the requested address.
1.Yes description is what the commands do, and also it says on getbalance command that if the account is not specified it will show the servers total available balance.
dumpwallet -> ./bitcoin-cli -regtest dumpwallet “D:\test.txt” = exports all private keys into "test.txt
dumpprivkey-> ./bitcoin-cli -regtest dumpprivkey “address” -> shows the private key to this wallet address
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 for what the commands do?
Found them and they work as predicted.
2 Try to execute dumpwallet in order to store keys in a file.
./bitcoin-cli -regtest dumpwallet “location of the file”
3 Try to execute dumpprivkey on an address you generated with getnewaddress.
./bitcoin-cli -regtest dumpprivkey $(./bitcoin-cli -regtest getnewaddress)
getbalance:
If [account] is not specified, returns the server’s total available balance.
If [account] is specified, returns the balance in the account.
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 for what the commands do?
getnewaddress
If [account] is not specified, returns the server’s total available balance.
If [account] is specified, returns the balance in the account.
getbalance
Returns a new bitcoin address for receiving payments. If [account] is specified payments received with the address will be credited to [account].
Try to execute dumpwallet in order to store keys in a file.
Done
Try to execute dumpprivkey on an address you generated with getnewaddress.
Done
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 for what the commands do?
Yes we can find the commands in the list and they are doing exactly what their descriptions is describing/
Try to execute dumpwallet in order to store keys in a file.
bitcoin-cli -regtest dumpwallet test
Try to execute dumpprivkey on an address you generated with getnewaddress.
bitcoin-cli -regtest dumpprivkey [address]
The parameter for dumpwallet is the filename where you want to dump the wallet keys. You can use the help
command to get help with any command you want bitcoin-cli help dumpwallet
‘getbalance’ is interesting as it can be used to get the balance of a specific address instead of the server’s general/overall balance which is default. A minimum confirmation can also be specified.
‘getnewaddress’ can also have a specified account to which a new address can be attributed.
I could not store wallet in a file : PS C:\Program Files\Bitcoin\daemon> ./bitcoin-cli -regtest dumpwallet "test" error code: -8 error message: Cannot open wallet dump file
Tried ./bitcoin-cli help dumpwallet
but I was returned this message : Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
This command returns the private key from the freshly generated address (or any address that’s input)
yes, the description explains what the commands actually do
./bitcoin-cli -regtest dumpwallet “testfilename”
./bitcoin-cli -regtest dumpprivkey
You have to specify a path in the user folder, Program files doesn’t allow writing unless you open the console as an administrator.