* feat: expose Store queries via storeQuery
A Logos Core module integrating paid Store retrieval (lez-payment-streams)
needs to issue Store queries through delivery_module, but the plugin surface
only covered lifecycle, send, subscribe and node info. liblogosdelivery already
ships waku_store_query in its kernel tier, so forward to it: storeQuery(
jsonQuery, peerAddr, timeoutMs) hands the query JSON through verbatim and
returns the response JSON, waiting past the query's own timeout so the FFI
error (not a callback timeout) is what the caller sees.
The kernel tier is explicitly unstable; the include is scoped to this one
symbol and the method documents that its JSON contract follows it.
Resolveslogos-co/logos-delivery-module#30
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs: add use-at-your-own-risk warning on storeQuery
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* chore: bump logos-delivery to master 8ad99f1
Brings in the Reliable Channels FFI API (logosdelivery_channel_create/
_exists/_send/_close) and channel_message_* events. The create_node
config gained the layered {mode, preset, messagingOverrides,
channelsOverrides} shape; legacy flat JSON remains accepted, so the
existing flat configs and applyPortDefaults keep working.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: sync liblogosdelivery.h stub with logos-delivery master 8ad99f1
Replace the hand-condensed stub with the real header surface so the
unit-test ABI matches exactly: adds the four Reliable Channels
functions, RET_MISSING_CALLBACK, and the FFICallBack typedef name used
by the real header.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: add Reliable Channels API to delivery module
Expose the new logos-delivery channel FFI surface:
- channelCreate(channelId, contentTopic, senderId) -> channel id
- channelExists(channelId) -> "true"/"false" (verbatim FFI string)
- channelSend(channelId, payload) -> requestId, payload base64-encoded
into { payload, ephemeral:false } like send()
- channelClose(channelId)
Route the new event types through event_callback as typed events:
channel_message_received (payload base64-decoded), channel_message_sent,
channel_message_error.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: mock channel FFI functions and add channel-api unit tests
Mock the four logosdelivery_channel_* functions (invokeOk pattern),
stub the three new channel event bodies, and cover
channelCreate/channelExists/channelSend/channelClose with the same
no-context / mocked-value / call-count assertions as the existing API.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: add reliable-channel integration tests
Cover the full channel lifecycle against the real library: exists=false
for unknown ids, create returns the channel id, exists flips true/false
across create/close, close of an unknown channel errors, and
channelSend returns a request id on an open channel and fails on an
unknown one.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: extract shared decodePayloadField for event payloads
Both message_received and channel_message_received now decode their
payload field through one helper that accepts either wire shape: a JSON
array of numbers (generic Nim seq[byte] serialization) or a base64
string (hand-built events).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: make event_callback exception-safe across the FFI boundary
Address PR review: event_callback is a C callback invoked from the Nim
runtime, so a C++ exception escaping it would unwind into Nim frames
and terminate the process.
- decodePayloadField: validate array elements are integers in 0..255
instead of a throwing get<int>(); malformed payloads decode to empty.
- Wrap the whole parse + field-extraction + dispatch in one try/catch
on nlohmann::json::exception — .value()/.get() type mismatches were
equally able to escape, not just the payload conversion.
- Stub header: note that upstream's onChannelMessage* comment refers to
internal listener labels, while the delivered eventType strings are
channel_message_*; the mirrored body stays verbatim with upstream.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: split the event payload decoder per event type
message_received carries a JSON byte array, channel_message_received a
base64 string. One parser sniffing both shapes let either event silently
accept the other's encoding; each now decodes only its own.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Igor Sirotin <sirotin@status.im>
* feat: expose node metrics via collectOpenMetricsText() for openmetrics
liblogosdelivery already aggregates Prometheus metrics in its global
registry and renders them as exposition text behind the "Metrics"
node-info attribute. Implement the openmetrics module's new
collectOpenMetricsText() convention (logos-co/openmetrics-module#5) by
handing that text back verbatim — the scraper parses it, injects a
module="delivery_module" label, and merges it with other modules.
No in-module parsing/reshaping: the module is a pure passthrough.
Select it with {"name":"delivery_module","format":"text"} in the
openmetrics start config.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test: add real-node integration test for collectOpenMetricsText()
Asserts the live liblogosdelivery "Metrics" node-info path returns
non-empty Prometheus/OpenMetrics exposition text — the document the
openmetrics module's text source consumes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
add doctest
update config
test for kadmelia; remove kadmelia option from doctests; add another hang test
test for kadmelia
remove kadmelia option from doctests; add another hang test
test lib directly
increase timeout
make start call non-blocking and generate an event instead
remove poc test
remove poc test
send() now accepts QByteArray directly (base64 still applied internally
for the FFI JSON). messageReceived emits payload as QByteArray instead
of a base64-encoded QString, matching logos-delivery behaviour.
Closes#27
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>