mirror of
https://github.com/logos-messaging/logos-delivery-rust-bindings.git
synced 2026-02-28 06:03:34 +00:00
logos-delivery Rust Bindings
Rust bindings for logos-delivery (Waku) v0.38.0-beta, built on top of the C FFI.
Prerequisites
- Rust (stable) — rustup.rs
- Nim 2.x — required to compile the native
libwakulibrary - Make
- GCC or Clang
Setup
Clone the repository:
git clone https://github.com/logos-messaging/logos-delivery-rust-bindings.git
cd logos-delivery-rust-bindings
The first cargo build / cargo run automatically:
- Initializes and updates git submodules
- Compiles the native
libwakustatic library viamake libwaku STATIC=1 - Generates Rust FFI bindings via
bindgen
Running the Examples
basic
Two Waku nodes in the same process. Node 1 publishes a message; node 2 receives it via relay subscription.
cd examples/basic
cargo run
toy-chat
Multi-participant chat room over Waku relay. Pass your nickname as argument.
cd examples/toy-chat
cargo run "Alice"
Start another instance in a separate terminal (or on another machine) to chat:
cargo run "Bob"
tic-tac-toe-gui
Multiplayer tic-tac-toe with a native GUI (eframe). Start two instances — locally or on separate machines.
cd examples/tic-tac-toe-gui
cargo run
Running the Tests
Tests start real Waku nodes and bind to local TCP ports, so they must run serially:
# from repo root
cargo test -p waku-bindings -- --test-threads=1
# or from waku-bindings/
cd waku-bindings
cargo test
To see log output:
cargo test -- --nocapture
Crates
| Crate | Description |
|---|---|
waku-bindings |
High-level Rust API |
waku-sys |
Low-level bindgen FFI bindings |
About Waku
Waku is a family of robust, censorship-resistant communication protocols for Web3. Private. Secure. Runs anywhere.
Read the Waku docs
Description
Languages
Rust
99.6%
C
0.4%