126 Commits

Author SHA1 Message Date
Ivan FB
dd4d093945
fix(examples): port toy-chat and tic-tac-toe-gui to the generated API
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>
2026-07-16 01:28:54 +02:00
Ivan FB
6a107e66cc
fix(test): let the echo's Result decide default_echo
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>
2026-07-16 01:09:34 +02:00
Ivan FB
430ebc0bda
feat!: expose the generated bindings, drop the hand-written FFI tier
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>
2026-07-16 01:08:23 +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
Igor Sirotin
95040402fe
chore: update license files to comply with Logos licensing requirements 2026-02-05 15:09:10 +00:00
Darshan
eb847fdb80
fix: ci workflow (#125) 2025-12-16 17:53:30 +05:30
Darshan
a02e631d53
chore: align with recent rename (#124) 2025-12-16 01:40:40 +05:30
Darshan K
4ec20e2ebe
chore: upgrade to V0.36.0 (#123) 2025-11-13 00:12:21 +05:30
gabrielmer
57505a1c06
chore: update store json to camelCase (#117) 2025-04-11 14:26:07 +03:00
Ivan FB
1d95d05dd7
avoid closure to be dropped in release mode (#116) 2025-03-05 09:39:15 +01: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
richΛrd
90577d1d58
feat: add discv5_bootstrap_nodes attribute to the config (#112) 2025-02-03 13:33:14 -04:00
Ivan FB
247f740f1d
docs: add simple README.md for all examples (#111)
Co-authored-by: richΛrd <info@richardramos.me>
2025-01-20 16:15:45 +01:00
Ivan FB
75b5c4c4f8
add Makefile and scripts allow build libwaku in cargo publish (#108) 2025-01-14 17:03:40 +01:00
Ivan Folgueira Bande
64736c0284
README.md change go-waku with nwaku 2025-01-13 15:30:08 +01:00
Ivan FB
c2412134d3
upgrade major version to create 1.0.0 (#107) 2025-01-13 09:50:05 +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
7a2e4d1d01
feat: RLN Relay (#101) 2024-04-01 15:15:50 -04:00
richΛrd
1ed7dd48ed
chore: disable windows builds temporarily (#100) 2024-03-21 09:17:59 -04:00
richΛrd
201a38a64e
feat: example app (#99) 2024-03-11 12:00:30 -04:00
richΛrd
69a48725ca
refactor: node handle constructor and messageHash on publish (#98)
* refactor: node handle constructor and messageId on publish
* refactor: add back typestate
* chore: rename messageId to messageHash
2024-03-01 11:31:00 -04:00
richΛrd
a10a5c2d22
refactor: use a enum for handling the responses, and don't ignore the return code (#97)
* refactor: handle return code and use an enum to handle responses
* fix: nwaku does not return an envelope hash on publish
2024-03-01 11:25:02 -04:00
richΛrd
646f6f0080
refactor: hide *mut c_void behind WakunodeContext (#96) 2024-02-26 11:13:30 -04:00
Richard Ramos
c434e9ebf5
refactor: remove getters 2024-02-22 10:57:02 -04:00
Richard Ramos
9d3b575037
chore: remove example (for now) 2024-02-21 15:54:55 -04:00
Richard Ramos
ac96b834a0
chore: use rust node address instead of fleet node in tests 2024-02-21 14:07:42 -04:00
Richard Ramos
79b8428bb5
feat: add listen addresses 2024-02-21 11:59:40 -04:00
Richard Ramos
9c696e6097
feat: expose waku_version 2024-02-20 16:06:03 -04:00
Richard Ramos
685a6aef0a
fix: event handler 2024-02-16 10:45:20 -04:00
Richard Ramos
1f9283a849
fix: event callback signature 2024-02-13 18:03:34 -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
1d8626b110
chore: remove code no longer needed (for now) 2024-02-12 20:13:49 -04:00
Richard Ramos
8755d9a7c8
refactor: remove unneeded functions and change some data types 2024-02-08 17:16:34 -04:00
Richard Ramos
9d73230c8a
chore: remove unneeded files (for now) 2024-02-08 17:15:49 -04:00
Richard Ramos
9750a329ab
feat: use nwaku instead of go-waku 2024-02-08 11:54:49 -04:00
richΛrd
1ea96f80b2
feat: add dns discovery parameters (#85) 2024-02-06 13:38:51 -04:00
richΛrd
5aaafc7c20
fix: content topic should accept strings (#84) v0.5.0 2023-12-08 17:30:30 -04:00
richΛrd
dc32f22f4a
feat: add filterv2 functions (#75) 2023-11-07 15:50:35 -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
Richard Ramos
3acddc9023
fix: 0.4.0 2023-10-30 08:24:30 -04:00
richΛrd
ba17a46978
fix: race condition in peer connector / manager interaction (#81)
See https://github.com/waku-org/go-waku/pull/837
2023-10-30 08:18:38 -04:00
richΛrd
190e1f6b09
fix: enable legacy filter (#78) 2023-10-04 08:45:49 -04:00
Richard Ramos
e61732a8c7
feat: v0.3.1 2023-10-01 15:47:17 -04:00
richΛrd
00bf354d43
fix: waku_peer_count conversion to usize (#76) 2023-10-01 15:40:33 -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
Anton Iakimov
6b35fb7d62
update wakuv2 fleet DNS discovery enrtree
https://github.com/status-im/infra-misc/issues/171
2023-09-26 15:15:39 +02:00
richΛrd
a487f79179
feat: websockets support (#63) 2023-07-13 18:33:24 -04:00