The following diagram gives a brief overview of how some of the major components in bitcoind are related.
Warning
|
This diagram is not exhaustive and includes simplifications. |
Note
|
dashed lines indicate optional components |
bitcoind
overviewflowchart LR bitcoind RPCServer -.-> bitcoind RESTServer -.-> bitcoind Node -----> bitcoind AddrMan --> Node CConnman --> Node Interfaces::Chain --> Node ChainstateManager --> Node NetGroupManager --> AddrMan CTxMemPool --> Node PeerManager --> Node Wallet -.-> bitcoind ScriptPubKeyMan --> Wallet WalletDatabase --> Wallet sqlite -.-> WalletDatabase BDB -.-> WalletDatabase Logger --> bitcoind ZMQ -.-> bitcoind BlockManager --> ChainstateManager LevelDB --> BlockManager
bitcoind
overviewComponent | Simplified description |
---|---|
|
Manage peers' network addresses |
|
Manage network connections to peers |
|
Give clients access to chain state, fee rate estimates, notifications and allow tx submission |
|
An interface for interacting with 1 or 2 chainstates (1. IBD-verified, 2. optional snapshot) |
|
Manage net groups. Ensure we don’t connect to multiple nodes in the same ASN bucket |
|
Validate and store (valid) transactions which may be included in the next block |
|
Manage peer state and interaction e.g. processing messages, fetching blocks & removing for misbehaviour |
|
Maintains a tree of blocks on disk (via LevelDB) to determine most-work tip |
|
Manages |
The following diagram gives a brief overview of the major components in bitcoin-cli.
Warning
|
This diagram is not exhaustive and includes simplifications. |
bitcoin-cli
overviewflowchart LR BaseRequestHandler["BaseRequestHandler()"] AddrInfoRequestHandler["AddrInfoRequestHandler()"] ConnectAndCallRPC["ConnectAndCallRPC()"] GetInfoRequestHandler["GetInfoRequestHandler()"] NetInfoRequestHandler["NetInfoRequestHandler()"] GenerateToAddressHandler["GenerateToAddressHandler()"] DefaultRequestHandler["DefaultRequestHandler()"] BaseRequestHandler --> AddrInfoRequestHandler --> ConnectAndCallRPC BaseRequestHandler --> GetInfoRequestHandler --> ConnectAndCallRPC BaseRequestHandler --> NetInfoRequestHandler --> ConnectAndCallRPC BaseRequestHandler --> GenerateToAddressHandler --> ConnectAndCallRPC BaseRequestHandler --> DefaultRequestHandler --> ConnectAndCallRPC ConnectAndCallRPC <---> bitcoin-cli ArgsManager --> bitcoin-cli
The following diagram gives a brief overview of how the wallet is structured.
Warning
|
This diagram is not exhaustive and includes simplifications. |
Note
|
dashed lines indicate optional components |
flowchart LR ScriptPubKeyMan --> DescriptorScriptPubKeyMan ScriptPubKeyMan --> LegacyScriptPubKeyMan subgraph Descriptor or Legacy wallet DescriptorScriptPubKeyMan LegacyScriptPubKeyMan end DescriptorScriptPubKeyMan -.-> CWallet LegacyScriptPubKeyMan -.-> CWallet Interfaces::Chain --> CWallet WalletDatabase --> CWallet cs_wallet{{cs_wallet}} ---> CWallet subgraph BDB or sqlite database BDB sqlite end BDB -.-> WalletDatabase sqlite -.-> WalletDatabase SigningProvider --> ScriptPubKeyMan WalletStorage --> ScriptPubKeyMan Scripts --> ScriptPubKeyMan Keys --> ScriptPubKeyMan
Component | Simplified description |
---|---|
|
Represents a single wallet. Handles reads and writes to disk |
|
Base class for the below SPKM classes to override before being used by |
|
A SPKM for descriptor-based wallets |
|
A SPKM for legacy wallets |
|
An interface for a |
|
Give clients access to chain state, fee rate estimates, notifications and allow tx submission |
|
The primary wallet lock, held for atomic wallet operations |