mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
scripted-diff: Adjust documentation per top-level target output location
-BEGIN VERIFY SCRIPT- ren() { sed -i "s|\<$1\>|$2|g" $( git grep -l "$1" :\(exclude\)./src/secp256k1 ) ; } ren build/src/bench build/bin ren build/src/test build/bin ren build/src/qt/test build/bin ren build/src/qt build/bin ren build/src build/bin ren build_fuzz/src/test/fuzz build_fuzz/bin -END VERIFY SCRIPT-
This commit is contained in:
parent
3b6e0d0998
commit
06ff9429d3
17 changed files with 95 additions and 95 deletions
|
@ -24,7 +24,7 @@ miner
|
|||
You will first need to pick a difficulty target. Since signet chains are primarily protected by a signature rather than proof of work, there is no need to spend as much energy as possible mining, however you may wish to choose to spend more time than the absolute minimum. The calibrate subcommand can be used to pick a target appropriate for your hardware, eg:
|
||||
|
||||
MINER="./contrib/signet/miner"
|
||||
GRIND="./build/src/bitcoin-util grind"
|
||||
GRIND="./build/bin/bitcoin-util grind"
|
||||
$MINER calibrate --grind-cmd="$GRIND"
|
||||
nbits=1e00f403 for 25s average mining time
|
||||
|
||||
|
@ -32,7 +32,7 @@ It defaults to estimating an nbits value resulting in 25s average time to find a
|
|||
|
||||
To mine the first block in your custom chain, you can run:
|
||||
|
||||
CLI="./build/src/bitcoin-cli -conf=mysignet.conf"
|
||||
CLI="./build/bin/bitcoin-cli -conf=mysignet.conf"
|
||||
ADDR=$($CLI -signet getnewaddress)
|
||||
NBITS=1e00f403
|
||||
$MINER --cli="$CLI" generate --grind-cmd="$GRIND" --address="$ADDR" --nbits=$NBITS
|
||||
|
|
|
@ -188,7 +188,7 @@ In a different terminal, starting Bitcoin Core in SigNet mode and with
|
|||
re-indexing enabled.
|
||||
|
||||
```
|
||||
$ ./build/src/bitcoind -signet -reindex
|
||||
$ ./build/bin/bitcoind -signet -reindex
|
||||
```
|
||||
|
||||
This produces the following output.
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
This script requires a 'bitcoind' binary compiled with eBPF support and the
|
||||
'validation:block_connected' USDT. By default, it's assumed that 'bitcoind' is
|
||||
located in './build/src/bitcoind'. This can be modified in the script below.
|
||||
located in './build/bin/bitcoind'. This can be modified in the script below.
|
||||
|
||||
EXAMPLES:
|
||||
|
||||
|
@ -67,7 +67,7 @@ BEGIN
|
|||
connected block is between the start and end height (or the end height is
|
||||
unset).
|
||||
*/
|
||||
usdt:./build/src/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2 == 0 )/
|
||||
usdt:./build/bin/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2 == 0 )/
|
||||
{
|
||||
$height = arg1;
|
||||
$transactions = arg2;
|
||||
|
@ -102,7 +102,7 @@ usdt:./build/src/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2
|
|||
blocks where the time it took to connect the block is above the
|
||||
<logging threshold in ms>.
|
||||
*/
|
||||
usdt:./build/src/bitcoind:validation:block_connected / (uint64) arg5 / 1e6 > $3 /
|
||||
usdt:./build/bin/bitcoind:validation:block_connected / (uint64) arg5 / 1e6 > $3 /
|
||||
{
|
||||
$hash = arg0;
|
||||
$height = (int32) arg1;
|
||||
|
|
|
@ -5,7 +5,7 @@ BEGIN
|
|||
printf("Logging P2P traffic\n")
|
||||
}
|
||||
|
||||
usdt:./build/src/bitcoind:net:inbound_message
|
||||
usdt:./build/bin/bitcoind:net:inbound_message
|
||||
{
|
||||
$peer_id = (int64) arg0;
|
||||
$peer_addr = str(arg1);
|
||||
|
@ -15,7 +15,7 @@ usdt:./build/src/bitcoind:net:inbound_message
|
|||
printf("inbound '%s' msg from peer %d (%s, %s) with %d bytes\n", $msg_type, $peer_id, $peer_type, $peer_addr, $msg_len);
|
||||
}
|
||||
|
||||
usdt:./build/src/bitcoind:net:outbound_message
|
||||
usdt:./build/bin/bitcoind:net:outbound_message
|
||||
{
|
||||
$peer_id = (int64) arg0;
|
||||
$peer_addr = str(arg1);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
This script requires a 'bitcoind' binary compiled with eBPF support and the
|
||||
'utxocache' tracepoints. By default, it's assumed that 'bitcoind' is
|
||||
located in './build/src/bitcoind'. This can be modified in the script below.
|
||||
located in './build/bin/bitcoind'. This can be modified in the script below.
|
||||
|
||||
NOTE: requires bpftrace v0.12.0 or above.
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@ BEGIN
|
|||
/*
|
||||
Attaches to the 'utxocache:add' tracepoint and prints additions to the UTXO set cache.
|
||||
*/
|
||||
usdt:./build/src/bitcoind:utxocache:add
|
||||
usdt:./build/bin/bitcoind:utxocache:add
|
||||
{
|
||||
$txid = arg0;
|
||||
$index = (uint32)arg1;
|
||||
|
@ -44,7 +44,7 @@ usdt:./build/src/bitcoind:utxocache:add
|
|||
/*
|
||||
Attaches to the 'utxocache:spent' tracepoint and prints spents from the UTXO set cache.
|
||||
*/
|
||||
usdt:./build/src/bitcoind:utxocache:spent
|
||||
usdt:./build/bin/bitcoind:utxocache:spent
|
||||
{
|
||||
$txid = arg0;
|
||||
$index = (uint32)arg1;
|
||||
|
@ -66,7 +66,7 @@ usdt:./build/src/bitcoind:utxocache:spent
|
|||
/*
|
||||
Attaches to the 'utxocache:uncache' tracepoint and uncache UTXOs from the UTXO set cache.
|
||||
*/
|
||||
usdt:./build/src/bitcoind:utxocache:uncache
|
||||
usdt:./build/bin/bitcoind:utxocache:uncache
|
||||
{
|
||||
$txid = arg0;
|
||||
$index = (uint32)arg1;
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
# dependencies that cannot be fixed in-tree.
|
||||
#
|
||||
# Example use:
|
||||
# $ valgrind --suppressions=contrib/valgrind.supp build/src/test/test_bitcoin
|
||||
# $ valgrind --suppressions=contrib/valgrind.supp build/bin/test_bitcoin
|
||||
# $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
|
||||
# --show-leak-kinds=all build/src/test/test_bitcoin
|
||||
# --show-leak-kinds=all build/bin/test_bitcoin
|
||||
#
|
||||
# To create suppressions for found issues, use the --gen-suppressions=all option:
|
||||
# $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
|
||||
# --show-leak-kinds=all --gen-suppressions=all --show-reachable=yes \
|
||||
# --error-limit=no build/src/test/test_bitcoin
|
||||
# --error-limit=no build/bin/test_bitcoin
|
||||
#
|
||||
# Note that suppressions may depend on OS and/or library versions.
|
||||
# Tested on:
|
||||
|
|
|
@ -18,7 +18,7 @@ and lock analysis.
|
|||
|
||||
After compiling bitcoin-core, the benchmarks can be run with:
|
||||
|
||||
build/src/bench/bench_bitcoin
|
||||
build/bin/bench_bitcoin
|
||||
|
||||
The output will look similar to:
|
||||
```
|
||||
|
@ -40,7 +40,7 @@ The output will look similar to:
|
|||
Help
|
||||
---------------------
|
||||
|
||||
build/src/bench/bench_bitcoin -h
|
||||
build/bin/bench_bitcoin -h
|
||||
|
||||
To print the various options, like listing the benchmarks without running them
|
||||
or using a regex filter to only run certain benchmarks.
|
||||
|
|
|
@ -199,8 +199,8 @@ cmake --build build --target deploy
|
|||
|
||||
## Running Bitcoin Core
|
||||
|
||||
Bitcoin Core should now be available at `./build/src/bitcoind`.
|
||||
If you compiled support for the GUI, it should be available at `./build/src/qt/bitcoin-qt`.
|
||||
Bitcoin Core should now be available at `./build/bin/bitcoind`.
|
||||
If you compiled support for the GUI, it should be available at `./build/bin/bitcoin-qt`.
|
||||
|
||||
The first time you run `bitcoind` or `bitcoin-qt`, it will start downloading the blockchain.
|
||||
This process could take many hours, or even days on slower than average systems.
|
||||
|
@ -230,8 +230,8 @@ tail -f $HOME/Library/Application\ Support/Bitcoin/debug.log
|
|||
## Other commands:
|
||||
|
||||
```shell
|
||||
./build/src/bitcoind -daemon # Starts the bitcoin daemon.
|
||||
./build/src/bitcoin-cli --help # Outputs a list of command-line options.
|
||||
./build/src/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running.
|
||||
./build/src/qt/bitcoin-qt -server # Starts the bitcoin-qt server mode, allows bitcoin-cli control
|
||||
./build/bin/bitcoind -daemon # Starts the bitcoin daemon.
|
||||
./build/bin/bitcoin-cli --help # Outputs a list of command-line options.
|
||||
./build/bin/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running.
|
||||
./build/bin/bitcoin-qt -server # Starts the bitcoin-qt server mode, allows bitcoin-cli control
|
||||
```
|
||||
|
|
|
@ -188,6 +188,6 @@ This example lists the steps necessary to setup and build a command line only di
|
|||
cmake -B build
|
||||
cmake --build build
|
||||
ctest --test-dir build
|
||||
./build/src/bitcoind
|
||||
./build/bin/bitcoind
|
||||
|
||||
If you intend to work with legacy Berkeley DB wallets, see [Berkeley DB](#berkeley-db) section.
|
||||
|
|
|
@ -475,10 +475,10 @@ which includes known Valgrind warnings in our dependencies that cannot be fixed
|
|||
in-tree. Example use:
|
||||
|
||||
```shell
|
||||
$ valgrind --suppressions=contrib/valgrind.supp build/src/test/test_bitcoin
|
||||
$ valgrind --suppressions=contrib/valgrind.supp build/bin/test_bitcoin
|
||||
$ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
|
||||
--show-leak-kinds=all build/src/test/test_bitcoin --log_level=test_suite
|
||||
$ valgrind -v --leak-check=full build/src/bitcoind -printtoconsole
|
||||
--show-leak-kinds=all build/bin/test_bitcoin --log_level=test_suite
|
||||
$ valgrind -v --leak-check=full build/bin/bitcoind -printtoconsole
|
||||
$ ./build/test/functional/test_runner.py --valgrind
|
||||
```
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ $ cmake --preset=libfuzzer
|
|||
# macOS users: If you have problem with this step then make sure to read "macOS hints for
|
||||
# libFuzzer" on https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md#macos-hints-for-libfuzzer
|
||||
$ cmake --build build_fuzz
|
||||
$ FUZZ=process_message build_fuzz/src/test/fuzz/fuzz
|
||||
$ FUZZ=process_message build_fuzz/bin/fuzz
|
||||
# abort fuzzing using ctrl-c
|
||||
```
|
||||
|
||||
|
@ -35,7 +35,7 @@ If you specify a corpus directory then any new coverage increasing inputs will b
|
|||
|
||||
```sh
|
||||
$ mkdir -p process_message-seeded-from-thin-air/
|
||||
$ FUZZ=process_message build_fuzz/src/test/fuzz/fuzz process_message-seeded-from-thin-air/
|
||||
$ FUZZ=process_message build_fuzz/bin/fuzz process_message-seeded-from-thin-air/
|
||||
INFO: Seed: 840522292
|
||||
INFO: Loaded 1 modules (424174 inline 8-bit counters): 424174 [0x55e121ef9ab8, 0x55e121f613a6),
|
||||
INFO: Loaded 1 PC tables (424174 PCs): 424174 [0x55e121f613a8,0x55e1225da288),
|
||||
|
@ -79,7 +79,7 @@ of the test. Just make sure to use double-dash to distinguish them from the
|
|||
fuzzer's own arguments:
|
||||
|
||||
```sh
|
||||
$ FUZZ=address_deserialize_v2 build_fuzz/src/test/fuzz/fuzz -runs=1 fuzz_corpora/address_deserialize_v2 --checkaddrman=5 --printtoconsole=1
|
||||
$ FUZZ=address_deserialize_v2 build_fuzz/bin/fuzz -runs=1 fuzz_corpora/address_deserialize_v2 --checkaddrman=5 --printtoconsole=1
|
||||
```
|
||||
|
||||
## Fuzzing corpora
|
||||
|
@ -90,7 +90,7 @@ To fuzz `process_message` using the [`bitcoin-core/qa-assets`](https://github.co
|
|||
|
||||
```sh
|
||||
$ git clone https://github.com/bitcoin-core/qa-assets
|
||||
$ FUZZ=process_message build_fuzz/src/test/fuzz/fuzz qa-assets/fuzz_corpora/process_message/
|
||||
$ FUZZ=process_message build_fuzz/bin/fuzz qa-assets/fuzz_corpora/process_message/
|
||||
INFO: Seed: 1346407872
|
||||
INFO: Loaded 1 modules (424174 inline 8-bit counters): 424174 [0x55d8a9004ab8, 0x55d8a906c3a6),
|
||||
INFO: Loaded 1 PC tables (424174 PCs): 424174 [0x55d8a906c3a8,0x55d8a96e5288),
|
||||
|
@ -122,7 +122,7 @@ Patience is useful; even with improved throughput, libFuzzer may need days and
|
|||
more slowly with sanitizers enabled, but a crash should be reproducible very
|
||||
quickly from a crash case)
|
||||
- run the fuzzer with the case number appended to the seed corpus path:
|
||||
`FUZZ=process_message build_fuzz/src/test/fuzz/fuzz
|
||||
`FUZZ=process_message build_fuzz/bin/fuzz
|
||||
qa-assets/fuzz_corpora/process_message/1bc91feec9fc00b107d97dc225a9f2cdaa078eb6`
|
||||
|
||||
## Submit improved coverage
|
||||
|
@ -174,7 +174,7 @@ $ cmake --build build_fuzz
|
|||
# try compiling using: AFL_NO_X86=1 cmake --build build_fuzz
|
||||
$ mkdir -p inputs/ outputs/
|
||||
$ echo A > inputs/thin-air-input
|
||||
$ FUZZ=bech32 ./AFLplusplus/afl-fuzz -i inputs/ -o outputs/ -- build_fuzz/src/test/fuzz/fuzz
|
||||
$ FUZZ=bech32 ./AFLplusplus/afl-fuzz -i inputs/ -o outputs/ -- build_fuzz/bin/fuzz
|
||||
# You may have to change a few kernel parameters to test optimally - afl-fuzz
|
||||
# will print an error and suggestion if so.
|
||||
```
|
||||
|
@ -201,7 +201,7 @@ $ cmake -B build_fuzz \
|
|||
-DSANITIZERS=address,undefined
|
||||
$ cmake --build build_fuzz
|
||||
$ mkdir -p inputs/
|
||||
$ FUZZ=process_message ./honggfuzz/honggfuzz -i inputs/ -- build_fuzz/src/test/fuzz/fuzz
|
||||
$ FUZZ=process_message ./honggfuzz/honggfuzz -i inputs/ -- build_fuzz/bin/fuzz
|
||||
```
|
||||
|
||||
Read the [Honggfuzz documentation](https://github.com/google/honggfuzz/blob/master/docs/USAGE.md) for more information.
|
||||
|
|
|
@ -21,8 +21,8 @@ make -C depends NO_QT=1 MULTIPROCESS=1
|
|||
HOST_PLATFORM="x86_64-pc-linux-gnu"
|
||||
cmake -B build --toolchain=depends/$HOST_PLATFORM/toolchain.cmake
|
||||
cmake --build build
|
||||
build/src/bitcoin-node -regtest -printtoconsole -debug=ipc
|
||||
BITCOIND=$(pwd)/build/src/bitcoin-node build/test/functional/test_runner.py
|
||||
build/bin/bitcoin-node -regtest -printtoconsole -debug=ipc
|
||||
BITCOIND=$(pwd)/build/bin/bitcoin-node build/test/functional/test_runner.py
|
||||
```
|
||||
|
||||
The `cmake` build will pick up settings and library locations from the depends directory, so there is no need to pass `-DWITH_MULTIPROCESS=ON` as a separate flag when using the depends system (it's controlled by the `MULTIPROCESS=1` option).
|
||||
|
|
|
@ -9,7 +9,7 @@ This tutorial uses [jq](https://github.com/stedolan/jq) JSON processor to proces
|
|||
Before starting this tutorial, start the bitcoin node on the signet network.
|
||||
|
||||
```bash
|
||||
./build/src/bitcoind -signet -daemon
|
||||
./build/bin/bitcoind -signet -daemon
|
||||
```
|
||||
|
||||
This tutorial also uses the default WPKH derivation path to get the xpubs and does not conform to [BIP 45](https://github.com/bitcoin/bips/blob/master/bip-0045.mediawiki) or [BIP 87](https://github.com/bitcoin/bips/blob/master/bip-0087.mediawiki).
|
||||
|
@ -27,7 +27,7 @@ These three wallets should not be used directly for privacy reasons (public key
|
|||
```bash
|
||||
for ((n=1;n<=3;n++))
|
||||
do
|
||||
./build/src/bitcoin-cli -signet createwallet "participant_${n}"
|
||||
./build/bin/bitcoin-cli -signet createwallet "participant_${n}"
|
||||
done
|
||||
```
|
||||
|
||||
|
@ -47,9 +47,9 @@ declare -A xpubs
|
|||
|
||||
for ((n=1;n<=3;n++))
|
||||
do
|
||||
xpubs["internal_xpub_${n}"]=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_${n}" listdescriptors | jq '.descriptors | [.[] | select(.desc | startswith("wpkh") and contains("/1/*"))][0] | .desc' | grep -Po '(?<=\().*(?=\))')
|
||||
xpubs["internal_xpub_${n}"]=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_${n}" listdescriptors | jq '.descriptors | [.[] | select(.desc | startswith("wpkh") and contains("/1/*"))][0] | .desc' | grep -Po '(?<=\().*(?=\))')
|
||||
|
||||
xpubs["external_xpub_${n}"]=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_${n}" listdescriptors | jq '.descriptors | [.[] | select(.desc | startswith("wpkh") and contains("/0/*") )][0] | .desc' | grep -Po '(?<=\().*(?=\))')
|
||||
xpubs["external_xpub_${n}"]=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_${n}" listdescriptors | jq '.descriptors | [.[] | select(.desc | startswith("wpkh") and contains("/0/*") )][0] | .desc' | grep -Po '(?<=\().*(?=\))')
|
||||
done
|
||||
```
|
||||
|
||||
|
@ -71,8 +71,8 @@ Define the external and internal multisig descriptors, add the checksum and then
|
|||
external_desc="wsh(sortedmulti(2,${xpubs["external_xpub_1"]},${xpubs["external_xpub_2"]},${xpubs["external_xpub_3"]}))"
|
||||
internal_desc="wsh(sortedmulti(2,${xpubs["internal_xpub_1"]},${xpubs["internal_xpub_2"]},${xpubs["internal_xpub_3"]}))"
|
||||
|
||||
external_desc_sum=$(./build/src/bitcoin-cli -signet getdescriptorinfo $external_desc | jq '.descriptor')
|
||||
internal_desc_sum=$(./build/src/bitcoin-cli -signet getdescriptorinfo $internal_desc | jq '.descriptor')
|
||||
external_desc_sum=$(./build/bin/bitcoin-cli -signet getdescriptorinfo $external_desc | jq '.descriptor')
|
||||
internal_desc_sum=$(./build/bin/bitcoin-cli -signet getdescriptorinfo $internal_desc | jq '.descriptor')
|
||||
|
||||
multisig_ext_desc="{\"desc\": $external_desc_sum, \"active\": true, \"internal\": false, \"timestamp\": \"now\"}"
|
||||
multisig_int_desc="{\"desc\": $internal_desc_sum, \"active\": true, \"internal\": true, \"timestamp\": \"now\"}"
|
||||
|
@ -94,7 +94,7 @@ There are other fields that can be added to the descriptors:
|
|||
* `internal`: Indicates whether matching outputs should be treated as something other than incoming payments (e.g. change).
|
||||
* `timestamp`: Sets the time from which to start rescanning the blockchain for the descriptor, in UNIX epoch time.
|
||||
|
||||
Documentation for these and other parameters can be found by typing `./build/src/bitcoin-cli help importdescriptors`.
|
||||
Documentation for these and other parameters can be found by typing `./build/bin/bitcoin-cli help importdescriptors`.
|
||||
|
||||
`multisig_desc` concatenates external and internal descriptors in a JSON array and then it will be used to create the multisig wallet.
|
||||
|
||||
|
@ -107,17 +107,17 @@ Then import the descriptors created in the previous step using the `importdescri
|
|||
After that, `getwalletinfo` can be used to check if the wallet was created successfully.
|
||||
|
||||
```bash
|
||||
./build/src/bitcoin-cli -signet -named createwallet wallet_name="multisig_wallet_01" disable_private_keys=true blank=true
|
||||
./build/bin/bitcoin-cli -signet -named createwallet wallet_name="multisig_wallet_01" disable_private_keys=true blank=true
|
||||
|
||||
./build/src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" importdescriptors "$multisig_desc"
|
||||
./build/bin/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" importdescriptors "$multisig_desc"
|
||||
|
||||
./build/src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getwalletinfo
|
||||
./build/bin/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getwalletinfo
|
||||
```
|
||||
|
||||
Once the wallets have already been created and this tutorial needs to be repeated or resumed, it is not necessary to recreate them, just load them with the command below:
|
||||
|
||||
```bash
|
||||
for ((n=1;n<=3;n++)); do ./build/src/bitcoin-cli -signet loadwallet "participant_${n}"; done
|
||||
for ((n=1;n<=3;n++)); do ./build/bin/bitcoin-cli -signet loadwallet "participant_${n}"; done
|
||||
```
|
||||
|
||||
### 1.4 Fund the wallet
|
||||
|
@ -131,9 +131,9 @@ The url used by the script can also be accessed directly. At time of writing, th
|
|||
Coins received by the wallet must have at least 1 confirmation before they can be spent. It is necessary to wait for a new block to be mined before continuing.
|
||||
|
||||
```bash
|
||||
receiving_address=$(./build/src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getnewaddress)
|
||||
receiving_address=$(./build/bin/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getnewaddress)
|
||||
|
||||
./contrib/signet/getcoins.py -c ./build/src/bitcoin-cli -a $receiving_address
|
||||
./contrib/signet/getcoins.py -c ./build/bin/bitcoin-cli -a $receiving_address
|
||||
```
|
||||
|
||||
To copy the receiving address onto the clipboard, use the following command. This can be useful when getting coins via the signet faucet mentioned above.
|
||||
|
@ -145,7 +145,7 @@ echo -n "$receiving_address" | xclip -sel clip
|
|||
The `getbalances` RPC may be used to check the balance. Coins with `trusted` status can be spent.
|
||||
|
||||
```bash
|
||||
./build/src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalances
|
||||
./build/bin/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalances
|
||||
```
|
||||
|
||||
### 1.5 Create a PSBT
|
||||
|
@ -161,13 +161,13 @@ For simplicity, the destination address is taken from the `participant_1` wallet
|
|||
The `walletcreatefundedpsbt` RPC is used to create and fund a transaction in the PSBT format. It is the first step in creating the PSBT.
|
||||
|
||||
```bash
|
||||
balance=$(./build/src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalance)
|
||||
balance=$(./build/bin/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalance)
|
||||
|
||||
amount=$(echo "$balance * 0.8" | bc -l | sed -e 's/^\./0./' -e 's/^-\./-0./')
|
||||
|
||||
destination_addr=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_1" getnewaddress)
|
||||
destination_addr=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_1" getnewaddress)
|
||||
|
||||
funded_psbt=$(./build/src/bitcoin-cli -signet -named -rpcwallet="multisig_wallet_01" walletcreatefundedpsbt outputs="{\"$destination_addr\": $amount}" | jq -r '.psbt')
|
||||
funded_psbt=$(./build/bin/bitcoin-cli -signet -named -rpcwallet="multisig_wallet_01" walletcreatefundedpsbt outputs="{\"$destination_addr\": $amount}" | jq -r '.psbt')
|
||||
```
|
||||
|
||||
There is also the `createpsbt` RPC, which serves the same purpose, but it has no access to the wallet or to the UTXO set. It is functionally the same as `createrawtransaction` and just drops the raw transaction into an otherwise blank PSBT. [[source](https://bitcointalk.org/index.php?topic=5131043.msg50573609#msg50573609)] In most cases, `walletcreatefundedpsbt` solves the problem.
|
||||
|
@ -181,9 +181,9 @@ Optionally, the PSBT can be decoded to a JSON format using `decodepsbt` RPC.
|
|||
The `analyzepsbt` RPC analyzes and provides information about the current status of a PSBT and its inputs, e.g. missing signatures.
|
||||
|
||||
```bash
|
||||
./build/src/bitcoin-cli -signet decodepsbt $funded_psbt
|
||||
./build/bin/bitcoin-cli -signet decodepsbt $funded_psbt
|
||||
|
||||
./build/src/bitcoin-cli -signet analyzepsbt $funded_psbt
|
||||
./build/bin/bitcoin-cli -signet analyzepsbt $funded_psbt
|
||||
```
|
||||
|
||||
### 1.7 Update the PSBT
|
||||
|
@ -193,9 +193,9 @@ In the code above, two PSBTs are created. One signed by `participant_1` wallet a
|
|||
The `walletprocesspsbt` is used by the wallet to sign a PSBT.
|
||||
|
||||
```bash
|
||||
psbt_1=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq '.psbt')
|
||||
psbt_1=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq '.psbt')
|
||||
|
||||
psbt_2=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $funded_psbt | jq '.psbt')
|
||||
psbt_2=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $funded_psbt | jq '.psbt')
|
||||
```
|
||||
|
||||
### 1.8 Combine the PSBT
|
||||
|
@ -203,7 +203,7 @@ psbt_2=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_2" walletproces
|
|||
The PSBT, if signed separately by the co-signers, must be combined into one transaction before being finalized. This is done by `combinepsbt` RPC.
|
||||
|
||||
```bash
|
||||
combined_psbt=$(./build/src/bitcoin-cli -signet combinepsbt "[$psbt_1, $psbt_2]")
|
||||
combined_psbt=$(./build/bin/bitcoin-cli -signet combinepsbt "[$psbt_1, $psbt_2]")
|
||||
```
|
||||
|
||||
There is an RPC called `joinpsbts`, but it has a different purpose than `combinepsbt`. `joinpsbts` joins the inputs from multiple distinct PSBTs into one PSBT.
|
||||
|
@ -217,9 +217,9 @@ The `finalizepsbt` RPC is used to produce a network serialized transaction which
|
|||
It checks that all inputs have complete scriptSigs and scriptWitnesses and, if so, encodes them into network serialized transactions.
|
||||
|
||||
```bash
|
||||
finalized_psbt_hex=$(./build/src/bitcoin-cli -signet finalizepsbt $combined_psbt | jq -r '.hex')
|
||||
finalized_psbt_hex=$(./build/bin/bitcoin-cli -signet finalizepsbt $combined_psbt | jq -r '.hex')
|
||||
|
||||
./build/src/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex
|
||||
./build/bin/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex
|
||||
```
|
||||
|
||||
### 1.10 Alternative Workflow (PSBT sequential signatures)
|
||||
|
@ -229,11 +229,11 @@ Instead of each wallet signing the original PSBT and combining them later, the w
|
|||
After that, the rest of the process is the same: the PSBT is finalized and transmitted to the network.
|
||||
|
||||
```bash
|
||||
psbt_1=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq -r '.psbt')
|
||||
psbt_1=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq -r '.psbt')
|
||||
|
||||
psbt_2=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $psbt_1 | jq -r '.psbt')
|
||||
psbt_2=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $psbt_1 | jq -r '.psbt')
|
||||
|
||||
finalized_psbt_hex=$(./build/src/bitcoin-cli -signet finalizepsbt $psbt_2 | jq -r '.hex')
|
||||
finalized_psbt_hex=$(./build/bin/bitcoin-cli -signet finalizepsbt $psbt_2 | jq -r '.hex')
|
||||
|
||||
./build/src/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex
|
||||
./build/bin/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex
|
||||
```
|
||||
|
|
|
@ -25,7 +25,7 @@ We are going to first create an `offline_wallet` on the offline host. We will th
|
|||
1. On the offline machine create a wallet named `offline_wallet` secured by a wallet `passphrase`. This wallet will contain private keys and must remain unconnected to any networks at all times.
|
||||
|
||||
```sh
|
||||
[offline]$ ./build/src/bitcoin-cli -signet -named createwallet \
|
||||
[offline]$ ./build/bin/bitcoin-cli -signet -named createwallet \
|
||||
wallet_name="offline_wallet" \
|
||||
passphrase="** enter passphrase **"
|
||||
|
||||
|
@ -40,7 +40,7 @@ We are going to first create an `offline_wallet` on the offline host. We will th
|
|||
2. Export the public key-only descriptors from the offline host to a JSON file named `descriptors.json`. We use `jq` here to extract the `.descriptors` field from the full RPC response.
|
||||
|
||||
```sh
|
||||
[offline]$ ./build/src/bitcoin-cli -signet -rpcwallet="offline_wallet" listdescriptors \
|
||||
[offline]$ ./build/bin/bitcoin-cli -signet -rpcwallet="offline_wallet" listdescriptors \
|
||||
| jq -r '.descriptors' \
|
||||
>> /path/to/descriptors.json
|
||||
```
|
||||
|
@ -58,7 +58,7 @@ The `watch_only_wallet` wallet will be used to track and validate incoming trans
|
|||
> `disable_private_keys` indicates that the wallet should refuse to import private keys, i.e. will be a dedicated watch-only wallet.
|
||||
|
||||
```sh
|
||||
[online]$ ./build/src/bitcoin-cli -signet -named createwallet \
|
||||
[online]$ ./build/bin/bitcoin-cli -signet -named createwallet \
|
||||
wallet_name="watch_only_wallet" \
|
||||
disable_private_keys=true \
|
||||
blank=true
|
||||
|
@ -71,7 +71,7 @@ The `watch_only_wallet` wallet will be used to track and validate incoming trans
|
|||
2. Import the `offline_wallet`s public key descriptors to the online `watch_only_wallet` using the `descriptors.json` file created on the offline wallet.
|
||||
|
||||
```sh
|
||||
[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" importdescriptors "$(cat /path/to/descriptors.json)"
|
||||
[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" importdescriptors "$(cat /path/to/descriptors.json)"
|
||||
|
||||
[
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ At this point, it's important to understand that both the `offline_wallet` and o
|
|||
1. Generate an address to receive coins. You can use _either_ the `offline_wallet` or the online `watch_only_wallet` to generate this address, as they will produce the same addresses. For the sake of this guide, we'll use the online `watch_only_wallet` to generate the address.
|
||||
|
||||
```sh
|
||||
[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" getnewaddress
|
||||
[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" getnewaddress
|
||||
|
||||
tb1qtu5qgc6ddhmqm5yqjvhg83qgk2t4ewajg0h6yh
|
||||
```
|
||||
|
@ -120,7 +120,7 @@ tb1qtu5qgc6ddhmqm5yqjvhg83qgk2t4ewajg0h6yh
|
|||
3. Confirm that coins were received using the online `watch_only_wallet`. Note that the transaction may take a few moments before being received on your local node, depending on its connectivity. Just re-run the command periodically until the transaction is received.
|
||||
|
||||
```sh
|
||||
[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" listunspent
|
||||
[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" listunspent
|
||||
|
||||
[
|
||||
{
|
||||
|
@ -149,7 +149,7 @@ tb1qtu5qgc6ddhmqm5yqjvhg83qgk2t4ewajg0h6yh
|
|||
2. Create a funded but unsigned PSBT to the destination address with the online `watch_only_wallet` by using `send [{"address":amount},...]` and export the unsigned PSBT to a file `funded_psbt.txt` for easy portability to the `offline_wallet` for signing:
|
||||
|
||||
```sh
|
||||
[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" send \
|
||||
[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" send \
|
||||
'{"tb1q9k5w0nhnhyeh78snpxh0t5t7c3lxdeg3erez32": 0.009}' \
|
||||
| jq -r '.psbt' \
|
||||
>> /path/to/funded_psbt.txt
|
||||
|
@ -166,13 +166,13 @@ cHNidP8BAHECAAAAAWLHKR9/xAjetzL/FCmZU5lbfINRMWPRPHWO68PfUzkPAQAAAAD9////AoA4AQAA
|
|||
Decode and analyze the unsigned PSBT on the `offline_wallet` using the `funded_psbt.txt` file:
|
||||
|
||||
```sh
|
||||
[offline]$ ./build/src/bitcoin-cli -signet decodepsbt $(cat /path/to/funded_psbt.txt)
|
||||
[offline]$ ./build/bin/bitcoin-cli -signet decodepsbt $(cat /path/to/funded_psbt.txt)
|
||||
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
[offline]$ ./build/src/bitcoin-cli -signet analyzepsbt $(cat /path/to/funded_psbt.txt)
|
||||
[offline]$ ./build/bin/bitcoin-cli -signet analyzepsbt $(cat /path/to/funded_psbt.txt)
|
||||
|
||||
{
|
||||
"inputs": [
|
||||
|
@ -203,13 +203,13 @@ Notice that the analysis of the PSBT shows that "signatures" are missing and sho
|
|||
Use the walletpassphrase command to unlock the `offline_wallet` with the passphrase. You should specify the passphrase and a timeout (in seconds) for how long you want the wallet to remain unlocked.
|
||||
|
||||
```sh
|
||||
[offline]$ ./build/src/bitcoin-cli -signet -rpcwallet="offline_wallet" walletpassphrase "** enter passphrase **" 60
|
||||
[offline]$ ./build/bin/bitcoin-cli -signet -rpcwallet="offline_wallet" walletpassphrase "** enter passphrase **" 60
|
||||
```
|
||||
|
||||
2. Process, sign and finalize the PSBT on the `offline_wallet` using the `walletprocesspsbt` command, saving the output to a file `final_psbt.txt`.
|
||||
|
||||
```sh
|
||||
[offline]$ ./build/src/bitcoin-cli -signet -rpcwallet="offline_wallet" walletprocesspsbt \
|
||||
[offline]$ ./build/bin/bitcoin-cli -signet -rpcwallet="offline_wallet" walletprocesspsbt \
|
||||
$(cat /path/to/funded_psbt.txt) \
|
||||
| jq -r .hex \
|
||||
>> /path/to/final_psbt.txt
|
||||
|
@ -219,7 +219,7 @@ Use the walletpassphrase command to unlock the `offline_wallet` with the passphr
|
|||
Broadcast the funded, signed and finalized PSBT `final_psbt.txt` using `sendrawtransaction` with an online node:
|
||||
|
||||
```sh
|
||||
[online]$ ./build/src/bitcoin-cli -signet sendrawtransaction $(cat /path/to/final_psbt.txt)
|
||||
[online]$ ./build/bin/bitcoin-cli -signet sendrawtransaction $(cat /path/to/final_psbt.txt)
|
||||
|
||||
c2430a0e46df472b04b0ca887bbcd5c4abf7b2ce2eb71de981444a80e2b96d52
|
||||
```
|
||||
|
@ -229,7 +229,7 @@ c2430a0e46df472b04b0ca887bbcd5c4abf7b2ce2eb71de981444a80e2b96d52
|
|||
Confirm the updated balance of the offline wallet using the `watch_only_wallet`.
|
||||
|
||||
```sh
|
||||
[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" getbalances
|
||||
[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" getbalances
|
||||
|
||||
{
|
||||
"mine": {
|
||||
|
@ -248,7 +248,7 @@ Confirm the updated balance of the offline wallet using the `watch_only_wallet`.
|
|||
You can also show transactions related to the wallet using `listtransactions`
|
||||
|
||||
```sh
|
||||
[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" listtransactions
|
||||
[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" listtransactions
|
||||
|
||||
{
|
||||
...
|
||||
|
|
|
@ -370,13 +370,13 @@ USDT support.
|
|||
To list probes in Bitcoin Core, use `info probes` in `gdb`:
|
||||
|
||||
```
|
||||
$ gdb ./build/src/bitcoind
|
||||
$ gdb ./build/bin/bitcoind
|
||||
…
|
||||
(gdb) info probes
|
||||
Type Provider Name Where Semaphore Object
|
||||
stap net inbound_message 0x000000000014419e 0x0000000000d29bd2 /build/src/bitcoind
|
||||
stap net outbound_message 0x0000000000107c05 0x0000000000d29bd0 /build/src/bitcoind
|
||||
stap validation block_connected 0x00000000002fb10c 0x0000000000d29bd8 /build/src/bitcoind
|
||||
stap net inbound_message 0x000000000014419e 0x0000000000d29bd2 /build/bin/bitcoind
|
||||
stap net outbound_message 0x0000000000107c05 0x0000000000d29bd0 /build/bin/bitcoind
|
||||
stap validation block_connected 0x00000000002fb10c 0x0000000000d29bd8 /build/bin/bitcoind
|
||||
…
|
||||
```
|
||||
|
||||
|
@ -386,7 +386,7 @@ The `readelf` tool can be used to display the USDT tracepoints in Bitcoin Core.
|
|||
Look for the notes with the description `NT_STAPSDT`.
|
||||
|
||||
```
|
||||
$ readelf -n ./build/src/bitcoind | grep NT_STAPSDT -A 4 -B 2
|
||||
$ readelf -n ./build/bin/bitcoind | grep NT_STAPSDT -A 4 -B 2
|
||||
Displaying notes found in: .note.stapsdt
|
||||
Owner Data size Description
|
||||
stapsdt 0x0000005d NT_STAPSDT (SystemTap probe descriptors)
|
||||
|
@ -410,7 +410,7 @@ between distributions. For example, on
|
|||
[ubuntu binary]: https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---binary
|
||||
|
||||
```
|
||||
$ tplist -l ./build/src/bitcoind -v
|
||||
$ tplist -l ./build/bin/bitcoind -v
|
||||
b'net':b'outbound_message' [sema 0xd29bd0]
|
||||
1 location(s)
|
||||
6 argument(s)
|
||||
|
|
|
@ -11,7 +11,7 @@ When following your systems build instructions, make sure to install the `Qt` de
|
|||
To run:
|
||||
|
||||
```sh
|
||||
./build/src/qt/bitcoin-qt
|
||||
./build/bin/bitcoin-qt
|
||||
```
|
||||
|
||||
## Files and Directories
|
||||
|
|
|
@ -24,7 +24,7 @@ tests from subtrees.
|
|||
|
||||
Run `test_bitcoin --list_content` for the full list of tests.
|
||||
|
||||
To run the unit tests manually, launch `build/src/test/test_bitcoin`. To recompile
|
||||
To run the unit tests manually, launch `build/bin/test_bitcoin`. To recompile
|
||||
after a test file was modified, run `cmake --build build` and then run the test again. If you
|
||||
modify a non-test file, use `cmake --build build --target test_bitcoin` to recompile only what's needed
|
||||
to run the unit tests.
|
||||
|
@ -33,7 +33,7 @@ To add more unit tests, add `BOOST_AUTO_TEST_CASE` functions to the existing
|
|||
.cpp files in the `test/` directory or add new .cpp files that
|
||||
implement new `BOOST_AUTO_TEST_SUITE` sections.
|
||||
|
||||
To run the GUI unit tests manually, launch `build/src/qt/test/test_bitcoin-qt`
|
||||
To run the GUI unit tests manually, launch `build/bin/test_bitcoin-qt`
|
||||
|
||||
To add more GUI unit tests, add them to the `src/qt/test/` directory and
|
||||
the `src/qt/test/test_main.cpp` file.
|
||||
|
@ -50,19 +50,19 @@ test_bitcoin --help
|
|||
For example, to run only the tests in the `getarg_tests` file, with full logging:
|
||||
|
||||
```bash
|
||||
build/src/test/test_bitcoin --log_level=all --run_test=getarg_tests
|
||||
build/bin/test_bitcoin --log_level=all --run_test=getarg_tests
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
build/src/test/test_bitcoin -l all -t getarg_tests
|
||||
build/bin/test_bitcoin -l all -t getarg_tests
|
||||
```
|
||||
|
||||
or to run only the doubledash test in `getarg_tests`
|
||||
|
||||
```bash
|
||||
build/src/test/test_bitcoin --run_test=getarg_tests/doubledash
|
||||
build/bin/test_bitcoin --run_test=getarg_tests/doubledash
|
||||
```
|
||||
|
||||
The `--log_level=` (or `-l`) argument controls the verbosity of the test output.
|
||||
|
@ -71,7 +71,7 @@ The `test_bitcoin` runner also accepts some of the command line arguments accept
|
|||
`bitcoind`. Use `--` to separate these sets of arguments:
|
||||
|
||||
```bash
|
||||
build/src/test/test_bitcoin --log_level=all --run_test=getarg_tests -- -printtoconsole=1
|
||||
build/bin/test_bitcoin --log_level=all --run_test=getarg_tests -- -printtoconsole=1
|
||||
```
|
||||
|
||||
The `-printtoconsole=1` after the two dashes sends debug logging, which
|
||||
|
@ -98,7 +98,7 @@ what the test wrote to `debug.log` after it completes, for example.
|
|||
so no leftover state is used.)
|
||||
|
||||
```bash
|
||||
$ build/src/test/test_bitcoin --run_test=getarg_tests/doubledash -- -testdatadir=/somewhere/mydatadir
|
||||
$ build/bin/test_bitcoin --run_test=getarg_tests/doubledash -- -testdatadir=/somewhere/mydatadir
|
||||
Test directory (will not be deleted): "/somewhere/mydatadir/test_common bitcoin/getarg_tests/doubledash/datadir"
|
||||
Running 1 test case...
|
||||
|
||||
|
@ -138,13 +138,13 @@ For debugging you can launch the `test_bitcoin` executable with `gdb` or `lldb`
|
|||
start debugging, just like you would with any other program:
|
||||
|
||||
```bash
|
||||
gdb build/src/test/test_bitcoin
|
||||
gdb build/bin/test_bitcoin
|
||||
```
|
||||
|
||||
#### Segmentation faults
|
||||
|
||||
If you hit a segmentation fault during a test run, you can diagnose where the fault
|
||||
is happening by running `gdb ./build/src/test/test_bitcoin` and then using the `bt` command
|
||||
is happening by running `gdb ./build/bin/test_bitcoin` and then using the `bt` command
|
||||
within gdb.
|
||||
|
||||
Another tool that can be used to resolve segmentation faults is
|
||||
|
@ -162,7 +162,7 @@ Running the tests and hitting a segmentation fault should now produce a file cal
|
|||
|
||||
You can then explore the core dump using
|
||||
```bash
|
||||
gdb build/src/test/test_bitcoin core
|
||||
gdb build/bin/test_bitcoin core
|
||||
|
||||
(gdb) bt # produce a backtrace for where a segfault occurred
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue