Commit Graph

16 Commits

Author SHA1 Message Date
Ivan FB 19feb6bd58
libwaku better params validation and a bit more clarity (#3005) 2024-08-29 22:57:23 +02:00
Ivan FB fd6a71cdd7
chore: Bump dependencies for v0.31.0 (#2885)
* bump_dependencies.md: add nim-results dependency
* change imports stew/results to results
* switching to Nim 2.0.8
* waku.nimble: reflect the requirement nim 1.6.0 to 2.0.8
  Adding --mm:refc as nim 2.0 enables a new garbage collector that we're
  not yet ready to support
* adapt waku code to Nim 2.0
* gcsafe adaptations because Nim 2.0 is more strict
2024-07-09 13:14:28 +02:00
richΛrd 1e2aa57a26
chore: android support (#2554) 2024-05-21 21:00:22 -04:00
Ivan FB 5ee4cba534
simple library cleanup of unused imports and duplicated code (#2710) 2024-05-18 15:04:04 +02:00
Ivan FB 840e012294
chore: move code from wakunode2 to a more generic place, waku (#2670)
* testlib/wakunode.nim: not use cluster-id == 1 to avoid test rln by default
2024-05-13 17:45:48 +02:00
Ivan FB 2463527b24
refactor: big refactor to add waku component in libwaku instead of onlu waku node (#2658) 2024-05-03 14:07:15 +02:00
Ivan FB 3ba4378cbe
Generic re-style with nph 0.5.1 (#2396) 2024-03-16 00:08:47 +01:00
richΛrd 8341864d30
feat(c-bindings): add function to dealloc nodes (#2499) 2024-03-07 13:53:03 -04:00
richΛrd d01585e9fa
fix(bindings): base64 payload and key for content topic (#2435)
* fix(bindings): base64 payload and key for content topic
* fix(bindings): store userData for event callback
* fix(bindings): json message serialization
* fix(bindings): add messageHash to the event callback
* fix(bindings): add meta field
* refactor(bindings): simplify error handling
* fix: handle undefined keys
2024-02-20 16:00:03 -04:00
richΛrd 707f3e8bf0
feat: `eventCallback` per wakunode and `userData` (#2418)
* feat: store event callback in `Context`
* feat: add userData to callbacks
2024-02-13 10:22:22 -04:00
Ivan FB 1e8f577104
chore(cbindings): avoid using global var in libwaku.nim (#2118)
* libwaku: Avoid global variable and changing callback signature

* Better signature for the callback. Two new parameters have been added:
  one aimed to allow passing the caller result code; the other
  param is to pass an optional userData pointer that might need
  to be linked locally with the Context object. For example, this is needed
  in Rust to make the passed closures live as
  long as the Context.

* waku_example.c: adaptation to the latest changes

* libwaku.h: removing 'waku_set_user_data' function

* libwaku.nim: renaming parameter in WakuCallBack (isOk -> callerRet)
2023-10-23 08:37:28 +02:00
Ivan Folgueira Bande 6cea737109
waku_thread.nim: Using 'ThreadSignalPtr' instead of loop to handle req/resp (#2045) 2023-09-22 16:36:31 +02:00
Ivan Folgueira Bande 72f90663cd
refactor(cbindings): Thread-safe communication between the main thread and the Waku Thread (#1978)
* Thread-safe comms between main thread & Waku Thread - ChannelSPSCSingle.
* Renaming procs from 'new' to 'createShared'. They use the shared allocator.
* peer_manager_request: no need to use ptr WakuNode.
* waku_thread: moving the 'waitFor' to upper layer.
* waku_thread: `poll()` -> `waitFor sleepAsync(1)` to avoid risk of blocking.
* libwaku: thread-safe "sub-objects" in an inter-thread requests.
  When two threads send data each other, that data cannot contain any
  GC'ed type (string, seq, ref, closures) at any level.
* Allocating the 'configJson' in main thread and deallocating in Waku Thread.
2023-09-18 09:21:50 +02:00
Ivan Folgueira Bande 68e8d9a79c
chore(cbindings): Thread-safe libwaku. WakuNode instance created directly from the Waku Thread (#1957)
* libwaku: create the WakuNode in the Waku thread. Not in the main thread
* node_lifecycle_request.nim: moving hard-coded value to a const item
* libwaku.nim: start using 'isOkOr' instead of 'isErr()'-approach
* node_lifecycle_request.nim: better 'async' & 'await' usage. Not block the runtime
2023-09-01 08:37:02 +02:00
Hanno Cornelius b9d5d28af5
chore: remove references to v2 (#1898)
* chore: remove references to v2

* fix: lingering rln-relay import path
2023-08-09 18:11:50 +01:00
Ivan Folgueira Bande 069c1ad2a5
refactor(cbindings): libwaku - run waku node in a secondary working thread (#1865)
* Refactoring to have a working waku_thread
2023-07-31 09:52:04 +02:00