9

net: Networking. All messages related to communicating with other nodes on the network, including what P2P messages were sent and received and to whom and other information about the network messages. tor: TOR. All messages related to using a TOR SOCKS5 proxy and TOR hidden service (used for receiving incoming connections over TOR). This includes messages ...


5

Bitcoin Core uses the autotools build system, but CLion only supports projects using CMake, so you can't use Core with CLion. You should be able to use Core with Eclipse CDT and NetBeans as those support Autotools. You may need to do some special configuring for it to work properly. Most people who work on Core just use text editors, command line build ...


3

To understand the functional tests, I think it's important to start with an understanding of how bitcoind works and how the RPC interface is used. Start Bitcoin Core in a terminal window in regtest mode (a local test network that does not connect to any peers by default): $ bitcoind -regtest Keep an eye on the output! This is your debug log, and important ...


3

You are confusing the two kinds of tests. Unit tests are compiled into a separate binary and run by make check. Functional tests are testing the RPC commands and have to be run explicitly using the test_runner.py script. test_framework.log is only created by the functional tests. The documentation for the unit tests can be found here. To print messages in ...


2

There is no "makefile" command. If you don't build the project, there is no way for you to debug it. The released binaries do not contain any debugging symbols so it will be very difficult for you to set breakpoints and see what is going on. So in order to do that, you will need to build the project from the source code that you downloaded. There are ...


2

There is an issue in the Bitcoin Core repo on the existing IDE options. Apparently it is/was possible to use CLion in debug mode but gdb or lldb are generally recommended for line by line debugging. There has been discussion about swapping out the existing MSVC build to use CMake but at the time of writing (September 2020) there is no open PR to do this. ...


2

CLion only supports using the CMake build system. However Bitcoin Core uses the autotools build system. Without some special configuring, it is unlikely that you will be able to build Bitcoin Core using CLion as the default CMake config will need to be modified to work with Bitcoin Core. Instead of using CLion to build and debug it, you should be able to ...


2

The block index and chain state databases are LevelDB databases. LevelDB has its own caching and cache management. So 2 MiB is being allocated for the block index's LevelDB database cache, and 8 MiB is being allocated for the chain state's LevelDB database cache. However Bitcoin Core does additional caching by itself, particularly for the UTXO set, which is ...


2

If you watched Fabian's presentation (or read the transcript) you'll have seen that he said you can use Valgrind for memory leak checks and that it can be used similarly to lldb. valgrind --leak-check=yes src/bitcoind -regtest There is a section in Fabian's doc on debugging Bitcoin with instructions on how to install Valgrind on MacOS and run it. Install ...


2

OP_CHECKLOCKTIMEVERIFY verifies, as the name implies, the locktime. It does not verify the time. In other words, it checks the transaction's nLockTime field against the value provided in the opcode. The current block height or time is irrelevant for the opcode directly. Of course, the net effect of this opcode is restricting when the transaction can be mined....


1

I found a solution to work with VSCode, and use it for compilation. Install vscode on your machine, including the C/C++ development extension Create a directory named .vscode in the root of bitcoin repository folder Create a .vscode/c_cpp_properties.json file. This file contains the configuration for the C/C++ project, including compiler type and source ...


1

0xB10C answered this on Mastodon. Alternative answers are welcome. We implement our own tracepoints in our userspace application (Bitcoin Core) and write custom scripts to get insights into the parts we find important. Tracing via USDT and debugging are two very different things. You can use tracing via USDT as part of the search for a bug but you can't ...


1

There are a few different resources I would point you to. For more information on functional tests in Bitcoin Core (with guidance on writing them) I would check out the functional tests README. For a case study on debugging the functional tests Sjors Provoost wrote a blog post back in 2017. (Some of it may now be outdated but the general thought process is ...


1

As of PR #16435 --enable-debug is actually setting "-O0", so there should be no optimization at all anymore.


1

Bitcoin Core disables -O2 and enables -Og when --enable-debug is set. -Og is intended for debugging; however, it removes some of the debugging information and is buggy. To disable it and to improve debugging experience, I suggest changing between L256 and L278 to: CXXFLAGS="-ggdb3 -ftrapv" -ggdb3 is more powerful than -g3, it uses a GDB-only, LLDB-...


1

I figured it out. setps: Get the transactionID RPCCall getRawTransaction transactionID - copy the rawTransaction RPCCall decoderawtransaction rawTransaction - copy the scriptPubKey RPCCall decodescript scriptPubKey


Only top voted, non community-wiki answers of a minimum length are eligible