Skip to content

Commit 6ebdebd

Browse files
committed
docs: update readme
1 parent 52b9df0 commit 6ebdebd

File tree

1 file changed

+9
-29
lines changed

1 file changed

+9
-29
lines changed

examples/chat/README.md

+9-29
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,24 @@
11
# Chat
2-
This examples show cases how to manually dial (connect to) either local peer or remote peer has a reservation on relay-server.
2+
This examples show cases how to build chat application with DCUtR, mDNS, Relay, Rendezvous and GossipSub protocols.
3+
- Local node gets reservation on the relay.
4+
- Local node advertises relayed address at the Rendezvous node.
5+
- Local nodes discovers other local nodes via mDNS discovery and attempts direct connection.
6+
- Local nodes discovers other remote nodes via Rendezvous discovery and attempts hole punched connectioned.
37

4-
## Run local only
5-
This examples shows how to run two sessions locally and connect sessions by manually dialing local peer.
6-
7-
Run first chat session in echo mode.
8-
```
9-
cargo run -p chat-example -- --mode echo --port 4002 --secret-key-seed 102 --gossip-topic-names calimero-network/examples/chat/v0.0.1 --relay-address /ip4/3.71.239.80/udp/4001/quic-v1/p2p/12D3KooWAgFah4EZtWnMMGMUddGdJpb5cq2NubNCAD2jA5AZgbXF
10-
```
11-
12-
Run second chat session in interactive mode with local peer dial.
13-
```
14-
cargo run -p chat-example -- --mode interactive --port 4003 --secret-key-seed 103 --gossip-topic-names calimero-network/examples/chat/v0.0.1 --dial-peer-addrs /ip4/127.0.0.1/udp/4002/quic-v1/p2p/12D3KooWMpeKAbMK4BTPsQY3rG7XwtdstseHGcq7kffY8LToYYKK --relay-address /ip4/3.71.239.80/udp/4001/quic-v1/p2p/12D3KooWAgFah4EZtWnMMGMUddGdJpb5cq2NubNCAD2jA5AZgbXF
15-
```
16-
17-
In the interactive session publish new message manually:
18-
```
19-
publish calimero-network/examples/chat/v0.0.1 ola
20-
```
21-
22-
## Run locally with remote peer dial in
23-
This examples shows how to run two sessions locally and connect sessions manually by dialing private remote peer from each session. For the gossip message to pass from one local session to second local session it needs to go "the long way" around (local -> remote -> local).
24-
25-
Additional info:
26-
- Remote instance is running in a private subnet behind NAT.
27-
- Remote instance PeerId: `12D3KooWP285Hw3CSTdr9oU6Ezz4hDoi6XS5vfDjjNeTJ1uFMGvp`
28-
- Remote instance address at the relay server: `ip4/3.71.239.80/udp/4001/quic-v1/p2p/12D3KooWAgFah4EZtWnMMGMUddGdJpb5cq2NubNCAD2jA5AZgbXF/p2p-circuit/p2p/12D3KooWP285Hw3CSTdr9oU6Ezz4hDoi6XS5vfDjjNeTJ1uFMGvp`
8+
## Run
299
Run first chat session in interactive mode with remote peer dial.
3010
```
31-
cargo run -p chat-example -- --mode interactive --port 4002 --secret-key-seed 102 --gossip-topic-names calimero-network/examples/chat/v0.0.1 --dial-peer-addrs /ip4/3.71.239.80/udp/4001/quic-v1/p2p/12D3KooWAgFah4EZtWnMMGMUddGdJpb5cq2NubNCAD2jA5AZgbXF/p2p-circuit/p2p/12D3KooWP285Hw3CSTdr9oU6Ezz4hDoi6XS5vfDjjNeTJ1uFMGvp --relay-address /ip4/3.71.239.80/udp/4001/quic-v1/p2p/12D3KooWAgFah4EZtWnMMGMUddGdJpb5cq2NubNCAD2jA5AZgbXF
11+
cargo run -p chat-example -- --mode interactive --port 4002 --secret-key-seed 102 --gossip-topic-names calimero-network/examples/chat/v0.0.2 --boot-nodes /ip4/35.156.78.13/udp/4001/quic-v1/p2p/12D3KooWRnt7EmBwrNALhAXAgM151MdH7Ka9tvYS91ZUqnqwpjVg
3212
```
3313

3414
Run second chat session in interactive mode with remote peer dial.
3515
```
36-
cargo run -p chat-example -- --mode interactive --port 4003 --secret-key-seed 103 --gossip-topic-names calimero-network/examples/chat/v0.0.1 --dial-peer-addrs /ip4/3.71.239.80/udp/4001/quic-v1/p2p/12D3KooWAgFah4EZtWnMMGMUddGdJpb5cq2NubNCAD2jA5AZgbXF/p2p-circuit/p2p/12D3KooWP285Hw3CSTdr9oU6Ezz4hDoi6XS5vfDjjNeTJ1uFMGvp --relay-address /ip4/3.71.239.80/udp/4001/quic-v1/p2p/12D3KooWAgFah4EZtWnMMGMUddGdJpb5cq2NubNCAD2jA5AZgbXF
16+
cargo run -p chat-example -- --mode interactive --port 4003 --secret-key-seed 103 --gossip-topic-names calimero-network/examples/chat/v0.0.2 --boot-nodes /ip4/35.156.78.13/udp/4001/quic-v1/p2p/12D3KooWRnt7EmBwrNALhAXAgM151MdH7Ka9tvYS91ZUqnqwpjVg
3717
```
3818

3919
In any interactive session publish new message manually:
4020
```
41-
publish calimero-network/examples/chat/v0.0.1 ola
21+
publish calimero-network/examples/chat/v0.0.2 ola
4222
```
4323

4424
## Debugging and known issues

0 commit comments

Comments
 (0)