This Rust application is a simple peer-to-peer gossip messaging system. It allows peers to gossip messages to each other over TCP connections.
- Random Message Generation: Messages are generated randomly to simulate real-world scenarios.
- Asynchronous I/O: The application uses Tokio for asynchronous I/O operations, enabling high concurrency.
- Command-Line Interface: The application is configurable via command-line arguments using the
clap
crate.
To run this application, you need to have Rust and Cargo installed on your system.
-
Clone this repository:
git clone https://github.com/neanvo/gossip-rust.git
-
Navigate into the project directory:
cd gossip-rust
-
Build the project using Cargo:
cargo build --release
To use the application, you can specify command-line arguments to configure the behavior of the peers.
Example usage:
Execute three bash commands into 3 distinct terminals:
./target/release/gossip-rust --period 10 --port 9001 --connect "127.0.0.1:9002,127.0.0.1:9003"
./target/release/gossip-rust --period 10 --port 9002 --connect "127.0.0.1:9001,127.0.0.1:9003"
./target/release/gossip-rust --period 10 --port 9003 --connect "127.0.0.1:9001,127.0.0.1:9002"