https://github.com/rstudio-tech/p2p-gossiping-rust
P2P-gossiping application with rust
https://github.com/rstudio-tech/p2p-gossiping-rust
Last synced: 11 months ago
JSON representation
P2P-gossiping application with rust
- Host: GitHub
- URL: https://github.com/rstudio-tech/p2p-gossiping-rust
- Owner: rstudio-tech
- Created: 2024-12-16T08:56:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-16T08:57:33.000Z (over 1 year ago)
- Last Synced: 2025-07-02T17:55:29.029Z (11 months ago)
- Language: Rust
- Size: 92.8 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple p2p gossiping app written with actix-actor framework
The peer have a cli interface to start it and connect itself to the other peers.
Once connected, the peer starts sending a random gossip message (and printing it) to all the other peers every N seconds.
The messaging period [N] is specifiable in the command line.
When a peer receives a message from the other peers, it prints it in the console.
* to build peer bin:
`cargo build --release`
* to run peer app:
`cargo run --package p2p_gossiping_app --bin p2p_gossiping_app -- [options]` or `target/release/p2p_gossiping_app [options]`
### Starting the first peer with messaging period 5 seconds at port 8080:
`cargo run --package p2p_gossiping_app --bin p2p_gossiping_app -- --period=5 --port=8080`
### Starting the second peer (with options) which will connect to the first, messaging period - 6 seconds, port - 8081
`cargo run --package p2p_gossiping_app --bin p2p_gossiping_app -- --period=6 --port=8081 --connect="127.0.0.1:8080"`
### Starting the third peer (with options) which will connect to all the peers through the first, messaging period - 7 seconds, port - 8082
`cargo run --package p2p_gossiping_app --bin p2p_gossiping_app -- --period=7 --port=8082 --connect="127.0.0.1:8080"`