20 Commits

Author SHA1 Message Date
Ivan FB
dfedf2ba15
fix: rebuild when the vendor's Nim sources change
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>
2026-07-16 09:07:04 +02:00
Ivan FB
98d005c9e1
feat: consume the vendor's generated FFI bindings in waku-sys
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>
2026-07-16 00:56:16 +02:00
Ivan FB
96499cc735
feat: reliable channels bindings and vendor bump
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>
2026-07-16 00:44:30 +02:00
Ivan FB
9c9900897e
Adapt for nwaku v0.35 (#114)
* 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
2025-02-12 10:06:16 +01:00
Ivan FB
0c0b834aa0
Recover toy chat app powered by libwaku/nwaku (#105)
* 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
2025-01-10 15:19:31 +01:00
Ivan FB
fd7e73a7f0
Tic tac toe example (#104)
* 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>
2024-11-28 10:35:41 +01:00
richΛrd
646f6f0080
refactor: hide *mut c_void behind WakunodeContext (#96) 2024-02-26 11:13:30 -04:00
Richard Ramos
5687e2585c
chore: make sure waku_new, waku_start and waku_stop work 2024-02-13 16:18:16 -04:00
Richard Ramos
ca72e70bb6
chore: link required libraries and RLN 2024-02-13 14:50:00 -04:00
Richard Ramos
9750a329ab
feat: use nwaku instead of go-waku 2024-02-08 11:54:49 -04:00
richΛrd
dc641645b9
refactor: use callbacks to interact with go-waku bindings and remove JsonResponse (#74) 2023-11-02 13:59:41 -04:00
richΛrd
32bd05c6fc
feat: update go-waku version (#70)
- removes encoding functions from relay and lightpush
- adds `encode_symmetric` and `encode_asymmetric` to `WakuMessage`
- don't panic when unserializing json
2023-09-27 19:19:59 -04:00
Daniel Sanchez Quiros
a8b9bf22f5 Prepare for beta4 2023-02-15 11:42:38 +01:00
gusto
4c71e135ab
Run clippy --fix for updated lint requirements (#43) 2023-01-27 01:06:21 -08:00
gusto
18436dfc21
Set GOCACHE variable to off for crates.io (#25)
* Set GOCACHE variable to off for crates.io

* Modify GOCACHE only for crates.io builds
2022-11-30 09:45:22 +01:00
Daniel Sanchez
533619670f
Publish build (#22)
* Fix build errors when publishing

* Set VAC licences

* Set beta version to bindings
2022-11-28 17:57:20 +01:00
Daniel Sanchez
7ce8cadaa5
Ci and multiplatform build (#2)
* Make go discoverable in unix systems

* Refactor build script

* Fix which path

* Fix typo in error message

* Added gh actions ci

* Fix lib_dir path

* Use checkout v3

* Use recursive submodules

* Filter branches
Use submodule force update

* Use git directly instead of action

* Build go with relative paths

* Added missing cargo config file

* Use target os instead of family

* Add targets to matrix

* Try to use default for target

* Set toolchain

* Fix toolchain matrix
2022-09-28 15:45:26 +02:00
danielsanchezq
5c35417f49 Tiny docs 2022-09-23 08:47:28 +02:00
danielsanchezq
1dd73da1be Make c bindings from go lib build, compile and link 2022-09-22 15:13:16 +02:00
danielsanchezq
0de795496b Main project structure 2022-09-21 16:06:27 +02:00