Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hoangph271/rust-libp2p-tutorial
https://github.com/hoangph271/rust-libp2p-tutorial
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hoangph271/rust-libp2p-tutorial
- Owner: hoangph271
- Created: 2022-08-18T06:26:51.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-18T06:26:54.000Z (over 2 years ago)
- Last Synced: 2024-10-25T10:51:02.472Z (2 months ago)
- Language: Rust
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
You need two terminals. In the first terminal window run:
```
cargo run --example ping
```It will print the PeerId and the new listening addresses, e.g.
```
Local peer id: PeerId("12D3KooWT1As4mwh3KYBnNTw9bSrRbYQGJTm9SSte82JSumqgCQG")
Listening on "/ip4/127.0.0.1/tcp/24915"
Listening on "/ip4/192.168.178.25/tcp/24915"
Listening on "/ip4/172.17.0.1/tcp/24915"
Listening on "/ip6/::1/tcp/24915"
```In the second terminal window, start a new instance of the example with:
```
cargo run --example ping -- /ip4/127.0.0.1/tcp/24915
```
The two nodes will establish a connection and send each other ping and pong messages every 15 seconds.