mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-01-04 06:53:06 +00:00
add simple README.md for all examples
This commit is contained in:
parent
75b5c4c4f8
commit
3d8e32710d
19
examples/basic/README.md
Normal file
19
examples/basic/README.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
### Description
|
||||||
|
|
||||||
|
This is a very simplistic example where two waku nodes are instantiated within the same Rust app.
|
||||||
|
|
||||||
|
### What it does
|
||||||
|
|
||||||
|
1. Instantiates two Waku nodes
|
||||||
|
2. Each node registers an event callback (waku message event, connection change event, etc.)
|
||||||
|
3. Each node starts
|
||||||
|
4. Each node perform relay subscription
|
||||||
|
5. "node1" publishes a waku message
|
||||||
|
6. Both nodes are stopped
|
||||||
|
|
||||||
|
### How to run
|
||||||
|
From within the `examples/basic/` foder run:
|
||||||
|
```code
|
||||||
|
cargo run
|
||||||
|
```
|
||||||
|
|
||||||
24
examples/tic-tac-toe-gui/README.md
Normal file
24
examples/tic-tac-toe-gui/README.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
### Description
|
||||||
|
|
||||||
|
This is a tic-tac-toe example that aims to show how to deal with
|
||||||
|
a Waku node in an app with UI. The example is very naïve and it
|
||||||
|
assumes only two tic-tac-toe instances are running globally. Therefore, the game messages might collide with other plays.
|
||||||
|
|
||||||
|
The game board is shown within a Rust eframe.
|
||||||
|
|
||||||
|
### What it does
|
||||||
|
|
||||||
|
1. Instantiates one Waku node
|
||||||
|
2. Starts the Waku node
|
||||||
|
3. Registers the node to waku events (messages, connection change, topic health, etc.)
|
||||||
|
4. Subscribes de node to the game_topic
|
||||||
|
|
||||||
|
### How to run
|
||||||
|
From within the `examples/tic-tac-toe/` foder run:
|
||||||
|
```code
|
||||||
|
cargo run
|
||||||
|
```
|
||||||
|
|
||||||
|
Another player can start his/her instance in either another
|
||||||
|
terminal or another machine.
|
||||||
|
|
||||||
21
examples/toy-chat/README.md
Normal file
21
examples/toy-chat/README.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
### Description
|
||||||
|
|
||||||
|
This is a chat example where multiple participants can talk within the same room.
|
||||||
|
|
||||||
|
### What it does
|
||||||
|
|
||||||
|
1. Instantiates one Waku node
|
||||||
|
2. Starts the Waku node
|
||||||
|
3. Registers the node to waku events (messages, connection change, topic health, etc.)
|
||||||
|
4. Subscribes de node to the game_topic
|
||||||
|
5. Retrieves previous chat messages at the beginning
|
||||||
|
|
||||||
|
### How to run
|
||||||
|
From within the `examples/toy-chat/` folder, run the following to start a chat using the given nick name.
|
||||||
|
|
||||||
|
e.g.:
|
||||||
|
```code
|
||||||
|
cargo run "Alice"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user