first round of command updates

This commit is contained in:
Shannon Appelcline 2026-02-05 08:18:49 -10:00 committed by GitHub
parent d34cb1a0ff
commit 89b3ab60d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,16 +13,15 @@ bitcoin.conf signet
``` ```
The setup guides in [Chapter Two: Creating a Bitcoin-Core VPS](02_0_Setting_Up_a_Bitcoin-Core_VPS.md) laid out a standardized config file. [§3.1: Verifying Your Bitcoin Setup](03_1_Verifying_Your_Bitcoin_Setup.md) suggested how to change it to support more advanced setups. If you're interested in learning even more about the config file, you may wish to consult [Jameson Lopp's Bitcoin Core Config Generator](https://jlopp.github.io/bitcoin-core-config-generator/). The setup guides in [Chapter Two: Creating a Bitcoin-Core VPS](02_0_Setting_Up_a_Bitcoin-Core_VPS.md) laid out a standardized config file. [§3.1: Verifying Your Bitcoin Setup](03_1_Verifying_Your_Bitcoin_Setup.md) suggested how to change it to support more advanced setups. If you're interested in learning even more about the config file, you may wish to consult [Jameson Lopp's Bitcoin Core Config Generator](https://jlopp.github.io/bitcoin-core-config-generator/).
Moving back to your ~/.bitcoin directory, you'll find that the signet directory contains all of the guts: Moving back to your ~/.bitcoin directory, you'll find that the `signet` directory contains all of the guts:
``` ```
$ ls ~/.bitcoin/signet $ ls ~/.bitcoin/signet
banlist.json chainstate onion_v3_private_key wallets banlist.json blocks debug.log peers.dat wallets
bitcoind.pid debug.log peers.dat bitcoind.pid chainstate onion_v3_private_key settings.json
blocks fee_estimates.dat settings.json
``` ```
You shouldn't mess with most of these files and directories — particularly not the `blocks` and `chainstate` directories, which contain all of the blockchain data, and the information in your `wallets` directory, which contains your personal wallet. However, do take careful note of the `debug.log` file, which you should refer to if you ever have problems with your setup. You shouldn't mess with most of these files and directories — particularly not the `blocks` and `chainstate` directories, which contain all of the blockchain data, and the information in your `wallets` directory, which will contain your personal wallet (when we set it up). However, do take careful note of the `debug.log` file, which you should refer to if you ever have problems with your setup.
> :link: **SIGNET vs MAINNET:** If you're using mainnet, then _everything_ will instead be placed in the main `~/.bitcoin` directory. These various setups _do_ elegantly stack, so if you are using mainnet, signet, testnet, and regtest, you'll find that `~/.bitcoin` contains your config file and your mainnet data, the `~/.bitcoin/signet` directory contains your signet data, the `~/.bitcoin/testnet3` directory contains your testnet data, and the `~/.bitcoin/regtest` directory contains your regtest data. > :link: **SIGNET vs MAINNET:** If you're using mainnet, then _everything_ will instead be placed in the main `~/.bitcoin` directory. These various setups _do_ elegantly stack, so if you are using mainnet, signet, testnet, and regtest, you'll find that `~/.bitcoin` contains your config file and your mainnet data, the `~/.bitcoin/signet` directory contains your signet data, the `~/.bitcoin/testnet3` or `~/.bitcoin/testnet4` directory contains your testnet data, and the `~/.bitcoin/regtest` directory contains your regtest data.
## Know Your Bitcoin-cli Commands ## Know Your Bitcoin-cli Commands
@ -30,31 +29,43 @@ Most of your early work will be done with the `bitcoin-cli` command, which offer
``` ```
$ bitcoin-cli help $ bitcoin-cli help
== Blockchain == == Blockchain ==
dumptxoutset "path" ( "type" {"rollback":n,...} )
getbestblockhash getbestblockhash
getblock "blockhash" ( verbosity ) getblock "blockhash" ( verbosity )
getblockchaininfo getblockchaininfo
getblockcount getblockcount
getblockfilter "blockhash" ( "filtertype" ) getblockfilter "blockhash" ( "filtertype" )
getblockfrompeer "blockhash" peer_id
getblockhash height getblockhash height
getblockheader "blockhash" ( verbose ) getblockheader "blockhash" ( verbose )
getblockstats hash_or_height ( stats ) getblockstats hash_or_height ( stats )
getchainstates
getchaintips getchaintips
getchaintxstats ( nblocks "blockhash" ) getchaintxstats ( nblocks "blockhash" )
getdeploymentinfo ( "blockhash" )
getdescriptoractivity ["blockhash",...] [scanobjects,...] ( include_mempool )
getdifficulty getdifficulty
getmempoolancestors "txid" ( verbose ) getmempoolancestors "txid" ( verbose )
getmempooldescendants "txid" ( verbose ) getmempooldescendants "txid" ( verbose )
getmempoolentry "txid" getmempoolentry "txid"
getmempoolinfo getmempoolinfo
getrawmempool ( verbose ) getrawmempool ( verbose mempool_sequence )
gettxout "txid" n ( include_mempool ) gettxout "txid" n ( include_mempool )
gettxoutproof ["txid",...] ( "blockhash" ) gettxoutproof ["txid",...] ( "blockhash" )
gettxoutsetinfo gettxoutsetinfo ( "hash_type" hash_or_height use_index )
gettxspendingprevout [{"txid":"hex","vout":n},...]
importmempool "filepath" ( options )
loadtxoutset "path"
preciousblock "blockhash" preciousblock "blockhash"
pruneblockchain height pruneblockchain height
savemempool savemempool
scanblocks "action" ( [scanobjects,...] start_height stop_height "filtertype" options )
scantxoutset "action" ( [scanobjects,...] ) scantxoutset "action" ( [scanobjects,...] )
verifychain ( checklevel nblocks ) verifychain ( checklevel nblocks )
verifytxoutproof "proof" verifytxoutproof "proof"
waitforblock "blockhash" ( timeout )
waitforblockheight height ( timeout )
waitfornewblock ( timeout "current_tip" )
== Control == == Control ==
getmemoryinfo ( "mode" ) getmemoryinfo ( "mode" )
@ -64,27 +75,25 @@ logging ( ["include_category",...] ["exclude_category",...] )
stop stop
uptime uptime
== Generating ==
generatetoaddress nblocks "address" ( maxtries )
generatetodescriptor num_blocks "descriptor" ( maxtries )
== Mining == == Mining ==
getblocktemplate ( "template_request" ) getblocktemplate {"mode":"str","capabilities":["str",...],"rules":["segwit","str",...],"longpollid":"str","data":"hex"}
getmininginfo getmininginfo
getnetworkhashps ( nblocks height ) getnetworkhashps ( nblocks height )
getprioritisedtransactions
prioritisetransaction "txid" ( dummy ) fee_delta prioritisetransaction "txid" ( dummy ) fee_delta
submitblock "hexdata" ( "dummy" ) submitblock "hexdata" ( "dummy" )
submitheader "hexdata" submitheader "hexdata"
== Network == == Network ==
addnode "node" "command" addnode "node" "command" ( v2transport )
clearbanned clearbanned
disconnectnode ( "address" nodeid ) disconnectnode ( "address" nodeid )
getaddednodeinfo ( "node" ) getaddednodeinfo ( "node" )
getaddrmaninfo
getconnectioncount getconnectioncount
getnettotals getnettotals
getnetworkinfo getnetworkinfo
getnodeaddresses ( count ) getnodeaddresses ( count "network" )
getpeerinfo getpeerinfo
listbanned listbanned
ping ping
@ -96,25 +105,31 @@ analyzepsbt "psbt"
combinepsbt ["psbt",...] combinepsbt ["psbt",...]
combinerawtransaction ["hexstring",...] combinerawtransaction ["hexstring",...]
converttopsbt "hexstring" ( permitsigdata iswitness ) converttopsbt "hexstring" ( permitsigdata iswitness )
createpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime replaceable ) createpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount,...},{"data":"hex"},...] ( locktime replaceable version )
createrawtransaction [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime replaceable ) createrawtransaction [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount,...},{"data":"hex"},...] ( locktime replaceable version )
decodepsbt "psbt" decodepsbt "psbt"
decoderawtransaction "hexstring" ( iswitness ) decoderawtransaction "hexstring" ( iswitness )
decodescript "hexstring" decodescript "hexstring"
descriptorprocesspsbt "psbt" ["",{"desc":"str","range":n or [n,n]},...] ( "sighashtype" bip32derivs finalize )
finalizepsbt "psbt" ( extract ) finalizepsbt "psbt" ( extract )
fundrawtransaction "hexstring" ( options iswitness ) fundrawtransaction "hexstring" ( options iswitness )
getrawtransaction "txid" ( verbose "blockhash" ) getrawtransaction "txid" ( verbosity "blockhash" )
joinpsbts ["psbt",...] joinpsbts ["psbt",...]
sendrawtransaction "hexstring" ( maxfeerate ) sendrawtransaction "hexstring" ( maxfeerate maxburnamount )
signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" ) signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
submitpackage ["rawtx",...] ( maxfeerate maxburnamount )
testmempoolaccept ["rawtx",...] ( maxfeerate ) testmempoolaccept ["rawtx",...] ( maxfeerate )
utxoupdatepsbt "psbt" ( ["",{"desc":"str","range":n or [n,n]},...] ) utxoupdatepsbt "psbt" ( ["",{"desc":"str","range":n or [n,n]},...] )
== Signer ==
enumeratesigners
== Util == == Util ==
createmultisig nrequired ["key",...] ( "address_type" ) createmultisig nrequired ["key",...] ( "address_type" )
deriveaddresses "descriptor" ( range ) deriveaddresses "descriptor" ( range )
estimatesmartfee conf_target ( "estimate_mode" ) estimatesmartfee conf_target ( "estimate_mode" )
getdescriptorinfo "descriptor" getdescriptorinfo "descriptor"
getindexinfo ( "index_name" )
signmessagewithprivkey "privkey" "message" signmessagewithprivkey "privkey" "message"
validateaddress "address" validateaddress "address"
verifymessage "address" "signature" "message" verifymessage "address" "signature" "message"
@ -122,83 +137,98 @@ verifymessage "address" "signature" "message"
== Wallet == == Wallet ==
abandontransaction "txid" abandontransaction "txid"
abortrescan abortrescan
addmultisigaddress nrequired ["key",...] ( "label" "address_type" )
backupwallet "destination" backupwallet "destination"
bumpfee "txid" ( options ) bumpfee "txid" ( options )
createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse ) createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup external_signer )
dumpprivkey "address" createwalletdescriptor "type" ( {"internal":bool,"hdkey":"str",...} )
dumpwallet "filename"
encryptwallet "passphrase" encryptwallet "passphrase"
getaddressesbylabel "label" getaddressesbylabel "label"
getaddressinfo "address" getaddressinfo "address"
getbalance ( "dummy" minconf include_watchonly avoid_reuse ) getbalance ( "dummy" minconf include_watchonly avoid_reuse )
getbalances getbalances
gethdkeys ( {"active_only":bool,"private":bool,...} )
getnewaddress ( "label" "address_type" ) getnewaddress ( "label" "address_type" )
getrawchangeaddress ( "address_type" ) getrawchangeaddress ( "address_type" )
getreceivedbyaddress "address" ( minconf ) getreceivedbyaddress "address" ( minconf include_immature_coinbase )
getreceivedbylabel "label" ( minconf ) getreceivedbylabel "label" ( minconf include_immature_coinbase )
gettransaction "txid" ( include_watchonly verbose ) gettransaction "txid" ( include_watchonly verbose )
getunconfirmedbalance
getwalletinfo getwalletinfo
importaddress "address" ( "label" rescan p2sh ) importdescriptors requests
importmulti "requests" ( "options" )
importprivkey "privkey" ( "label" rescan )
importprunedfunds "rawtransaction" "txoutproof" importprunedfunds "rawtransaction" "txoutproof"
importpubkey "pubkey" ( "label" rescan )
importwallet "filename"
keypoolrefill ( newsize ) keypoolrefill ( newsize )
listaddressgroupings listaddressgroupings
listdescriptors ( private )
listlabels ( "purpose" ) listlabels ( "purpose" )
listlockunspent listlockunspent
listreceivedbyaddress ( minconf include_empty include_watchonly "address_filter" ) listreceivedbyaddress ( minconf include_empty include_watchonly "address_filter" include_immature_coinbase )
listreceivedbylabel ( minconf include_empty include_watchonly ) listreceivedbylabel ( minconf include_empty include_watchonly include_immature_coinbase )
listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed ) listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed include_change "label" )
listtransactions ( "label" count skip include_watchonly ) listtransactions ( "label" count skip include_watchonly )
listunspent ( minconf maxconf ["address",...] include_unsafe query_options ) listunspent ( minconf maxconf ["address",...] include_unsafe query_options )
listwalletdir listwalletdir
listwallets listwallets
loadwallet "filename" loadwallet "filename" ( load_on_startup )
lockunspent unlock ( [{"txid":"hex","vout":n},...] ) lockunspent unlock ( [{"txid":"hex","vout":n},...] persistent )
migratewallet ( "wallet_name" "passphrase" )
psbtbumpfee "txid" ( options )
removeprunedfunds "txid" removeprunedfunds "txid"
rescanblockchain ( start_height stop_height ) rescanblockchain ( start_height stop_height )
sendmany "" {"address":amount} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode" ) restorewallet "wallet_name" "backup_file" ( load_on_startup )
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" avoid_reuse ) send [{"address":amount,...},{"data":"hex"},...] ( conf_target "estimate_mode" fee_rate options version )
sethdseed ( newkeypool "seed" ) sendall ["address",{"address":amount,...},...] ( conf_target "estimate_mode" fee_rate options )
sendmany ( "" ) {"address":amount,...} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode" fee_rate verbose )
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" avoid_reuse fee_rate verbose )
setlabel "address" "label" setlabel "address" "label"
settxfee amount settxfee amount
setwalletflag "flag" ( value ) setwalletflag "flag" ( value )
signmessage "address" "message" signmessage "address" "message"
signrawtransactionwithwallet "hexstring" ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" ) signrawtransactionwithwallet "hexstring" ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
unloadwallet ( "wallet_name" ) simulaterawtransaction ( ["rawtx",...] {"include_watchonly":bool,...} )
walletcreatefundedpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime options bip32derivs ) unloadwallet ( "wallet_name" load_on_startup )
walletcreatefundedpsbt ( [{"txid":"hex","vout":n,"sequence":n,"weight":n},...] ) [{"address":amount,...},{"data":"hex"},...] ( locktime options bip32derivs version )
walletdisplayaddress "address"
walletlock walletlock
walletpassphrase "passphrase" timeout walletpassphrase "passphrase" timeout
walletpassphrasechange "oldpassphrase" "newpassphrase" walletpassphrasechange "oldpassphrase" "newpassphrase"
walletprocesspsbt "psbt" ( sign "sighashtype" bip32derivs ) walletprocesspsbt "psbt" ( sign "sighashtype" bip32derivs finalize )
== Zmq == == Zmq ==
getzmqnotifications getzmqnotifications
``` ```
You can also type `bitcoin-cli help [command]` to get even more extensive info on that command. For example: You can also type `bitcoin-cli help [command]` to get even more extensive info on that command. For example:
``` ```
$ bitcoin-cli help getmininginfo $ bitcoin-cli help createwallet
... ...
Returns a json object containing mining-related information. createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup external_signer )
Creates and loads a new wallet.
Arguments:
1. wallet_name (string, required) The name for the new wallet. If this is a path, the wallet will be created at the path location.
2. disable_private_keys (boolean, optional, default=false) Disable the possibility of private keys (only watchonlys are possible in this mode).
3. blank (boolean, optional, default=false) Create a blank wallet. A blank wallet has no keys.
4. passphrase (string, optional) Encrypt the wallet with this passphrase.
5. avoid_reuse (boolean, optional, default=false) Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind.
6. descriptors (boolean, optional, default=true) If set, must be "true"
7. load_on_startup (boolean, optional) Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged.
8. external_signer (boolean, optional, default=false) Use an external signer such as a hardware wallet. Requires -signer to be configured. Wallet creation will fail if keys cannot be fetched. Requires disable_private_keys and descriptors set to true.
Result: Result:
{ (json object) { (json object)
"blocks" : n, (numeric) The current block "name" : "str", (string) The wallet name if created successfully. If the wallet was created using a full path, the wallet_name will be the full path.
"currentblockweight" : n, (numeric, optional) The block weight of the last assembled block (only present if a block was ever assembled) "warnings" : [ (json array, optional) Warning messages, if any, related to creating and loading the wallet.
"currentblocktx" : n, (numeric, optional) The number of block transactions of the last assembled block (only present if a block was ever assembled) "str", (string)
"difficulty" : n, (numeric) The current difficulty ...
"networkhashps" : n, (numeric) The network hashes per second ]
"pooledtx" : n, (numeric) The size of the mempool
"chain" : "str", (string) current network name (main, test, regtest)
"warnings" : "str" (string) any network and blockchain warnings
} }
Examples: Examples:
> bitcoin-cli getmininginfo > bitcoin-cli createwallet "testwallet"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getmininginfo", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "createwallet", "params": ["testwallet"]}' -H 'content-type: application/json' http://127.0.0.1:8332/
> bitcoin-cli -named createwallet wallet_name=descriptors avoid_reuse=true load_on_startup=true
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "createwallet", "params": {"wallet_name":"descriptors","avoid_reuse":true,"load_on_startup":true}}' -H 'content-type: application/json' http://127.0.0.1:8332/
``` ```
> :book: ***What is RPC?*** `bitcoin-cli` is just a handy interface that lets you send commands to the `bitcoind`. More specifically, it's an interface that lets you send RPC (or Remote Procedure Protocol) commands to the `bitcoind`. Often, the `bitcoin-cli` command and the RPC command have identical names and interfaces, but some `bitcoin-cli` commands instead provide shortcuts for more complex RPC requests. Generally, the `bitcoin-cli` interface is much cleaner and simpler than trying to send RPC commands by hand, using `curl` or some other method. However, it also has limitations as to what you can ultimately do. > :book: ***What is RPC?*** `bitcoin-cli` is just a handy interface that lets you send commands to the `bitcoind`. More specifically, it's an interface that lets you send RPC (or Remote Procedure Protocol) commands to the `bitcoind`. Often, the `bitcoin-cli` command and the RPC command have identical names and interfaces, but some `bitcoin-cli` commands instead provide shortcuts for more complex RPC requests. Generally, the `bitcoin-cli` interface is much cleaner and simpler than trying to send RPC commands by hand, using `curl` or some other method. However, it also has limitations as to what you can ultimately do.
@ -234,7 +264,7 @@ Transaction fee rate (-paytxfee) (BTC/kvB): 0.00000000
``` ```
Other commands to get information about blockchain, mining, network, wallet etc. Other commands allow you to get information about blockchain, mining, network, wallet etc.
``` ```
$ bitcoin-cli getblockchaininfo $ bitcoin-cli getblockchaininfo
@ -247,18 +277,21 @@ For example `bitcoin-cli getnetworkinfo` gives you a variety of information on y
``` ```
$ bitcoin-cli getnetworkinfo $ bitcoin-cli getnetworkinfo
{ {
"version": 200000, "version": 300200,
"subversion": "/Satoshi:0.20.0/", "subversion": "/Satoshi:30.2.0/",
"protocolversion": 70015, "protocolversion": 70016,
"localservices": "0000000000000408", "localservices": "0000000000000c08",
"localservicesnames": [ "localservicesnames": [
"WITNESS", "WITNESS",
"NETWORK_LIMITED" "NETWORK_LIMITED",
"P2P_V2"
], ],
"localrelay": true, "localrelay": true,
"timeoffset": 0, "timeoffset": 0,
"networkactive": true, "networkactive": true,
"connections": 10, "connections": 11,
"connections_in": 0,
"connections_out": 11,
"networks": [ "networks": [
{ {
"name": "ipv4", "name": "ipv4",
@ -280,31 +313,46 @@ $ bitcoin-cli getnetworkinfo
"reachable": true, "reachable": true,
"proxy": "127.0.0.1:9050", "proxy": "127.0.0.1:9050",
"proxy_randomize_credentials": true "proxy_randomize_credentials": true
},
{
"name": "i2p",
"limited": true,
"reachable": false,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "cjdns",
"limited": true,
"reachable": false,
"proxy": "",
"proxy_randomize_credentials": false
} }
], ],
"relayfee": 0.00001000, "relayfee": 0.00000100,
"incrementalfee": 0.00001000, "incrementalfee": 0.00000100,
"localaddresses": [ "localaddresses": [
{ {
"address": "45.79.111.171", "address": "172.239.66.235",
"port": 18333, "port": 38333,
"score": 1 "score": 1
}, },
{ {
"address": "2600:3c01::f03c:92ff:fecc:fdb7", "address": "2a01:7e03::2000:92ff:fe75:3ec",
"port": 18333, "port": 38333,
"score": 1 "score": 1
}, },
{ {
"address": "4wrr3ktm6gl4sojx.onion", "address": "km4bnrbemttglfbkafav2nf5mcy4x3l5jmi24fwtjjm3uba2ygycutyd.onion",
"port": 18333, "port": 38333,
"score": 4 "score": 4
} }
], ],
"warnings": "Warning: unknown new rules activated (versionbit 28)" "warnings": [
]
} }
``` ```
Feel free to reference any of these and to use "bitcoin-cli help" if you want more information on what any of them do. Feel free to test out any of these and to use "bitcoin-cli help" if you want more information on what any of them do.
## Summary: Knowing Your Bitcoin Setup ## Summary: Knowing Your Bitcoin Setup