Author

Topic: How to find the right module in bitcoin core ? (Read 191 times)

brand new
Activity: 0
Merit: 0
November 19, 2020, 01:31:13 PM
#5
It would be nice if your Electrum Wallet could just get blockchain data from your own Bitcoin Core, but it can’t. It needs an Electrum Server to be the middle man. The server does not copy the Blockchain data, Management Systems Inc Student Loan, it is not a node — Bitcoin Core is.
brand new
Activity: 0
Merit: 0
This module is a pure Perl implementation of the methods that are currently part of the Bitcoin Core RPC client calls (bitcoin-CLI). The method names and
parameters are identical between the Bitcoin Core API and this module Advanced Capital Solutions Debt Collection
brand new
Activity: 0
Merit: 0
We've looked at gossip protocols in the abstract. It's now time to apply those abstractions to Bitcoin's own P2P network telephone merchant credit bureau debt harassment At a high level, almost all cryptocurrencies inherit the same P2P network design from Bitcoin. With Gnutella as background, you should now be fully equipped to understand Bitcoin's networking layer.
staff
Activity: 3458
Merit: 6793
Just writing some code
Bitcoin Core interacts with the outside world primarily through 3 ways: the P2P network, RPC interface, and GUI. The RPC and GUI to roughly the same things, and it's easier to understand RPCs, so I will ignore the GUI for now.

When you want to see what happens when a user does some action, find the RPC for that action. Then you can find the function that handles that RPC in the code, and follow what it does from there. All of the RPCs can be find in the files in src/rpc/, in src/wallet/rpcwallet.cpp, or in src/wallet/rpcdump.cpp. The functions are named the same as the RPC itself so they should be easy to find.

For example, if you want to learn how message signing works, you would first look at the list of RPCs using the help RPC. Then you would see a command called signmessage. You can even look at the help text for signmessage by doing help signmessage. This would tell you that this RPC is what you would use to sign a message. Now you can search for a function named signmessage in the code. You can do this with git grep. Because it is a function, you can append a parentheses to filter out other uses of signmessage. So you would do git grep -n "signmessage(" (the -n tells git grep to print out the line numbers too. The result is that you see that there is a function signmessage() in src/wallet/rpcwallet.cpp. Now you can go there, find the function, and trace what it calls.

The other way in which Bitcoin Core receives data is through the P2P network. All of the handling of network messages is done in src/net_processing.cpp in a function named ProcessMessage. This function has several ifs to identify what type of message each message is and apply the appropriate processing. So you can search within this function for the network message that you want and trace from there how that is being handled.

For example, if you wanted to learn how blocks were processed, you would look in ProcessMessage for the block message. You would look for if (msg_type == NetMsgType::BLOCK). Once you find it, you can just trace the code to see how blocks are being handled and processed.
newbie
Activity: 2
Merit: 0
I am trying to learn how the bitcoin core source code functions so that I can test out few ideas I have in my head.
But for that I need to know which functions are used in every module.
The source code is so vast that I am confused now. Can anyone tell me how do I find the right module to start learning the code ?

For example if I want to learn how the code works for signing a message where should I begin with ?
I know one module will lead to another but where should I start from for that particular task (i.e. signing a message)?
Jump to: