Great answer man!
I also had this issue at first. I ended up switching to the Bitcoin Core version the course was recorded with.
I got this now.
Great answer man!
I also had this issue at first. I ended up switching to the Bitcoin Core version the course was recorded with.
I got this now.
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:Returns a new bitcoin address for receiving payments.
getbalance- returns the server’s total available balance.
Try to execute dumpwallet in order to store keys in a file.
using regtest
./bitcoin-cli -regtest dumpwallet “filename”
Try to execute dumpprivkey on an address you generated with **getnewaddress.
using regtest
./bitcoin-cli -regtest dumpprivkey “walletaddress”
The getnewddress command returns a new payment address and getbalance returns the corresponding balance.
Try to execute dumpwallet in order to store keys in a file.
After several attempt with always error code: -8 I finally get the result
./bitcoin-cli -regtest dumpwallet “C:\User\Amiri\dumpwallet\Documents”
error code: -8
error message:
C:\User\Amiri\Documents already exists. If you are sure this is what you want, move it out of the way first
…so then I tried it again…
./bitcoin-cli -regtest dumpwallet “C:\User\Amiri\dumpwallet”
<
“filename”: “C:\User\Amiri\dumpwallet”
./bitcoin-cli -regtest dumpwallet "test"
you can open the file with notepad i found./bitcoin-cli -regtest dumpprivkey "<address>"
The commands found getnewaddress and getbalance are in the list. The description fits the execution for what the commands do, but with an adding that when you specify a certain account within your wallet, it returns the data for that wallet. Otherwise the return includes your whole wallet (containing N addresses/accounts)…
Try to execute dumpwallet in order to store keys in a file.
In PS execute ./bitcoin-cli -regtest dumpwallet “complete_path_of_your_file”
Try to execute dumpprivkey on an address you generated with getnewaddress.
In PS execute ./bitcoin-cli -regtest dumpprivkey 2NE1qBMCbBzKeDqjUe19GSeZfmhYqBci6p5
1.Returns a new bitcoin address for receiving payments. If [account] is specified payments received with the address will be credited to [account].If [account] is not specified, returns the server’s total available balance.
If [account] is specified, returns the balance in the account.
2. i was able to execute dumpwallet successfully.
3.i generated a new address and was successfull in dumping the private key
For getnewaddress, it returns a new bitcoin address for receiving payments. If [account] is specified payments received with the address will be credited to [account].
For getbalance, there’s a parameter name minconf=1. what does mincof mean? from the name it suggest that it’s some kind of configuration??
For getbalance, if account number is provided it’ll return the balance of that account, otherwise it’ll return the server’s total available balance.
dumpwallet, it exports all wallet private keys to file
dumpprivkey reveals the private key of a particular address
Its the minimal number of confirmations required for the tx to be summed up in getbalance,
so what will happen if I set it to 0? and is there a upper limit to this number, practical and theoretical wise?
It would include txs in the mempool
what do you mean by this?
so if I use 0 instead of 1 in mincof, it’ll include txs in mempool??
It will include unconfirmed txs in the addresses total balance
A//
getnewaddress: Returns a new bitcoin address for receiving payments.
getbalance: Returns the balance in the account
Returns the servers total available balance
A// PS C:\Program Files\Bitcoin\daemon> ./bitcoin-cli -regtest getnewaddress
bcrt1qgjrrfvlj9c2dvex7gu37q0kdcshswpxq2jk7t8
PS C:\Program Files\Bitcoin\daemon> ./bitcoin-cli -regtest dumpprivkey “bcrt1qgjrrfvlj9c2dvex7gu37q0kdcshswpxq2jk7t8”
cPE57hyQZBBPzjiv55ypdsorqxk1DEzM3dKZ6QbyTivU5CmJFQpo
PS C:\Program Files\Bitcoin\daemon>
Hi All
I am using bitcoin core version 23
https://developer.bitcoin.org/reference/rpc/getnewaddress.html
https://developer.bitcoin.org/reference/rpc/getbalance.html
For instance the new getnewaddress has a parameter to choose between legacy and bech32 address formats.
I first created a wallet with default options
>./bitcoin-cli -regtest createwallet "mywallet"
when using dumpwallet i had the following error:
error code: -4
error message:
This type of wallet does not support this command
I created a new wallet with the following options:
>./bitcoin-cli -regtest createwallet 'beerkitty' false false "" false false true
descriptors: false
Now dumping from the new wallet works:
./bitcoin-cli -regtest -rpcwallet="beerkitty" dumpwallet "/home/parallels/Documents/dump3.txt"
{
"filename": "/home/parallels/Documents/dump3.txt"
}
>./bitcoin-cli -regtest getnewaddress
bcrt1qtywjm6j4p9670curwe520e003upqkuzxmxgaxy
>./bitcoin-cli -regtest dumpprivkey bcrt1qtywjm6j4p9670curwe520e003upqkuzxmxgaxy
cMpRkNbw78vduxbgkiDimVUUBZof9b8ha1SjvoaNEBEW1A3G4yxG
getnewaddress :
Returns a new bitcoin address for receiving payments. If [account] is specified payments received with the address will be credited to [account].
getbalance:
If [account] is not specified, returns the server’s total available balance.
If [account] is specified, returns the balance in the account.
error
.\bitcoin-cli.exe -regtest dumpprivkey bcrt1qxy4avrzzgll4pk4rzwkvz0nzsy65yzhkwxlytp /// Revealed cN9L8mU2Jnu4DqWw7M68Wu53z2mJnv6goxwTYzEotzegvQg6SFB5