Skip to content

Commit

Permalink
scripted-diff: Adjust documentation per top-level target output location
Browse files Browse the repository at this point in the history
-BEGIN VERIFY SCRIPT-

ren() { sed -i "s|\<$1\>|$2|g" $( git grep -l "$1" :\(exclude\)./src/secp256k1 ) ; }

ren build/src/bitcoin-node build/libexec/bitcoin-node
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-
  • Loading branch information
hebasto committed Jan 10, 2025
1 parent cd52036 commit 8c44a94
Show file tree
Hide file tree
Showing 17 changed files with 95 additions and 95 deletions.
4 changes: 2 additions & 2 deletions contrib/signet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ 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

It defaults to estimating an nbits value resulting in 25s average time to find a block, but the --seconds parameter can be used to pick a different target, or the --nbits parameter can be used to estimate how long it will take for a given difficulty.

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
Expand Down
2 changes: 1 addition & 1 deletion contrib/tracing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions contrib/tracing/connectblock_benchmark.bt
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions contrib/tracing/log_p2p_traffic.bt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions contrib/tracing/log_utxos.bt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions contrib/valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions doc/benchmarking.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```
Expand All @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions doc/build-osx.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion doc/build-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 3 additions & 3 deletions doc/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
14 changes: 7 additions & 7 deletions doc/fuzzing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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),
Expand Down Expand Up @@ -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
Expand All @@ -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),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
```
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions doc/multiprocess.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/libexec/bitcoin-node -regtest -printtoconsole -debug=ipc
BITCOIND=$(pwd)/build/libexec/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).
Expand Down
Loading

0 comments on commit 8c44a94

Please sign in to comment.