Wrap LogosMessaging API (liblogosdelivery) and make it available as a Logos Core module.
This module provides high-level message delivery capabilities through the liblogosdelivery interface from logos-delivery, packaged as a Logos module plugin compatible with logos-core.
# Build everything (default)
nix build
# Or explicitly
nix build '.#default'Current Status: The build will compile the plugin successfully but fail at the install phase when looking for liblogosdelivery.dylib, as it's not yet available from logos-delivery.
The result will include (once liblogosdelivery is available):
/lib/logos/modules/delivery_module_plugin.dylib(or.soon Linux) - The Delivery module plugin- Symlink to
liblogosdelivery.dylib(or.soon Linux) from logos-delivery /share/logos-delivery-module/metadata.json- Module metadata/share/logos-delivery-module/generated/- Generated module files
# Build only the library (plugin + liblogosdelivery reference)
nix build '.#lib'
# Build only the generated headers
nix build '.#include'# Enter development shell with all dependencies
nix developNote: In zsh, you need to quote the target (e.g., '.#default') to prevent glob expansion.
If you don't have flakes enabled globally, add experimental flags:
nix build --extra-experimental-features 'nix-command flakes'The compiled artifacts can be found at result/
When built with Nix, the module produces:
result/
├── lib/
│ ├── liblogosdelivery.dylib # Logos Messaging library (symlinked)
│ └── delivery_module_plugin.dylib # Logos module plugin
└── include/
├── delivery_module_plugin.h # Generated API header
└── delivery_module_plugin.cpp # Generated API implementation
└── liblogosdelivery.h # Header for liblogosdelivery
Both libraries must remain in the same directory, as delivery_module_plugin.dylib is configured with @loader_path to find liblogosdelivery.dylib relative to itself.
- CMake (3.14 or later)
- Ninja build system
- pkg-config
- Qt6 (qtbase)
- Qt6 Remote Objects (qtremoteobjects)
- logos-liblogos (provided via Nix)
- logos-cpp-sdk (provided via Nix)
- logos-delivery with liblogosdelivery target (provided via Nix)
All dependencies are automatically handled by the Nix flake configuration.
The delivery module provides the following API methods (all synchronous):
createNode(cfg: QString)- Initialize the delivery node with a JSON configuration (call once)start()- Start the delivery nodestop()- Stop the delivery nodesend(contentTopic: QString, payload: QString)- Send a message (returns a request id)subscribe(contentTopic: QString)- Subscribe to receive messages on a topicunsubscribe(contentTopic: QString)- Unsubscribe from a topicgetAvailableNodeInfoIDs()- List queryable node info identifiersgetNodeInfo(nodeInfoId: QString)- Retrieve node info by identifiergetAvailableConfigs()- Retrieve available configuration parameter descriptions
createNode accepts a flat JSON object whose keys correspond to WakuNodeConf
field names (camelCase) from
logos-delivery.
Unknown keys are silently ignored. Every field has a built-in default, so only
values that differ from defaults need to be supplied.
| Key | Type | Default | Description |
|---|---|---|---|
mode |
string | "noMode" |
"Core", "Edge", or "noMode" |
preset |
string | "" |
Network preset ("twn", "logos.dev") |
clusterId |
number (uint16) | 0 |
Cluster identifier |
entryNodes |
array of string | [] |
Bootstrap peers (enrtree / multiaddress) |
relay |
boolean | false |
Enable relay protocol |
rlnRelay |
boolean | false |
Enable RLN rate-limit nullifier |
tcpPort |
number (uint16) | 60000 |
P2P TCP listen port |
numShardsInNetwork |
number (uint16) | 1 |
Auto-sharding shard count |
logLevel |
string | "INFO" |
"TRACE", "DEBUG", "INFO", "WARN" |
logFormat |
string | "TEXT" |
"TEXT" or "JSON" |
maxMessageSize |
string | "150KiB" |
Maximum message payload size |
Using a preset populates cluster ID, entry nodes, sharding, RLN, and other
network-specific defaults automatically. Individual keys supplied alongside a
preset override the preset values.
"twn"– The RLN-protected Waku Network (cluster 1)."logos.dev"– Logos Dev Network (cluster 2, mix enabled, p2pReliability on, 8 auto-shards, built-in bootstrap nodes).
Minimal example using the logos.dev preset:
{
"logLevel": "INFO",
"mode": "Core",
"preset": "logos.dev"
}Content topics identify message channels for publishing and subscribing. Use a properly structured content topic for your application following the format specified in LIP-23: Topics.
Example: "/myapp/1/chat/proto"
send(contentTopic, payload) accepts a content topic and a raw payload string.
The plugin converts the payload to UTF-8 bytes, base64-encodes it, and wraps it
in a JSON envelope before crossing the FFI boundary:
{ "contentTopic": "<topic>", "payload": "<base64>", "ephemeral": false }The call is synchronous and returns a request id on success. The actual network delivery is asynchronous — track results via the emitted events:
messageError– the module could not send the message.messagePropagated– the message reached the network but is not yet validated.messageSent– the message has been confirmed by the network.
Asynchronous events are emitted off-thread as Logos Plugin events. Each event
carries a QVariantList data with positional values:
messageSent– message confirmed by the networkdata[0](QString): request iddata[1](QString): message hashdata[2](QString): local timestamp (ISO-8601)
messageError– send failuredata[0](QString): request iddata[1](QString): message hashdata[2](QString): error messagedata[3](QString): local timestamp (ISO-8601)
messagePropagated– message reached the network but not yet validateddata[0](QString): request iddata[1](QString): message hashdata[2](QString): local timestamp (ISO-8601)
messageReceived– a message arrived on a subscribed topicdata[0](QString): message hashdata[1](QString): content topicdata[2](QString): payload (base64-encoded)data[3](QString): timestamp (nanoseconds since epoch)
connectionStateChanged– node connectivity changedata[0](QString): connection statusdata[1](QString): local timestamp (ISO-8601)
┌─────────────────────────────────────┐
│ Logos Core (Qt Application) │
└──────────────┬──────────────────────┘
│
│ Plugin Interface
▼
┌─────────────────────────────────────┐
│ delivery_module_plugin │
│ (Qt Plugin - this repository) │
└──────────────┬──────────────────────┘
│
│ C FFI
▼
┌─────────────────────────────────────┐
│ liblogosdelivery │
│ (from logos-delivery) │
│ High-level Message-delivery API │
└──────────────┬──────────────────────┘
│
│ Nim API
▼
┌─────────────────────────────────────┐
│ logos-delivery │
│ Core message-delivery implementation│
└─────────────────────────────────────┘
# Enter development shell
nix develop
# Now you have access to all build tools and dependencies
cmake -B build -S . -GNinja \
-DLOGOS_CPP_SDK_ROOT=$LOGOS_CPP_SDK_ROOT \
-DLOGOS_LIBLOGOS_ROOT=$LOGOS_LIBLOGOS_ROOT \
-DLOGOS_DELIVERY_ROOT=$LOGOS_DELIVERY_ROOT
# Build
ninja -C build