[ad_1]
Please explain to me what should be the procedure for working with a bitcoin-cli / RPC wallet.
For example:
- Create a wallet
- Get a new address
- Sending BTC: creating a transaction, signing a transaction, sending a transaction or some else?
Creating a wallet
——————–
Everything is more or less clear here, we use:
curl --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "createwallet", "params": {"wallet_name":"WalletName", "avoid_reuse":true , "descriptors":true, "load_on_startup":true}}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
or
bitcoin-cli -named createwallet wallet_name=descriptors avoid_reuse=true descriptors=true load_on_startup=true
Getting a new address
————————
Here we use getnewaddress, and the questions begin: if we use deriveaddresses, then we get several addresses. What do these addresses refer to, how many of them can I receive?
From the documentation:
Arguments:
1. descriptor (string, required) The descriptor.
2. range (numeric or array, optional) If a ranged descriptor is used, this specifies the end or the range (in [begin,end] notation) to derive.
What is end equal to? How can I find out?
Sending BTC
————–
There are several ways:
I received the transaction Id, what should I do after that? Use createrawtransaction, then signrawtransactionwithwallet, and then sendrawtransaction? Or something else?
Thank you.
[ad_2]
Source link