The SuperGenius project, including submodules like the C++ RLP protocol, leverages a comprehensive set of third-party libraries to support functionalities such as cryptography, networking, data storage, logging, and testing. These libraries are hosted in the https://www.github.com/GeniusVentures/thirdparty repository and are integrated as submodules or external dependencies within the project's build system. This document provides a generic guide for integrating these libraries into any SuperGenius submodule, ensuring consistency with the existing setup as defined in the provided CMake configuration files and the C++ RLP protocol project.
The following libraries are supported across SuperGenius submodules, as listed in thirdparty_libraries.md. Each library's purpose and approximate version (where available) are noted, with integration details tailored for generic submodule use. Exact versions should be confirmed via .gitmodules, commit hashes, or CMake configuration files.
-
abseil-cpp (~20240116)
- Purpose: Provides modern C++ utilities for containers, strings, and time management.
- Integration: Include via
find_package(absl CONFIG REQUIRED)inCMakeLists.txt. Set include directories to${_THIRDPARTY_BUILD_DIR}/grpc/lib/cmake/absl. Link againstabsl::strings,absl::container, etc., as needed.
-
AsyncIOManager (Version: Unknown)
- Purpose: Supports asynchronous I/O for event loops and networking.
- Integration: Configure include paths in CMake to
${_THIRDPARTY_BUILD_DIR}/AsyncIOManager/include. Link the library if prebuilt or build as a submodule in${_THIRDPARTY_BUILD_DIR}.
-
boost (~1.85)
- Purpose: Offers utilities for error handling (
Boost.Outcome), networking (Boost.Asio), endianness (Boost.Endian), and program options. - Integration: Set
BOOST_VERSIONinCommonBuildParameters.cmake(e.g., 1.85.0). Usefind_package(Boost COMPONENTS program_options json filesystem REQUIRED)and link againstBoost::program_options, etc. Include directories from${_THIRDPARTY_BUILD_DIR}/boost/build/include.
- Purpose: Offers utilities for error handling (
-
boost-for-mobile (~1.85)
- Purpose: Mobile-optimized Boost libraries for iOS/Android compatibility.
- Integration: Similar to Boost, but use platform-specific paths in
apple.toolchain.cmakefor iOS builds. Include${_THIRDPARTY_BUILD_DIR}/boost-for-mobile/includeand link as needed.
-
c-ares (~1.19.x)
- Purpose: Asynchronous DNS resolution for networking.
- Integration: Use
find_package(c-ares CONFIG REQUIRED)and set include paths to${_THIRDPARTY_BUILD_DIR}/c-ares/include. Link againstc-ares::cares.
-
celer-network (Version: Unknown)
- Purpose: Blockchain scalability solutions.
- Integration: Configure as a submodule in
${_THIRDPARTY_BUILD_DIR}/celer-network. Include headers and link libraries based on project-specific needs.
-
cpp-ipfs-http-client (Version: Unknown)
- Purpose: HTTP client for IPFS decentralized storage.
- Integration: Set include paths to
${_THIRDPARTY_BUILD_DIR}/cpp-ipfs-http-client/includeand link the library. Ensure compatibility withipfs-lite-cpp.
-
cryptopp-cmake (~8.7.0)
- Purpose: Cryptographic algorithms for security.
- Integration: Use
find_package(CryptoPP CONFIG REQUIRED)and link againstCryptoPP::CryptoPP. Include directories from${_THIRDPARTY_BUILD_DIR}/cryptopp-cmake/include.
-
curl-android-ios (~8.2.x)
- Purpose: HTTP requests for mobile platforms.
- Integration: Configure in
apple.toolchain.cmakefor iOS. Usefind_package(CURL REQUIRED)and link againstCURL::libcurl. Set include paths to${_THIRDPARTY_BUILD_DIR}/curl-android-ios/include.
-
delta-enabled-crdts (Version: Unknown)
- Purpose: Conflict-free replicated data types for distributed systems.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/delta-enabled-crdts/includeand link the library. Used incrdt_globaldbfor distributed storage.
-
ed25519 (Version: Unknown)
- Purpose: Ed25519 cryptography for signing/verification.
- Integration: Set include paths to
${_THIRDPARTY_BUILD_DIR}/ed25519/includeand link the static library. Ensure compatibility withTrustWalletCore.
-
flutter (~3.24.x)
- Purpose: Cross-platform UI framework for mobile apps.
- Integration: Typically used for UI submodules. Configure build scripts to integrate with
${_THIRDPARTY_BUILD_DIR}/flutterand follow Flutter’s CMake integration guidelines.
-
fmt (~10.2.0)
- Purpose: String formatting for logging and output.
- Integration: Use
find_package(fmt CONFIG REQUIRED)and link againstfmt::fmt. Include directories from${_THIRDPARTY_BUILD_DIR}/fmt/include.
-
gnostic (Version: Unknown)
- Purpose: OpenAPI/Swagger processing for API generation.
- Integration: Configure as a submodule in
${_THIRDPARTY_BUILD_DIR}/gnostic. Include headers and link as needed for API-related submodules.
-
gnus_upnp (Version: Unknown)
- Purpose: UPnP for network discovery.
- Integration: Set include paths to
${_THIRDPARTY_BUILD_DIR}/gnus_upnp/includeand link the library. Ensure compatibility with networking components.
-
grpc (Version: Unknown)
- Purpose: RPC framework for networked services.
- Integration: Configure via
find_package(gRPC CONFIG REQUIRED)inCommonBuildParameters.cmake. Set include paths to${_THIRDPARTY_BUILD_DIR}/grpc/includeand link againstgRPC::grpc++.
-
GSL (Version: Unknown)
- Purpose: C++ Core Guidelines support for code safety.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/Microsoft.GSL/include. No linking required as it’s header-only.
-
GTest (~1.14.0)
- Purpose: Unit testing framework.
- Integration: Enable via
TESTINGoption inCommonCompilerOptions.cmake. Usefind_package(GTest CONFIG REQUIRED)and link againstGTest::gtest. Set include paths to${_THIRDPARTY_BUILD_DIR}/GTest/include. Tests should followCLAUDE.mdguidelines.
-
hat-trie (Version: Unknown)
- Purpose: Trie data structure for efficient lookups.
- Integration: Use
find_package(tsl_hat_trie CONFIG REQUIRED)and link againsttsl_hat_trie::tsl_hat_trie. Include directories from${_THIRDPARTY_BUILD_DIR}/tsl_hat_trie/include.
-
ipfs-bitswap-cpp (Version: Unknown)
- Purpose: IPFS Bitswap protocol for data exchange.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/ipfs-bitswap-cpp/includeand link the library. Ensure compatibility withipfs-lite-cpp.
-
ipfs-lite-cpp (Version: Unknown)
- Purpose: Lightweight IPFS client for decentralized storage.
- Integration: Used in
processing_dapp.cppforsgns::ipfs_lite::ipfs::graphsync. Include headers from${_THIRDPARTY_BUILD_DIR}/ipfs-lite-cpp/includeand link the library.
-
ipfs-pubsub (Version: Unknown)
- Purpose: IPFS publish/subscribe messaging.
- Integration: Used in
processing_dapp.cppandprocessing_dapp_processor.cppforsgns::ipfs_pubsub::GossipPubSub. Configure include paths to${_THIRDPARTY_BUILD_DIR}/ipfs-pubsub/includeand link the library.
-
json (Version: Unknown)
- Purpose: JSON parsing for data interchange.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/json/include. Typically header-only, no linking required.
-
jsonrpc-lean (Version: Unknown)
- Purpose: JSON-RPC for remote procedure calls.
- Integration: Configure include paths to
${_THIRDPARTY_BUILD_DIR}/jsonrpc-lean/includeand link the library if needed.
-
libp2p (Version: Unknown)
- Purpose: Peer-to-peer networking.
- Integration: Used extensively in
processing_dapp.cppandprocessing_dapp_processor.cpp. Include headers from${_THIRDPARTY_BUILD_DIR}/libp2p/includeand link againstlibp2p.
-
libsecp256k1 (Version: Unknown)
- Purpose: Secp256k1 cryptography for blockchain applications.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/libsecp256k1/includeand link the static library. Compatible withTrustWalletCore.
-
libssh2 (Version: Unknown)
- Purpose: SSH protocol for secure communication.
- Integration: Use
find_package(Libssh2 REQUIRED)and link againstLibssh2::libssh2. Set include paths to${_THIRDPARTY_BUILD_DIR}/libssh2/include.
-
lmdb (Version: Unknown)
- Purpose: Lightweight key-value store.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/lmdb/includeand link the library. Suitable for lightweight storage needs.
-
MNN (Version: Unknown)
- Purpose: Neural network inference for ML applications.
- Integration: Configure via
find_package(MNN CONFIG REQUIRED)inCommonBuildParameters.cmake. Include directories from${_THIRDPARTY_BUILD_DIR}/MNN/includeand link againstMNN::MNN.
-
MoltenVK (Version: Unknown)
- Purpose: Vulkan API for macOS/iOS.
- Integration: Configure in
apple.toolchain.cmakefor iOS builds. Include headers from${_THIRDPARTY_BUILD_DIR}/MoltenVK/includeand link the library.
-
openssl (~1.1.1t or 3.0.x)
- Purpose: Cryptographic functions for security.
- Integration: Set
OPENSSL_DIRinCommonBuildParameters.cmaketo${_THIRDPARTY_BUILD_DIR}/openssl/build. Usefind_package(OpenSSL REQUIRED)and link againstOpenSSL::SSLandOpenSSL::Crypto.
-
Parabeac-Core (Version: Unknown)
- Purpose: UI code generation from designs.
- Integration: Configure as a submodule in
${_THIRDPARTY_BUILD_DIR}/Parabeac-Core. Include headers and link as needed for UI submodules.
-
rapidjson (~1.1.0)
- Purpose: Fast JSON parsing for data processing.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/rapidjson/include. Header-only, no linking required.
-
restclient-cpp (Version: Unknown)
- Purpose: HTTP client for REST APIs.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/restclient-cpp/includeand link the library.
-
rocksdb (Version: Unknown)
- Purpose: High-performance key-value store.
- Integration: Configure via
find_package(RocksDB CONFIG REQUIRED)inCommonBuildParameters.cmake. Include directories from${_THIRDPARTY_BUILD_DIR}/rocksdb/includeand link againstRocksDB::rocksdb.
-
soralog (Version: Unknown)
- Purpose: Logging framework.
- Integration: Configure via
find_package(soralog CONFIG REQUIRED)inCommonBuildParameters.cmake. Include directories from${_THIRDPARTY_BUILD_DIR}/soralog/includeand link againstsoralog. Used inprocessing_dapp.cppfor logging.
-
spdlog (Version: Unknown)
- Purpose: Fast logging library.
- Integration: Configure via
find_package(spdlog CONFIG REQUIRED)inCommonBuildParameters.cmake. Include directories from${_THIRDPARTY_BUILD_DIR}/spdlog/includeand link againstspdlog::spdlog. DefineSPDLOG_FMT_EXTERNALforfmtintegration.
-
sqlite3 (Version: Unknown)
- Purpose: SQLite database engine.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/sqlite3/includeand link againstsqlite3.
-
SQLiteModernCpp (Version: Unknown)
- Purpose: C++ wrapper for SQLite.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/SQLiteModernCpp/include. Typically header-only.
-
sr25519-donna (Version: Unknown)
- Purpose: Sr25519 cryptography for blockchain.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/sr25519-donna/includeand link the static library. Compatible withTrustWalletCore.
-
stb (Version: Unknown)
- Purpose: Single-file C/C++ utilities.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/stb/include. Header-only, no linking required.
-
Vulkan-Headers (Version: Unknown)
- Purpose: Vulkan API headers for graphics.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/Vulkan-Headers/include. Header-only.
-
Vulkan-Loader (Version: Unknown)
- Purpose: Vulkan runtime loader.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/Vulkan-Loader/includeand link the library.
-
wallet-core (Version: Unknown)
- Purpose: Cryptocurrency wallet utilities.
- Integration: Configure in
CommonBuildParameters.cmakewith libraries (TrezorCrypto,wallet_core_rs,TrustWalletCore) in${_THIRDPARTY_BUILD_DIR}/wallet-core/lib. Link againstTrustWalletCoreand include directories from${_THIRDPARTY_BUILD_DIR}/wallet-core/include.
-
xxhash (Version: Unknown)
- Purpose: Fast hashing algorithm.
- Integration: Include headers from
${_THIRDPARTY_BUILD_DIR}/xxhash/includeand link the library.
-
yaml-cpp (Version: Unknown)
- Purpose: YAML parsing for configuration.
- Integration: Configure via
find_package(yaml-cpp CONFIG REQUIRED)inCommonBuildParameters.cmake. Include directories from${_THIRDPARTY_BUILD_DIR}/yaml-cpp/includeand link againstyaml-cpp.
-
zkLLVM (Version: Unknown)
- Purpose: Zero-knowledge proof compilation.
- Integration: Managed in
CommonCompilerOptions.cmakewithZKLLVM_BUILD_DIR. Download from GitHub if not found. Include headers from${_THIRDPARTY_BUILD_DIR}/zkLLVM/includeand link the library.
-
zlib (~1.2.13)
- Purpose: Data compression.
- Integration: Use
find_package(ZLIB REQUIRED)and link againstZLIB::ZLIB. Include directories from${_THIRDPARTY_BUILD_DIR}/zlib/include.
- Repository: Libraries are hosted in
https://www.github.com/GeniusVentures/thirdpartyand managed as Git submodules in${CMAKE_CURRENT_LIST_DIR}/../../thirdparty. Update submodules viagit submodule update --init --recursive. - Directory Structure: Libraries are built in
${THIRDPARTY_BUILD_DIR}/<library>/, with platform- and build-type-specific paths (e.g.,${THIRDPARTY_DIR}/build/${BUILD_PLATFORM_NAME}/${CMAKE_BUILD_TYPE}${ABI_SUBFOLDER_NAME}), as defined inCommonCompilerOptions.cmake. - Version Control: Confirm library versions via
.gitmodulesor commit hashes. For example, Boost is set to 1.89 inCommonBuildParameters.cmake.
- Find Packages: Use
find_packagefor CMake-compatible libraries (e.g.,Boost,GTest,Protobuf). SpecifyCONFIGmode for precise control, as shown inCommonBuildParameters.cmake. - Include Directories: Set include paths to
${_THIRDPARTY_BUILD_DIR}/<library>/includeusinginclude_directoriesortarget_include_directories. For example,include_directories(${_THIRDPARTY_BUILD_DIR}/stb/include)forstb. - Library Linking: Link libraries using
target_link_libraries. For example, linkprocessing_dapptoBoost::program_optionsandcrdt_globaldbinCMakeLists.txt. - Platform-Specific Handling: For iOS builds, use
apple.toolchain.cmaketo configure architectures (arm64,x86_64) and frameworks. SetCMAKE_FIND_ROOT_PATHto include${CMAKE_OSX_SYSROOT_INT}for cross-compilation. - Build Options: Enable options like
TESTINGorBUILD_EXAMPLESinCommonCompilerOptions.cmakefor testing and example builds. Ensure dependencies are conditionally included based on these options.
- Conformance: Follow
CLAUDE.mdguidelines (Microsoft-based style, PascalCase for classes/methods, camelCase for variables, 4-space indent, 120-character line limit). Useoutcome::result<T>for error handling, as seen inprocessing_dapp_processor.cpp. - Thread Safety: Libraries like
libp2pandAsyncIOManagersupport asynchronous operations. Ensure thread safety by using mutexes or atomic operations where needed, as per issue #16 inrlp_project_instructions.md. - Error Handling: Use
Boost.Outcomefor error propagation, as specified inrlp_project_instructions.md. Libraries likeabseil-cppandGSLenhance type safety and error checking.
- GTest: For unit testing, follow
CLAUDE.mdto place tests intest/with descriptive names. Usefind_package(GTest)and link againstGTest::gtest. Run tests withninja testor specific filters (e.g.,./test_bin/buffer_test --gtest_filter=BufferTest.EmptyBuffer). - Coverage: Target >95% coverage, as per issue #4 in
rlp_project_instructions.md. Use tools likegcovorlcovin CI pipelines. - Sanitizers: Enable AddressSanitizer/Valgrind via
SANITIZE_CODEinCommonCompilerOptions.cmakefor memory safety, as per issue #6.
- iOS/macOS: Use
apple.toolchain.cmakefor iOS builds, supportingOS64,SIMULATOR64, etc. Ensure libraries likecurl-android-ios,MoltenVK, andTrustWalletCoreare configured for mobile platforms. - Cross-Platform: Test on Linux, macOS, and Windows via CI pipelines (issue #12). Use
CMAKE_SYSTEM_NAMEandCMAKE_HOST_SYSTEM_NAMEto handle platform-specific configurations. - Embedded Systems: For resource-constrained platforms (issue #18), optimize libraries like
lmdbandxxhashfor minimal memory usage.
- GitHub Actions: Set up multi-platform builds, compiler testing, and coverage reporting, as per issue #12. Include security scanning with CodeQL.
- Static Analysis: Use
clang-formatandclang-tidyfor code style enforcement, as per issue #17. Configure pre-commit hooks to ensure compliance. - WebAssembly: For WebAssembly builds (issue #18), configure libraries like
boostandcryptopp-cmakewith Emscripten toolchains.
- Dependencies: The RLP protocol uses
Boost.Outcomefor error handling,GTestfor testing, and potentiallycryptopp-cmakeoropensslfor cryptographic operations. Configure these inCMakeLists.txtas per issue #3. - Implementation: Use
abseil-cppfor safe container handling inrlp_decoder.cpp. Includerapidjsonorjsonfor JSON-to-RLP utilities (issue #15). Leveragespdlogandsoralogfor logging, similar toprocessing_dapp.cpp. - Testing: Implement Ethereum RLP test vectors (issue #5) using
GTest. Add fuzz testing withabseil-cpputilities for robust error checking.
- Minimal Changes: Per
CLAUDE.md, suggest changes without modifying files directly. Use concise diffs for small changes (2-3 lines), as perrlp_project_instructions.md. - Dependency Verification: Check library availability in
${_THIRDPARTY_BUILD_DIR}before use. If missing, suggest downloading via GitHub releases, as done forzkLLVMinCommonCompilerOptions.cmake. - Performance: Optimize hot paths using
xxhashorabseil-cppfor fast data processing, as per issue #14. ConsiderMNNfor ML-related submodules. - Documentation: Follow issue #10 for Doxygen documentation and usage examples. Include performance characteristics for libraries like
rocksdborlibp2p.
This generic integration guide ensures that SuperGenius submodules, including the C++ RLP protocol, can seamlessly incorporate third-party libraries while adhering to the project’s build system, coding standards, and testing practices.