The `rln` dependency exists only to force RLN symbols into the link, but
it had drifted two majors from the library it is meant to mirror: the
vendor pins `LIBRLN_VERSION := v2.0.2` and build.rs links that
`librln_v2.0.2.a`, while this crate still asked for 0.3.4.
That drift was invisible in isolation and fatal downstream. Every rln up
to 0.6.1 pins `serde = "=1.0.163"` exactly, so any consumer resolving
waku-bindings alongside a crate needing a newer serde -- openmls'
tls_codec wants ^1.0.184 -- fails to resolve at all, since cargo will not
duplicate serde 1.x. libchat cannot depend on this crate without it.
2.0.2 relaxes the pin to ^1.0.228 and matches what is linked. Verified by
building and linking libchat against it: no duplicate-symbol clash with
the vendor's archive.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ai43sF2rymPFMG9iki9fwL
The #[path] imports make rustfmt treat the vendor's generated bindings as
crate source, so `cargo fmt` rewrapped ~1400 lines of api.rs/ffi.rs inside
the submodule. The next regen reverts that, so it is pure churn -- and it
shows up as a spurious dirty vendor.
rustfmt.toml `ignore` would be the natural fix, but it is nightly-only and
is silently dropped on stable ("unstable features are only available in
nightly channel"), so the skip attribute goes on the imports instead.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bumps vendor to pick up channelExists, cherry-picked onto the nim-ffi
0.2.0 lineage: the chore/channel-exists branch forked before that
migration, so its pre-0.2.0 {.ffi.} shape would not compile here.
The typed model carries a real bool, so channel_exists_async returns
Result<bool, _> rather than the "true"/"false" string the original
would have produced.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The shim existed to satisfy Nim's cmdCount/cmdLine globals, which the static
library referenced when it pulled in the command-line machinery. Nothing in
liblogosdelivery.a (nor any archive on the link line) references either symbol
now, and a clean rebuild of the workspace and the basic example links without
it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
waku-sys was a thin -sys crate that only re-exported the generated FFI
sources via #[path] and carried the build. It sat between waku-bindings
and the generated crate for no real benefit -- the generated crate is the
actual -sys equivalent, and its own build.rs cannot build logos-delivery
(bare `nim c`, one link directive). So the wrapper is folded in:
- The build (make liblogosdelivery + the 13 link directives, librln
discovery, cmd.c) moves into waku-bindings/build.rs.
- waku-bindings pulls the generated ffi/types/api modules directly by
#[path] into the vendor submodule, which moves from waku-sys/vendor to
the repo root (vendor/).
- ciborium/flume and the cc build-dep move over; the waku-sys path
dependency is dropped.
Consumers are unaffected -- they always depended only on waku-bindings.
This is one crate and one layer fewer.
build.rs now also removes a stale build/liblogosdelivery.dylib after the
static build: the generated ffi.rs declares `#[link(name =
"logosdelivery")]` with no kind, so a dylib left by a non-STATIC make
would be linked dynamically over the static archive.
Full suite passes (4 tests + doctest, 1 ignored) and all three examples
build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Consuming apps depend on this crate from a local checkout, and the
operations were hard to find: the crate root was `pub use waku_sys::*`,
so everything a caller can do was hidden as methods on a glob-exported
LogosDeliveryCtx.
The crate-root docs now carry an Operations map — node lifecycle,
messaging, reliable channels, and the typed event listeners — with the
method names and a runnable example, so `cargo doc` and reading lib.rs
both show what is callable. The low-level waku_* kernel surface is noted
as the tier beneath.
The README gains a "Using the crate" section: clone + checkout, the
local path dependency, and the Nim/make/Rust build prerequisites.
Also fixes stale rustdoc links in the restored store DTOs and a bare URL
in the config docs, so the doc build is warning-clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bumps vendor to the typed SendRequest / ChannelSendRequest procs and
updates the channels test to fill the typed struct instead of building a
JSON string. send_async now takes SendRequest, channel_send_async takes
(channel_id, ChannelSendRequest); both structs are re-exported from the
generated crate.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Picks up the two logos-delivery commits: the generated C header
replacing the stale hand-written ones, and the cbor_serialization lock
corrected to 0.4.0. Neither touches the generated Rust bindings; the full
suite still passes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Cargo runs test binaries in parallel and serial_test only serialises
within one, so the channels and node suites were sharing ./data — two
processes over one on-disk persistency root. Nothing here proves that
caused harm, but shared mutable state across concurrent processes is not
worth leaving in place.
local_storage_path is added to WakuNodeConfig to make this expressible.
The field is worth having regardless: it was simply missing, and its
docs record that the persistency singleton refuses re-targeting, so a
second node in the same process must use the same path or fail to start.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
build.rs only invalidated on the generated rust_bindings, so editing any
Nim source left the linked archive stale and the tests silently ran
against the previous build -- which cost an hour of debugging a channel
failure against instrumentation that was never in the binary.
Also corrects channel_message_reaches_peer's ignore reason. The message
is not lost in SDS: Persistency is a process-wide singleton that refuses
re-targeting, so two in-process nodes share one SDS job whose rows are
keyed by channel id alone. The receiver loads the sender's history and
SDS rightly calls the message a replay. The channels API is fine; the
test needs two processes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The channel test only checked that create/send/close returned values, so
it passed while every send failed downstream: channel_send returns a
request id immediately and reports the outcome asynchronously, and with
no listener on onChannelMessageError there was nothing to notice. Asking
the question properly -- two nodes, one channel, does the payload arrive
-- surfaced three things, none of them caused by the nim-ffi migration.
Encryption was never installed, so no segment could ever be sent; that is
fixed in the vendor by naming the mechanism at channel creation.
Autosharding could not be switched on from here at all. A channel's shard
is derived from its content topic, so without it the send cannot even
auto-subscribe. num-shards-in-network exists on the kernel conf but
WakuNodeConfig never exposed it, so it is added here.
Ingress is still dropped below this layer, so channel_message_reaches_peer
is #[ignore]d with the evidence in its doc comment rather than deleted or
weakened into a test that cannot fail. The single-node test keeps its
narrow scope and now says why it asserts nothing about arrival.
The error listeners stay: a send that fails silently is exactly how this
went unnoticed, and they turn a timeout into a diagnosis.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
examples/ is its own cargo workspace and only examples/basic is a member
of the root one, so nothing built from the repo root ever compiled these
two. They still used waku_new, set_event_callback, WakuEvent and the
WakuNodeHandle typestate, none of which exist any more.
Both collapse their App<State> typestate: the node no longer carries one,
so neither can the app wrapping it. Event handling shrinks to a single
add_on_received_message_listener -- the filter on content topic stays,
but the enum match, the JSON parse and the panics on unexpected variants
go, since a listener only receives what it registered for. Payloads are
base64-decoded by the caller now.
The store DTOs (StoreQueryRequest, StoreResponse, StoreWakuMessageResponse)
come back as general/store.rs: they are plain serde shapes, and deleting
node/store.rs took them out along with the FFI call they sat next to.
toy-chat needs them to build the store query JSON and read the response.
CI gains a check over examples/Cargo.toml. Without it these rot silently
on the next API change, which is exactly how they got here.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The select arm discarded test_echo_messages' Result, so the test passed
whenever that future finished -- including the path where the message
never arrived and it returned Err. Only the 1000s timeout could fail it,
which made the assertion close to vacuous for the case it exists to
cover.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The generated crate already provides what this tier existed to build:
CBOR marshalling, the callback dance, and a typed method per proc. So
macros.rs (trampoline, handle_ffi_call) and libwaku_response.rs
(RET_OK/RET_ERR, LibwakuResponse) are deleted rather than ported, and
node/events.rs goes with them -- its WakuEvent enum is now one generated
payload struct per event, which is what the typed listeners hand back.
What survives is what the generated crate does not give us: the domain
layer (WakuMessage, WakuContentTopic, MessageHash, pubsubtopic) and
WakuNodeConfig, which still serialises to the JSON create_node takes --
that JSON is unchanged, only its transport moved to CBOR.
BREAKING CHANGE: WakuNodeHandle and its Initialized/Running typestate,
waku_new, and waku_destroy are gone; callers use LogosDeliveryCtx::create
and let Drop tear the node down. set_event_callback is gone too: events
are per-name now, so a whole-stream callback has no equivalent -- use the
typed add_on_*_listener methods, which deliver a payload struct instead
of a JSON string to match on.
Tests and the example move with the API. The event handling gets shorter
rather than longer: no from_str, no matching five variants, no panicking
on Unrecognized -- a listener only receives the event it registered for.
Callers now base64-decode payloads themselves, since that was WakuMessage's
serde doing it before.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nim-ffi 0.2.0 generates the Rust bindings from the Nim source, so
bindgen over the hand-written headers is no longer the source of truth
-- and could not be, since those headers describe the pre-CBOR ABI.
The generated sources are referenced in place under vendor rather than
copied, so regenerating them in logos-delivery flows straight through
with nothing to keep in sync. They stay sibling modules because api.rs
resolves its neighbours through `super::`.
build.rs keeps driving the build: it runs the vendor's make target,
scans for the version-and-hash-named nimble package dirs and librln, and
emits the miniupnpc / natpmp / c++ link flags. The generated build.rs
does none of that (it runs a bare `nim c --mm:orc` against a path that
does not resolve here), so only the bindgen half is dropped.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Exposes the reliable-channel surface: channel_create / channel_send /
channel_close on WakuNodeHandle, backed by the logosdelivery_channel_*
FFI calls. Channel state is persisted, so re-creating a closed channel
resumes it rather than starting fresh, and send payloads travel
base64-encoded.
Adds the three channel lifecycle events (received / sent / error) to
WakuEvent, plus the messaging events (sent, error, propagated, received)
and connection status change, so callers can observe delivery rather
than only firing and hoping.
build.rs resolves the nimble package dirs and librln by scanning rather
than hardcoding, since their names carry versions and hashes that move
whenever nimble.lock does. It also checks make's exit status: a failed
build previously passed silently and the crate linked a stale library
from an earlier run.
Bumps the vendor submodule to master.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* build.rs: initialize submodules the first time cargo build is invoked in waku-sys
* messagehash.rs only contains a String as the hex representation of msg hash
* events.rs adapt test to parse message event containing msg-hash in hex string format
* bump nwaku to v0.35.0
* waku-sys/build.rs use STATIC=1 instead of STATIC=true
* bump nwaku to the current master branch ( commit: 625c8ee5 )
* make the waku crate to behave tokio-asynchronously
* use of store
* use of lightpush and filter
* add waku-bindings/src/general/messagehash.rs
* add waku-bindings/src/general/time.rs
* add waku-bindings/src/general/waku_decode.rs
* add WakuEvent management (WakuMessage, ConnectionChange, TopicHealthChange.)
* add waku-bindings/src/macros.rs
* update nwaku vendor to v0.33.1
* build.rs: add negentropy dependency and cmdCount cmdLine dependencies
* fix: call waku_setup when instantiating waku_new
* Properly decode a Vec<Multiaddr>
* First commit tic-tac-toe
* adding some simple game logic to coordinate the turns a little
* some logic to panic if a proper event callback hasn't been set
* restoring back the type state pattern introduced by Richard
* new PubsubTopic type
* fix clippy issues
---------
Co-authored-by: Richard Ramos <info@richardramos.me>