From 0ea19394ea1beffaf404ef009b08a439482ef30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Wed, 28 Aug 2024 15:29:26 +0200 Subject: [PATCH] Move binary path in docs from ./src to ./build/src --- contrib/devtools/gen-manpages.py | 12 ++--- contrib/devtools/test_utxo_snapshots.sh | 20 ++++---- contrib/devtools/utxo_snapshot.sh | 4 +- contrib/tracing/README.md | 10 ++-- contrib/tracing/connectblock_benchmark.bt | 6 +-- contrib/tracing/log_p2p_traffic.bt | 4 +- contrib/tracing/log_utxos.bt | 8 ++-- doc/build-osx.md | 4 +- doc/developer-notes.md | 6 +-- doc/multisig-tutorial.md | 56 +++++++++++------------ doc/offline-signing-tutorial.md | 28 ++++++------ doc/tracing.md | 12 ++--- src/qt/README.md | 2 +- 13 files changed, 86 insertions(+), 86 deletions(-) diff --git a/contrib/devtools/gen-manpages.py b/contrib/devtools/gen-manpages.py index 92acd9a40373c..0e71f6908dff3 100755 --- a/contrib/devtools/gen-manpages.py +++ b/contrib/devtools/gen-manpages.py @@ -8,12 +8,12 @@ import tempfile BINARIES = [ -'src/bitcoind', -'src/bitcoin-cli', -'src/bitcoin-tx', -'src/bitcoin-wallet', -'src/bitcoin-util', -'src/qt/bitcoin-qt', +'build/src/bitcoind', +'build/src/bitcoin-cli', +'build/src/bitcoin-tx', +'build/src/bitcoin-wallet', +'build/src/bitcoin-util', +'build/src/qt/bitcoin-qt', ] # Paths to external utilities. diff --git a/contrib/devtools/test_utxo_snapshots.sh b/contrib/devtools/test_utxo_snapshots.sh index ad948d4a1422d..a950beac84de9 100755 --- a/contrib/devtools/test_utxo_snapshots.sh +++ b/contrib/devtools/test_utxo_snapshots.sh @@ -64,10 +64,10 @@ trap finish EXIT EARLY_IBD_FLAGS="-maxtipage=9223372036854775207 -minimumchainwork=0x00" server_rpc() { - ./src/bitcoin-cli -rpcport=$SERVER_RPC_PORT -datadir="$SERVER_DATADIR" "$@" + ./build/src/bitcoin-cli -rpcport=$SERVER_RPC_PORT -datadir="$SERVER_DATADIR" "$@" } client_rpc() { - ./src/bitcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir="$CLIENT_DATADIR" "$@" + ./build/src/bitcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir="$CLIENT_DATADIR" "$@" } server_sleep_til_boot() { while ! server_rpc ping >/dev/null 2>&1; do sleep 0.1; done @@ -111,14 +111,14 @@ read -p "Press [enter] to continue" _ echo echo "-- IBDing the blocks (height=$BASE_HEIGHT) required to the server node..." # shellcheck disable=SC2086 -./src/bitcoind -logthreadnames=1 $SERVER_PORTS \ +./build/src/bitcoind -logthreadnames=1 $SERVER_PORTS \ -datadir="$SERVER_DATADIR" $EARLY_IBD_FLAGS -stopatheight="$BASE_HEIGHT" >/dev/null echo echo "-- Creating snapshot at ~ height $BASE_HEIGHT ($UTXO_DAT_FILE)..." server_sleep_til_shutdown # wait for stopatheight to be hit # shellcheck disable=SC2086 -./src/bitcoind -logthreadnames=1 $SERVER_PORTS \ +./build/src/bitcoind -logthreadnames=1 $SERVER_PORTS \ -datadir="$SERVER_DATADIR" $EARLY_IBD_FLAGS -connect=0 -listen=0 >/dev/null & SERVER_PID="$!" @@ -143,13 +143,13 @@ echo echo echo "-- IBDing more blocks to the server node (height=$FINAL_HEIGHT) so there is a diff between snapshot and tip..." # shellcheck disable=SC2086 -./src/bitcoind $SERVER_PORTS -logthreadnames=1 -datadir="$SERVER_DATADIR" \ +./build/src/bitcoind $SERVER_PORTS -logthreadnames=1 -datadir="$SERVER_DATADIR" \ $EARLY_IBD_FLAGS -stopatheight="$FINAL_HEIGHT" >/dev/null echo echo "-- Starting the server node to provide blocks to the client node..." # shellcheck disable=SC2086 -./src/bitcoind $SERVER_PORTS -logthreadnames=1 -debug=net -datadir="$SERVER_DATADIR" \ +./build/src/bitcoind $SERVER_PORTS -logthreadnames=1 -debug=net -datadir="$SERVER_DATADIR" \ $EARLY_IBD_FLAGS -connect=0 -listen=1 >/dev/null & SERVER_PID="$!" server_sleep_til_boot @@ -173,7 +173,7 @@ read -p "When you're ready for all this, hit [enter]" _ echo echo "-- Starting the client node to get headers from the server, then load the snapshot..." # shellcheck disable=SC2086 -./src/bitcoind $CLIENT_PORTS $ALL_INDEXES -logthreadnames=1 -datadir="$CLIENT_DATADIR" \ +./build/src/bitcoind $CLIENT_PORTS $ALL_INDEXES -logthreadnames=1 -datadir="$CLIENT_DATADIR" \ -connect=0 -addnode=127.0.0.1:$SERVER_PORT -debug=net $EARLY_IBD_FLAGS >/dev/null & CLIENT_PID="$!" client_sleep_til_boot @@ -186,7 +186,7 @@ echo echo "-- Loading UTXO snapshot into client. Calling RPC in a loop..." while ! client_rpc loadtxoutset "$UTXO_DAT_FILE" ; do sleep 10; done -watch -n 0.3 "( tail -n 14 $CLIENT_DATADIR/debug.log ; echo ; ./src/bitcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir=$CLIENT_DATADIR getchainstates) | cat" +watch -n 0.3 "( tail -n 14 $CLIENT_DATADIR/debug.log ; echo ; ./build/src/bitcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir=$CLIENT_DATADIR getchainstates) | cat" echo echo "-- Okay, now I'm going to restart the client to make sure that the snapshot chain reloads " @@ -198,12 +198,12 @@ read -p "Press [enter] to continue" client_sleep_til_boot # shellcheck disable=SC2086 -./src/bitcoind $CLIENT_PORTS $ALL_INDEXES -logthreadnames=1 -datadir="$CLIENT_DATADIR" -connect=0 \ +./build/src/bitcoind $CLIENT_PORTS $ALL_INDEXES -logthreadnames=1 -datadir="$CLIENT_DATADIR" -connect=0 \ -addnode=127.0.0.1:$SERVER_PORT "$EARLY_IBD_FLAGS" >/dev/null & CLIENT_PID="$!" client_sleep_til_boot -watch -n 0.3 "( tail -n 14 $CLIENT_DATADIR/debug.log ; echo ; ./src/bitcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir=$CLIENT_DATADIR getchainstates) | cat" +watch -n 0.3 "( tail -n 14 $CLIENT_DATADIR/debug.log ; echo ; ./build/src/bitcoin-cli -rpcport=$CLIENT_RPC_PORT -datadir=$CLIENT_DATADIR getchainstates) | cat" echo echo "-- Done!" diff --git a/contrib/devtools/utxo_snapshot.sh b/contrib/devtools/utxo_snapshot.sh index e8781d94d920f..0f8bdd6e501d4 100755 --- a/contrib/devtools/utxo_snapshot.sh +++ b/contrib/devtools/utxo_snapshot.sh @@ -18,8 +18,8 @@ if (( $# < 3 )); then echo echo 'Examples:' echo - echo " ./contrib/devtools/utxo_snapshot.sh 570000 utxo.dat ./src/bitcoin-cli -datadir=\$(pwd)/testdata" - echo ' ./contrib/devtools/utxo_snapshot.sh 570000 - ./src/bitcoin-cli' + echo " ./contrib/devtools/utxo_snapshot.sh 570000 utxo.dat ./build/src/bitcoin-cli -datadir=\$(pwd)/testdata" + echo ' ./contrib/devtools/utxo_snapshot.sh 570000 - ./build/src/bitcoin-cli' exit 1 fi diff --git a/contrib/tracing/README.md b/contrib/tracing/README.md index 206bec1647880..c471770a7d73b 100644 --- a/contrib/tracing/README.md +++ b/contrib/tracing/README.md @@ -82,7 +82,7 @@ about the connection. Peers can be selected individually to view recent P2P messages. ``` -$ python3 contrib/tracing/p2p_monitor.py ./src/bitcoind +$ python3 contrib/tracing/p2p_monitor.py ./build/src/bitcoind ``` Lists selectable peers and traffic and connection information. @@ -150,7 +150,7 @@ lost. BCC prints: `Possibly lost 2 samples` on lost messages. ``` -$ python3 contrib/tracing/log_raw_p2p_msgs.py ./src/bitcoind +$ python3 contrib/tracing/log_raw_p2p_msgs.py ./build/src/bitcoind ``` ``` @@ -188,7 +188,7 @@ In a different terminal, starting Bitcoin Core in SigNet mode and with re-indexing enabled. ``` -$ ./src/bitcoind -signet -reindex +$ ./build/src/bitcoind -signet -reindex ``` This produces the following output. @@ -241,7 +241,7 @@ A BCC Python script to log the UTXO cache flushes. Based on the `utxocache:flush` tracepoint. ```bash -$ python3 contrib/tracing/log_utxocache_flush.py ./src/bitcoind +$ python3 contrib/tracing/log_utxocache_flush.py ./build/src/bitcoind ``` ``` @@ -300,7 +300,7 @@ comprising a timestamp along with all event data available via the event's tracepoint. ```console -$ python3 contrib/tracing/mempool_monitor.py ./src/bitcoind +$ python3 contrib/tracing/mempool_monitor.py ./build/src/bitcoind ``` ``` diff --git a/contrib/tracing/connectblock_benchmark.bt b/contrib/tracing/connectblock_benchmark.bt index 6e7a98ef07664..4aa4742103110 100755 --- a/contrib/tracing/connectblock_benchmark.bt +++ b/contrib/tracing/connectblock_benchmark.bt @@ -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 './src/bitcoind'. This can be modified in the script below. + located in './build/src/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:./src/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2 == 0 )/ +usdt:./build/src/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2 == 0 )/ { $height = arg1; $transactions = arg2; @@ -102,7 +102,7 @@ usdt:./src/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2 blocks where the time it took to connect the block is above the . */ -usdt:./src/bitcoind:validation:block_connected / (uint64) arg5 / 1000> $3 / +usdt:./build/src/bitcoind:validation:block_connected / (uint64) arg5 / 1000> $3 / { $hash = arg0; $height = (int32) arg1; diff --git a/contrib/tracing/log_p2p_traffic.bt b/contrib/tracing/log_p2p_traffic.bt index f62956aa5e1c3..89e5b777be98d 100755 --- a/contrib/tracing/log_p2p_traffic.bt +++ b/contrib/tracing/log_p2p_traffic.bt @@ -5,7 +5,7 @@ BEGIN printf("Logging P2P traffic\n") } -usdt:./src/bitcoind:net:inbound_message +usdt:./build/src/bitcoind:net:inbound_message { $peer_id = (int64) arg0; $peer_addr = str(arg1); @@ -15,7 +15,7 @@ usdt:./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:./src/bitcoind:net:outbound_message +usdt:./build/src/bitcoind:net:outbound_message { $peer_id = (int64) arg0; $peer_addr = str(arg1); diff --git a/contrib/tracing/log_utxos.bt b/contrib/tracing/log_utxos.bt index 54d5010f825e4..a04f22115791a 100755 --- a/contrib/tracing/log_utxos.bt +++ b/contrib/tracing/log_utxos.bt @@ -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 './src/bitcoind'. This can be modified in the script below. + located in './build/src/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:./src/bitcoind:utxocache:add +usdt:./build/src/bitcoind:utxocache:add { $txid = arg0; $index = (uint32)arg1; @@ -44,7 +44,7 @@ usdt:./src/bitcoind:utxocache:add /* Attaches to the 'utxocache:spent' tracepoint and prints spents from the UTXO set cache. */ -usdt:./src/bitcoind:utxocache:spent +usdt:./build/src/bitcoind:utxocache:spent { $txid = arg0; $index = (uint32)arg1; @@ -66,7 +66,7 @@ usdt:./src/bitcoind:utxocache:spent /* Attaches to the 'utxocache:uncache' tracepoint and uncache UTXOs from the UTXO set cache. */ -usdt:./src/bitcoind:utxocache:uncache +usdt:./build/src/bitcoind:utxocache:uncache { $txid = arg0; $index = (uint32)arg1; diff --git a/doc/build-osx.md b/doc/build-osx.md index 161ba395b06cc..781794c5e1517 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -239,8 +239,8 @@ cmake --build build --target deploy ## Running Bitcoin Core -Bitcoin Core should now be available at `./src/bitcoind`. -If you compiled support for the GUI, it should be available at `./src/qt/bitcoin-qt`. +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`. 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. diff --git a/doc/developer-notes.md b/doc/developer-notes.md index dadcb05acc655..0f43380090444 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -229,13 +229,13 @@ The output is denoised of errors from external dependencies. To run clang-tidy on all source files: ```sh -( cd ./src/ && run-clang-tidy -j $(nproc) ) +( cd ./build && run-clang-tidy -p . -j $(nproc) ) ``` To run clang-tidy on the changed source lines: ```sh -git diff | ( cd ./src/ && clang-tidy-diff -p2 -j $(nproc) ) +git diff | ( cd ./build && clang-tidy-diff -p1 -j $(nproc) ) ``` Coding Style (Python) @@ -471,7 +471,7 @@ in-tree. Example use: $ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \ --show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite -$ valgrind -v --leak-check=full src/bitcoind -printtoconsole +$ valgrind -v --leak-check=full build/src/bitcoind -printtoconsole $ ./test/functional/test_runner.py --valgrind ``` diff --git a/doc/multisig-tutorial.md b/doc/multisig-tutorial.md index f47dd08ad1a3a..1f21acc2be9d6 100644 --- a/doc/multisig-tutorial.md +++ b/doc/multisig-tutorial.md @@ -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 -./src/bitcoind -signet -daemon +./build/src/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 - ./src/bitcoin-cli -signet createwallet "participant_${n}" + ./build/src/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}"]=$(./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/src/bitcoin-cli -signet -rpcwallet="participant_${n}" listdescriptors | jq '.descriptors | [.[] | select(.desc | startswith("wpkh") and contains("/1/*"))][0] | .desc' | grep -Po '(?<=\().*(?=\))') - xpubs["external_xpub_${n}"]=$(./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/src/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=$(./src/bitcoin-cli -signet getdescriptorinfo $external_desc | jq '.descriptor') -internal_desc_sum=$(./src/bitcoin-cli -signet getdescriptorinfo $internal_desc | jq '.descriptor') +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') 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 `./src/bitcoin-cli help importdescriptors`. +Documentation for these and other parameters can be found by typing `./build/src/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 -./src/bitcoin-cli -signet -named createwallet wallet_name="multisig_wallet_01" disable_private_keys=true blank=true +./build/src/bitcoin-cli -signet -named createwallet wallet_name="multisig_wallet_01" disable_private_keys=true blank=true -./src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" importdescriptors "$multisig_desc" +./build/src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" importdescriptors "$multisig_desc" -./src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getwalletinfo +./build/src/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 ./src/bitcoin-cli -signet loadwallet "participant_${n}"; done +for ((n=1;n<=3;n++)); do ./build/src/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=$(./src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getnewaddress) +receiving_address=$(./build/src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getnewaddress) -./contrib/signet/getcoins.py -c ./src/bitcoin-cli -a $receiving_address +./contrib/signet/getcoins.py -c ./build/src/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 -./src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalances +./build/src/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=$(./src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalance) +balance=$(./build/src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalance) amount=$(echo "$balance * 0.8" | bc -l | sed -e 's/^\./0./' -e 's/^-\./-0./') -destination_addr=$(./src/bitcoin-cli -signet -rpcwallet="participant_1" getnewaddress) +destination_addr=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_1" getnewaddress) -funded_psbt=$(./src/bitcoin-cli -signet -named -rpcwallet="multisig_wallet_01" walletcreatefundedpsbt outputs="{\"$destination_addr\": $amount}" | jq -r '.psbt') +funded_psbt=$(./build/src/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 -./src/bitcoin-cli -signet decodepsbt $funded_psbt +./build/src/bitcoin-cli -signet decodepsbt $funded_psbt -./src/bitcoin-cli -signet analyzepsbt $funded_psbt +./build/src/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=$(./src/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq '.psbt') +psbt_1=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq '.psbt') -psbt_2=$(./src/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $funded_psbt | jq '.psbt') +psbt_2=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $funded_psbt | jq '.psbt') ``` ### 1.8 Combine the PSBT @@ -203,7 +203,7 @@ psbt_2=$(./src/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt 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=$(./src/bitcoin-cli -signet combinepsbt "[$psbt_1, $psbt_2]") +combined_psbt=$(./build/src/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=$(./src/bitcoin-cli -signet finalizepsbt $combined_psbt | jq -r '.hex') +finalized_psbt_hex=$(./build/src/bitcoin-cli -signet finalizepsbt $combined_psbt | jq -r '.hex') -./src/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex +./build/src/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=$(./src/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq -r '.psbt') +psbt_1=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq -r '.psbt') -psbt_2=$(./src/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $psbt_1 | jq -r '.psbt') +psbt_2=$(./build/src/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $psbt_1 | jq -r '.psbt') -finalized_psbt_hex=$(./src/bitcoin-cli -signet finalizepsbt $psbt_2 | jq -r '.hex') +finalized_psbt_hex=$(./build/src/bitcoin-cli -signet finalizepsbt $psbt_2 | jq -r '.hex') -./src/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex +./build/src/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex ``` diff --git a/doc/offline-signing-tutorial.md b/doc/offline-signing-tutorial.md index 401ee52c1c5de..e03a0003a10a5 100644 --- a/doc/offline-signing-tutorial.md +++ b/doc/offline-signing-tutorial.md @@ -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]$ ./src/bitcoin-cli -signet -named createwallet \ +[offline]$ ./build/src/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]$ ./src/bitcoin-cli -signet -rpcwallet="offline_wallet" listdescriptors \ +[offline]$ ./build/src/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]$ ./src/bitcoin-cli -signet -named createwallet \ +[online]$ ./build/src/bitcoin-cli -signet -named createwallet \ wallet_name="watch_only_wallet" \ disable_private_keys=true @@ -70,7 +70,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]$ ./src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" importdescriptors "$(cat /path/to/descriptors.json)" +[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" importdescriptors "$(cat /path/to/descriptors.json)" [ { @@ -109,7 +109,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]$ ./src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" getnewaddress +[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" getnewaddress tb1qtu5qgc6ddhmqm5yqjvhg83qgk2t4ewajg0h6yh ``` @@ -119,7 +119,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]$ ./src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" listunspent +[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" listunspent [ { @@ -148,7 +148,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]$ ./src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" send \ +[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" send \ '{"tb1q9k5w0nhnhyeh78snpxh0t5t7c3lxdeg3erez32": 0.009}' \ | jq -r '.psbt' \ >> /path/to/funded_psbt.txt @@ -165,13 +165,13 @@ cHNidP8BAHECAAAAAWLHKR9/xAjetzL/FCmZU5lbfINRMWPRPHWO68PfUzkPAQAAAAD9////AoA4AQAA Decode and analyze the unsigned PSBT on the `offline_wallet` using the `funded_psbt.txt` file: ```sh -[offline]$ ./src/bitcoin-cli -signet decodepsbt $(cat /path/to/funded_psbt.txt) +[offline]$ ./build/src/bitcoin-cli -signet decodepsbt $(cat /path/to/funded_psbt.txt) { ... } -[offline]$ ./src/bitcoin-cli -signet analyzepsbt $(cat /path/to/funded_psbt.txt) +[offline]$ ./build/src/bitcoin-cli -signet analyzepsbt $(cat /path/to/funded_psbt.txt) { "inputs": [ @@ -202,13 +202,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]$ ./src/bitcoin-cli -signet -rpcwallet="offline_wallet" walletpassphrase "** enter passphrase **" 60 +[offline]$ ./build/src/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]$ ./src/bitcoin-cli -signet -rpcwallet="offline_wallet" walletprocesspsbt \ +[offline]$ ./build/src/bitcoin-cli -signet -rpcwallet="offline_wallet" walletprocesspsbt \ $(cat /path/to/funded_psbt.txt) \ | jq -r .hex \ >> /path/to/final_psbt.txt @@ -218,7 +218,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]$ ./src/bitcoin-cli -signet sendrawtransaction $(cat /path/to/final_psbt.txt) +[online]$ ./build/src/bitcoin-cli -signet sendrawtransaction $(cat /path/to/final_psbt.txt) c2430a0e46df472b04b0ca887bbcd5c4abf7b2ce2eb71de981444a80e2b96d52 ``` @@ -228,7 +228,7 @@ c2430a0e46df472b04b0ca887bbcd5c4abf7b2ce2eb71de981444a80e2b96d52 Confirm the updated balance of the offline wallet using the `watch_only_wallet`. ```sh -[online]$ ./src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" getbalances +[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" getbalances { "mine": { @@ -247,7 +247,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]$ ./src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" listtransactions +[online]$ ./build/src/bitcoin-cli -signet -rpcwallet="watch_only_wallet" listtransactions { ... diff --git a/doc/tracing.md b/doc/tracing.md index 0e3414205abe3..3948b1ab49972 100644 --- a/doc/tracing.md +++ b/doc/tracing.md @@ -366,13 +366,13 @@ USDT support. To list probes in Bitcoin Core, use `info probes` in `gdb`: ``` -$ gdb ./src/bitcoind +$ gdb ./build/src/bitcoind … (gdb) info probes Type Provider Name Where Semaphore Object -stap net inbound_message 0x000000000014419e /src/bitcoind -stap net outbound_message 0x0000000000107c05 /src/bitcoind -stap validation block_connected 0x00000000002fb10c /src/bitcoind +stap net inbound_message 0x000000000014419e /build/src/bitcoind +stap net outbound_message 0x0000000000107c05 /build/src/bitcoind +stap validation block_connected 0x00000000002fb10c /build/src/bitcoind … ``` @@ -382,7 +382,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 ./src/bitcoind | grep NT_STAPSDT -A 4 -B 2 +$ readelf -n ./build/src/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) @@ -406,7 +406,7 @@ between distributions. For example, on [ubuntu binary]: https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---binary ``` -$ tplist -l ./src/bitcoind -v +$ tplist -l ./build/src/bitcoind -v b'net':b'outbound_message' [sema 0x0] 1 location(s) 6 argument(s) diff --git a/src/qt/README.md b/src/qt/README.md index 124f08e8fab8d..1c6f963ccf06e 100644 --- a/src/qt/README.md +++ b/src/qt/README.md @@ -11,7 +11,7 @@ When following your systems build instructions, make sure to install the `Qt` de To run: ```sh -./src/qt/bitcoin-qt +./build/src/qt/bitcoin-qt ``` ## Files and Directories