# Libraries | Name | Description | |--------------------------|-------------| | *liblimenka_cli* | RPC client functionality used by *limenka-cli* executable | | *liblimenka_common* | Home for common functionality shared by different executables and libraries. Similar to *liblimenka_util*, but higher-level (see [Dependencies](#dependencies)). | | *liblimenka_consensus* | Consensus functionality used by *liblimenka_node* and *liblimenka_wallet* and also exposed as a [shared library](../shared-libraries.md). | | *liblimenkaconsensus* | Stable, backwards-compatible shared library build of static *liblimenka_consensus* library | | *liblimenka_crypto* | Hardware-optimized functions for data encryption, hashing, message authentication, and key derivation. | | *liblimenka_kernel* | Consensus engine and support library used for validation by *liblimenka_node*. | | *liblimenkaqt* | GUI functionality used by *limenka-qt* and *limenka-gui* executables. | | *liblimenka_ipc* | IPC functionality used by *limenka-node*, *limenka-wallet*, *limenka-gui* executables to communicate when [`-DWITH_MULTIPROCESS=ON`](multiprocess.md) is used. | | *liblimenka_node* | P2P and RPC server functionality used by *limenkad* and *limenka-qt* executables. | | *liblimenka_util* | Home for common functionality shared by different executables and libraries. Similar to *liblimenka_common*, but lower-level (see [Dependencies](#dependencies)). | | *liblimenka_wallet* | Wallet functionality used by *limenkad* and *limenka-wallet* executables. | | *liblimenka_wallet_tool* | Lower-level wallet functionality used by *limenka-wallet* executable. | | *liblimenka_zmq* | [ZeroMQ](../zmq.md) functionality used by *limenkad* and *limenka-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 *liblimenka_consensus* and *liblimenka_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 [`add_library(limenka_* ...)`](../../src/CMakeLists.txt) 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: - *liblimenka_node* code lives in `src/node/` in the `node::` namespace - *liblimenka_wallet* code lives in `src/wallet/` in the `wallet::` namespace - *liblimenka_ipc* code lives in `src/ipc/` in the `ipc::` namespace - *liblimenka_util* code lives in `src/util/` in the `util::` namespace - *liblimenka_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; limenka-cli[limenka-cli]-->liblimenka_cli; limenkad[limenkad]-->liblimenka_node; limenkad[limenkad]-->liblimenka_wallet; limenka-qt[limenka-qt]-->liblimenka_node; limenka-qt[limenka-qt]-->liblimenkaqt; limenka-qt[limenka-qt]-->liblimenka_wallet; limenka-wallet[limenka-wallet]-->liblimenka_wallet; limenka-wallet[limenka-wallet]-->liblimenka_wallet_tool; liblimenka_cli-->liblimenka_util; liblimenka_cli-->liblimenka_common; liblimenka_consensus-->liblimenka_crypto; liblimenka_common-->liblimenka_consensus; liblimenka_common-->liblimenka_crypto; liblimenka_common-->liblimenka_util; liblimenka_kernel-->liblimenka_consensus; liblimenka_kernel-->liblimenka_crypto; liblimenka_kernel-->liblimenka_util; liblimenka_node-->liblimenka_consensus; liblimenka_node-->liblimenka_crypto; liblimenka_node-->liblimenka_kernel; liblimenka_node-->liblimenka_common; liblimenka_node-->liblimenka_util; liblimenkaqt-->liblimenka_common; liblimenkaqt-->liblimenka_util; liblimenka_util-->liblimenka_crypto; liblimenka_wallet-->liblimenka_common; liblimenka_wallet-->liblimenka_crypto; liblimenka_wallet-->liblimenka_util; liblimenka_wallet_tool-->liblimenka_wallet; liblimenka_wallet_tool-->liblimenka_util; classDef bold stroke-width:2px, font-weight:bold, font-size: smaller; class limenka-qt,limenkad,limenka-cli,limenka-wallet bold ``` |
| **Dependency graph**. Arrows show linker symbol dependencies. *Crypto* lib depends on nothing. *Util* lib is depended on by everything. *Kernel* lib depends only on consensus, crypto, and util. |