# Libraries | Name | Description | |--------------------------|-------------| | *libmoneyrocket_cli* | RPC client functionality used by *moneyrocket-cli* executable | | *libmoneyrocket_common* | Home for common functionality shared by different executables and libraries. Similar to *libmoneyrocket_util*, but higher-level (see [Dependencies](#dependencies)). | | *libmoneyrocket_consensus* | Stable, backwards-compatible consensus functionality used by *libmoneyrocket_node* and *libmoneyrocket_wallet* and also exposed as a [shared library](../shared-libraries.md). | | *libmoneyrocketconsensus* | Shared library build of static *libmoneyrocket_consensus* library | | *libmoneyrocket_kernel* | Consensus engine and support library used for validation by *libmoneyrocket_node* and also exposed as a [shared library](../shared-libraries.md). | | *libmoneyrocketqt* | GUI functionality used by *moneyrocket-qt* and *moneyrocket-gui* executables | | *libmoneyrocket_ipc* | IPC functionality used by *moneyrocket-node*, *moneyrocket-wallet*, *moneyrocket-gui* executables to communicate when [`--enable-multiprocess`](multiprocess.md) is used. | | *libmoneyrocket_node* | P2P and RPC server functionality used by *moneyrocketd* and *moneyrocket-qt* executables. | | *libmoneyrocket_util* | Home for common functionality shared by different executables and libraries. Similar to *libmoneyrocket_common*, but lower-level (see [Dependencies](#dependencies)). | | *libmoneyrocket_wallet* | Wallet functionality used by *moneyrocketd* and *moneyrocket-wallet* executables. | | *libmoneyrocket_wallet_tool* | Lower-level wallet functionality used by *moneyrocket-wallet* executable. | | *libmoneyrocket_zmq* | [ZeroMQ](../zmq.md) functionality used by *moneyrocketd* and *moneyrocket-qt* executables. | ## Conventions - Most libraries are internal libraries and have APIs which are completely unstable! There are few or no restrictions on backwards compatibility or rules about external dependencies. Exceptions are *libmoneyrocket_consensus* and *libmoneyrocket_kernel* which have external interfaces documented at [../shared-libraries.md](../shared-libraries.md). - Generally each library should have a corresponding source directory and namespace. Source code organization is a work in progress, so it is true that some namespaces are applied inconsistently, and if you look at [`libmoneyrocket_*_SOURCES`](../../src/Makefile.am) lists you can see that many libraries pull in files from outside their source directory. But when working with libraries, it is good to follow a consistent pattern like: - *libmoneyrocket_node* code lives in `src/node/` in the `node::` namespace - *libmoneyrocket_wallet* code lives in `src/wallet/` in the `wallet::` namespace - *libmoneyrocket_ipc* code lives in `src/ipc/` in the `ipc::` namespace - *libmoneyrocket_util* code lives in `src/util/` in the `util::` namespace - *libmoneyrocket_consensus* code lives in `src/consensus/` in the `Consensus::` namespace ## Dependencies - Libraries should minimize what other libraries they depend on, and only reference symbols following the arrows shown in the dependency graph below:
```mermaid %%{ init : { "flowchart" : { "curve" : "basis" }}}%% graph TD; moneyrocket-cli[moneyrocket-cli]-->libmoneyrocket_cli; moneyrocketd[moneyrocketd]-->libmoneyrocket_node; moneyrocketd[moneyrocketd]-->libmoneyrocket_wallet; moneyrocket-qt[moneyrocket-qt]-->libmoneyrocket_node; moneyrocket-qt[moneyrocket-qt]-->libmoneyrocketqt; moneyrocket-qt[moneyrocket-qt]-->libmoneyrocket_wallet; moneyrocket-wallet[moneyrocket-wallet]-->libmoneyrocket_wallet; moneyrocket-wallet[moneyrocket-wallet]-->libmoneyrocket_wallet_tool; libmoneyrocket_cli-->libmoneyrocket_util; libmoneyrocket_cli-->libmoneyrocket_common; libmoneyrocket_common-->libmoneyrocket_consensus; libmoneyrocket_common-->libmoneyrocket_util; libmoneyrocket_kernel-->libmoneyrocket_consensus; libmoneyrocket_kernel-->libmoneyrocket_util; libmoneyrocket_node-->libmoneyrocket_consensus; libmoneyrocket_node-->libmoneyrocket_kernel; libmoneyrocket_node-->libmoneyrocket_common; libmoneyrocket_node-->libmoneyrocket_util; libmoneyrocketqt-->libmoneyrocket_common; libmoneyrocketqt-->libmoneyrocket_util; libmoneyrocket_wallet-->libmoneyrocket_common; libmoneyrocket_wallet-->libmoneyrocket_util; libmoneyrocket_wallet_tool-->libmoneyrocket_wallet; libmoneyrocket_wallet_tool-->libmoneyrocket_util; classDef bold stroke-width:2px, font-weight:bold, font-size: smaller; class moneyrocket-qt,moneyrocketd,moneyrocket-cli,moneyrocket-wallet bold ``` |
**Dependency graph**. Arrows show linker symbol dependencies. *Consensus* lib depends on nothing. *Util* lib is depended on by everything. *Kernel* lib depends only on consensus and util. |