Commit Graph
41 Commits
Author SHA1 Message Date
Ivan FBandClaude Opus 4.8 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 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 FBandRichard Ramos 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 201a38a64e feat: example app (#99) 2024-03-11 12:00:30 -04:00
Richard Ramos 9d3b575037 chore: remove example (for now) 2024-02-21 15:54:55 -04:00
Richard Ramos 9c696e6097 feat: expose waku_version 2024-02-20 16:06:03 -04:00
Richard Ramos ca72e70bb6 chore: link required libraries and RLN 2024-02-13 14:50:00 -04:00
richΛrd 5aaafc7c20 fix: content topic should accept strings (#84) 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
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 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
richΛrd a487f79179 feat: websockets support (#63) 2023-07-13 18:33:24 -04:00
RichΛrd a4bfddece7 feat: update discv5 bootnodes (#62) 2023-06-12 09:46:13 -04:00
Richard Ramos 8b4241ea3f 0.1.0 2023-05-12 08:06:07 -04:00
Richard Ramos 6a2d449d7d fix: changes required to publish latest version 2023-05-11 14:01:34 -04:00
RichΛrd ce9f71a592 Add new changes from go-waku (#58)
* feat: add ephemeral and meta fields
* feat: seenTTL
* feat: expose list of topics
2023-05-10 10:13:50 -04:00
gusto 31255ac4c0 Update vendor with logLevel fix (#49) 2023-02-27 13:15:59 +02:00
Daniel Sanchez b8d7bdc850 Rc 1 (#48)
* Update vendor with nil enr fix

* RC 1
2023-02-22 11:36:28 +01:00
Daniel Sanchez c4ea87d7e5 Beta 5 (#47)
* Missing decode calls

* Dangling double free on waku default pubsub topic

* Dangling double free on waku create pubsub topic

* Update deps
Fix update changes
Upgrade beta version

* Add extra info to dns discovery results

* Update vendor
2023-02-20 12:44:55 +01:00
Daniel Sanchez 3593ff18e6 Expose local archive query method (#44)
* Update vendor

* Expose local archive query
Update to beta4

* Update bindings package to beta4

* Update bindings package to beta4

* Make store response fields public

* Added store configuration

* Use decode response function
2023-02-15 10:57:39 +01:00
gusto 48300c15a2 Smoke tests for waku node (#41)
* Fix for codecov branch names

* Codecov with all tests included

* Add tokio to node tests

* Run echo tests as seperate processes

* Add token to evade GH limiter

* Discv5 and default test for node
2023-01-27 11:35:07 +02:00
Daniel Sanchez 67e5aef69a Beta3 (#42)
* Update waku to the latest main

* Update beta version

* Update deps

* Add relay topics config entry

* Update test config
2023-01-26 12:58:45 +01:00
Daniel Sanchez c745839d93 Get versions ready to publish 0.1.0-beta2 (#39) 2023-01-06 10:29:10 +01:00
Augustinas Bacvinka b324908425 Run waku node related tests in sequence 2023-01-05 17:53:49 +02:00
al8n b8172167f4 add default value for Config 2022-12-21 00:33:08 +13:00
Daniel Sanchez aa06fcc969 Make topics const initializable (#28)
* Make topics const initializable

* Fix test

* Derive Eq, PartialEq for topics
2022-12-05 18:42:55 +01:00
Daniel Sanchez Quiros 718c28725d Refactor waku crate to waku-bindings 2022-11-29 10:28:32 +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 b59bf33933 Information prior to publishing (#21) 2022-11-28 10:18:42 +01:00
Daniel Sanchez c3ced48966 Added loglevel to waku config (#16) 2022-10-26 14:56:03 +02:00
Daniel Sanchez 0333d3256c Dns discovery (#15)
* Updated vendor source

* Added dns discovery method

* Use latest Go in check workflow

* Use host for nameserver

* Use reference instead of move Host
2022-10-25 11:25:23 +02:00
Daniel Sanchez c82f4ebe4a Main test and extended fixes (#10)
* Pipe protocol id

* Fix peer id connect

* Fix WakuPubSubTopic parsing

* Use optional timeout on publish messages

* More test cases

* Update vendor

* Use connect with peer_id

* Fix signal -> event -> message deserialization

* Actively wait for result to arrive the test node

* Clippy happy

* Clippy happy on tests

* Cleaning and adjusting types

* Updated vendor

* Fix keys dance

* Fix lightpush

* Add disconnect test

* Ignore node test for CI

* Add gcc on gh actions

* Reverse installing gcc

* Bring back gcc just for ubuntu and windows

* Removed rust-crypto unused dependency

* Clippy happy
2022-10-17 19:30:07 +02:00
Daniel Sanchez 94e643a250 Implement remaning stack (#9)
* Wrapped lightpush

* Optional signing key on relay a/symmetric publish

* Added lightpush docs

* Implemented filter methods wrappers

* Implemented store methods wrappers

* WakuHandle docs

* Plumbing filter, lightpush and store into node

* Callback RwLock -> Mutex

* Removed wrong todo

* Docs modules titles and links

* Missing link

* Implemented message decoding

* Decrypt docs header

* Added message and payload todos

* Added missing structs fields exposures and constructors

* Payload as base64

* Deserialize base64 encoded strings
Use proper types on payload

* Added MessageIndex type doc header

* Added missing documentation

* Added main lib header doc
2022-10-09 16:50:40 +02:00
Daniel Sanchez aefe45ad65 Relay (#8)
* Refactor node -> management

* Pipe peers methods to waku node handle

* Added relay topic types

* Added content topic, update pubsub topic

* Relay create content/pubsub topic

* Impl Display for topics

* Added symmetric and asymmetric publish

* Implement relay subscriptions methods

* Impl Serialize/Deserialize for Content/Pubsub topic

* Missing serde de::Error import

* Fix enconding typo

* Derive clone for general types

* Plumb relay methods to node

* Add docs to node methods

* Methods should be thread-safe

* Missing thread-safe methods

* Implement send + sync for the node handle

* Stylish space
2022-10-06 15:51:00 +02:00
Daniel Sanchez 98350f4e1f Use shared state to store callback closures for waku callbacks (#6)
* Use shared state to store callback closures for waku callbacks

* Cargo lock after rebase
2022-10-03 15:39:50 +02:00
Daniel Sanchez d320e55701 Node management (#5)
* Add modules

* Implemented waku config struct

* Implemented waku management functions

* Use optional config in waku_new

* Added config docs

* Fix tests

* Dbg error on gh actions

* Added fail result to dbg

* Removed gh actions dbg

* NodeConfig -> WakuNodeConfig

* Removed duplicated test

* Implemented safety layer on top of node

* Add exclusive running test

* Use static instead of const for global flag

* Do not allow for double initialization

* Update submodule to latest master commit with responses fixes

* Merge tests
2022-10-03 15:21:19 +02:00
Daniel Sanchez 7b7ba2975d General types (#1)
* Added JsonResponse type

* Add dependencies

* Added wakumessage

* Adjust go build to link with missing simbols on osx

* Added general types

* Nitpick in docs
2022-09-28 16:03:47 +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