vedran f47b339b0e fix: redact sensitive data from debug logs
Remove logging of method arguments. It may contain private keys,
DB passwords, auth tokens, and token values. Log only method
names and argument counts for debugging.

- https://github.com/status-im/infra-logos/issues/1
2026-02-25 10:03:44 +01:00
2026-01-06 13:31:25 -05:00
2025-10-02 16:42:25 -04:00
2025-10-23 09:54:45 -04:00

logos-cpp-sdk

How to Build

The project includes a Nix flake for reproducible builds with a modular structure:

Build Complete SDK (Library + Headers + Generator)

# Build everything (default)
nix build

# Or explicitly
nix build '.#logos-cpp-sdk'
nix build '.#default'

The result will include:

  • /bin/logos-cpp-generator - Code generator binary
  • /lib/ - SDK libraries
  • /include/ - Headers (core/ and cpp/)

Build Individual Components

# Build only the generator binary (outputs to /bin)
nix build '.#logos-cpp-bin'

# Build only the SDK library (outputs to /lib)
nix build '.#logos-cpp-lib'

# Build only the headers (outputs to /include)
nix build '.#logos-cpp-include'

# Legacy alias for generator
nix build '.#cpp-generator'

Development Shell

# Enter development shell with all dependencies
nix develop

Note: In zsh, you need to quote the target (e.g., '.#logos-cpp-sdk') to prevent glob expansion.

If you don't have flakes enabled globally, add experimental flags:

nix build '.#logos-cpp-sdk' --extra-experimental-features 'nix-command flakes'

The compiled artifacts can be found at result/

Modular Architecture

The nix build system is organized into modular files in the /nix directory:

  • nix/default.nix - Common configuration (dependencies, flags, metadata)
  • nix/bin.nix - Generator binary compilation
  • nix/lib.nix - SDK library compilation
  • nix/include.nix - Header installation

Manual Build

Building the C++ SDK

cd cpp
./compile.sh

Building the Code Generator

cd cpp-generator
./compile.sh

The generator binary will be available at build/bin/logos-cpp-generator.

Usage

Code Generator

The logos-cpp-generator tool generates C++ wrapper code for Logos plugins.

Basic Usage

# Generate wrapper for a single plugin (uses default output directory)
logos-cpp-generator /path/to/plugin.dylib

# Specify custom output directory
logos-cpp-generator /path/to/plugin.dylib --output-dir /custom/output/path

# Generate only the module files (no core manager or umbrella headers)
logos-cpp-generator /path/to/plugin.dylib --module-only

# Combine options
logos-cpp-generator /path/to/plugin.dylib --output-dir /custom/output --module-only

Generate from Metadata

# List dependencies from metadata.json
logos-cpp-generator --metadata /path/to/metadata.json

# Generate wrappers for all dependencies
logos-cpp-generator --metadata /path/to/metadata.json --module-dir /path/to/modules

# Generate with custom output directory
logos-cpp-generator --metadata /path/to/metadata.json --module-dir /path/to/modules --output-dir /custom/output

# Generate only module files (no core manager or umbrella headers)
logos-cpp-generator --metadata /path/to/metadata.json --module-dir /path/to/modules --module-only

# Generate only core manager and umbrella files (assumes module files already exist)
logos-cpp-generator --metadata /path/to/metadata.json --general-only

# Generate general files with custom output directory
logos-cpp-generator --metadata /path/to/metadata.json --general-only --output-dir /custom/output

Options

--output-dir /path/to/output

  • Default: If not specified, generated files are placed in logos-cpp-sdk/cpp/generated/
  • Custom: Specify any directory for the generated files
  • The output directory will be created automatically if it doesn't exist

--module-only

  • When specified, generates only the requested module's .h and .cpp files
  • Skips generation of core_manager_api.* and umbrella headers (logos_sdk.*)
  • Useful when you only need wrapper code for specific modules

--general-only

  • When specified with --metadata, generates only the core manager and umbrella SDK files
  • Assumes module wrapper files already exist in the output directory
  • Generates: core_manager_api.h, core_manager_api.cpp, logos_sdk.h, logos_sdk.cpp
  • The umbrella headers will include references to all modules listed in the metadata's dependencies array
  • For each dependency (e.g., "waku_module"), it will:
    • Include waku_module_api.h in the header
    • Include waku_module_api.cpp in the source
    • Create a WakuModule waku_module; member in the LogosModules struct
  • Does not require --module-dir since it doesn't process plugins

Generated Files

By default (without --module-only or --general-only):

  • <module>_api.h and <module>_api.cpp - Wrapper code for each module
  • core_manager_api.h and core_manager_api.cpp - Core manager wrapper
  • logos_sdk.h and logos_sdk.cpp - Umbrella headers including all modules

With --module-only:

  • Only <module>_api.h and <module>_api.cpp - Wrapper code for the requested module(s)

With --general-only:

  • Only core_manager_api.h and core_manager_api.cpp - Core manager wrapper
  • Only logos_sdk.h and logos_sdk.cpp - Umbrella headers that reference existing module files

Typical Workflow

A common workflow is to generate module wrappers separately, then generate the umbrella SDK:

# Step 1: Generate individual module wrappers
logos-cpp-generator /path/to/plugin1.dylib --module-only --output-dir ./generated
logos-cpp-generator /path/to/plugin2.dylib --module-only --output-dir ./generated

# Step 2: Generate core manager and umbrella SDK (references modules from step 1)
logos-cpp-generator --metadata metadata.json --general-only --output-dir ./generated

This approach gives you fine-grained control over which modules to include and allows rebuilding just the umbrella headers without regenerating all module wrappers.

Requirements

Build Tools

  • CMake (3.x or later)
  • Ninja build system
  • pkg-config

Dependencies

  • Qt6 (qtbase)
  • Qt6 Remote Objects (qtremoteobjects)

Supported Platforms

  • macOS (aarch64-darwin, x86_64-darwin)
  • Linux (aarch64-linux, x86_64-linux)
S
Description
No description provided
Readme
13 MiB
Languages
C++ 90.8%
Nix 5.6%
CMake 1.7%
C 1.2%
Shell 0.7%