|
5 | 5 | == Library structure |
6 | 6 |
|
7 | 7 | Bitcoin Core compilation outputs a number of libraries, some which are designed to be used internally, and some which are designed to be re-used by external applications. |
8 | | -The internally-used libraries generally have unstable APIs making them unsuitable for re-use, but `libbitcoin_consensus` and `libbitcoin_kernel` are designed to be re-used by external applications. |
| 8 | +The internally-used libraries generally have unstable APIs making them unsuitable for re-use, but `libbitcoin_kernel` (still a WIP) is designed to be re-used by external applications. |
9 | 9 |
|
10 | 10 | Bitcoin Core has a https://github.com/bitcoin/bitcoin/blob/master/doc/design/libraries.md[guide^] which describes the various libraries, their conventions, and their various dependencies. |
11 | | -The dependency graph is shown below for convenience, but may not be up-to-date with the Bitcoin Core document. |
12 | 11 |
|
13 | 12 | [id=library-dependency-graph] |
14 | 13 | .Bitcoin library dependency graph |
15 | | -[mermaid, target=bitcoin-lib-dependencies] |
| 14 | +[mermaid, target=bitcoion-lib-dependencies] |
| 15 | + |
16 | 16 | .... |
17 | 17 | flowchart TB |
18 | | - bitcoin-wallet --> libbitcoin_wallet_tool |
19 | | - bitcoin-wallet --> libbitcoin_wallet |
20 | 18 |
|
21 | | - bitcoin-qt ---> libbitcoin_wallet |
22 | | - bitcoin-qt ---> libbitcoinqt |
23 | | - bitcoin-qt ---> libbitcoin_node |
| 19 | +bitcoin-cli-->libbitcoin_cli; |
| 20 | +
|
| 21 | +bitcoind-->libbitcoin_node; |
| 22 | +bitcoind-->libbitcoin_wallet; |
| 23 | +
|
| 24 | +bitcoin-qt-->libbitcoin_node; |
| 25 | +bitcoin-qt-->libbitcoinqt; |
| 26 | +bitcoin-qt-->libbitcoin_wallet; |
| 27 | +
|
| 28 | +bitcoin-wallet-->libbitcoin_wallet; |
| 29 | +bitcoin-wallet-->libbitcoin_common; |
| 30 | +bitcoin-wallet-->libbitcoin_util; |
| 31 | +
|
| 32 | +bitcoin-node-->libbitcoin_node; |
| 33 | +bitcoin-node-->libbitcoin_ipc; |
| 34 | +bitcoin-node-->libbitcoin_wallet; |
| 35 | +
|
| 36 | +bitcoin-gui-->libbitcoinqt; |
| 37 | +bitcoin-gui-->libbitcoin_node; |
| 38 | +bitcoin-gui-->libbitcoin_ipc; |
| 39 | +
|
| 40 | +libbitcoin_cli-->libbitcoin_common; |
| 41 | +libbitcoin_cli-->libbitcoin_util; |
24 | 42 |
|
25 | | - bitcoind ---> libbitcoin_wallet |
26 | | - bitcoind --> libbitcoin_node |
| 43 | +libbitcoin_consensus-->libbitcoin_crypto; |
27 | 44 |
|
28 | | - bitcoin-cli ---> libbitcoin-cli |
| 45 | +libbitcoin_common-->libbitcoin_consensus; |
| 46 | +libbitcoin_common-->libbitcoin_util; |
29 | 47 |
|
30 | | - libbitcoin_wallet_tool --> libbitcoin_wallet |
31 | | - libbitcoin_wallet_tool --> libbitcoin_util |
| 48 | +libbitcoinkernel-->libbitcoin_crypto; |
32 | 49 |
|
33 | | - libbitcoin-cli --> libbitcoin_common |
34 | | - libbitcoin-cli --> libbitcoin_util |
| 50 | +libbitcoin_node-->libbitcoin_common; |
| 51 | +libbitcoin_node-->libbitcoin_util; |
| 52 | +libbitcoin_node-->libbitcoin_zmq; |
35 | 53 |
|
36 | | - libbitcoin_node --> libbitcoin_common |
37 | | - libbitcoin_node --> libbitcoin_consensus |
38 | | - libbitcoin_node --> libbitcoin_kernel |
39 | | - libbitcoin_node --> libbitcoin_util |
| 54 | +libbitcoinqt-->libbitcoin_cli; |
| 55 | +libbitcoinqt-->libbitcoin_wallet; |
40 | 56 |
|
41 | | - libbitcoinqt --> libbitcoin_util |
42 | | - libbitcoinqt --> libbitcoin_common |
| 57 | +libbitcoin_util-->libbitcoin_crypto; |
43 | 58 |
|
44 | | - libbitcoin_wallet --> libbitcoin_util |
45 | | - libbitcoin_wallet --> libbitcoin_common |
| 59 | +libbitcoin_wallet-->libbitcoin_common; |
46 | 60 |
|
47 | | - libbitcoin_common --> libbitcoin_util |
48 | | - libbitcoin_common --> libbitcoin_consensus |
| 61 | +libbitcoin_ipc-->libbitcoin_util; |
49 | 62 |
|
50 | | - libbitcoin_kernel --> libbitcoin_consensus |
51 | | - libbitcoin_kernel --> libbitcoin_util |
| 63 | +libbitcoin_zmq-->libbitcoin_util; |
| 64 | +libbitcoin_zmq-->libbitcoin_common; |
52 | 65 |
|
53 | | - classDef types fill:green,color:white,stroke:green; |
54 | | - class bitcoin-wallet,bitcoind,bitcoin-cli,bitcoin-qt types |
| 66 | +classDef types fill:green,color:white,stroke:green; |
| 67 | +class bitcoin-wallet,bitcoind,bitcoin-cli,bitcoin-qt,bitcoin-node,bitcoin-gui types |
55 | 68 | .... |
| 69 | +**Dependency graph**. Arrows show linker symbol dependencies. `libbitcoin_crypto` depends on nothing and is fundamental. `libbitcoin_util` depends on crypto. `libbitcoinkernel` (experimental kernel library) depends only on crypto. |
56 | 70 |
|
57 | 71 | It follows that API changes to the libraries which are internally-facing can be done slightly easier than for libraries with externally-facing APIs, for which more care for compatibility must be taken. |
0 commit comments