Iron Messenger CLI is a peer-to-peer chat application built using the iroh-gossip library. It allows users to create or join chat rooms and exchange messages over a gossip protocol.
- Create or join chat rooms using a ticket system.
- Broadcast messages to all participants in a chat room.
- Peer-to-peer communication using the
irohandiroh-gossiplibraries. - Asynchronous and concurrent message handling.
- Ensure you have Rust installed.
- Clone this repository:
git clone https://github.com/Silver595/p2p_messanger.git cd iron-messenger-cli - Build the project:
cargo build --release
To create a new chat room and generate a ticket for others to join:
./iron-messenger-cli openor
cargo run open
To join an existing chat room using a ticket:
./iron-messenger-cli join --ticket <ticket>or
cargo run join <ticket>
You can set your nickname using the --name option:
./iron-messenger-cli --name "YourName" openor
cargo run -- --name user
-
User A creates a chat room:
./iron-messenger-cli open
Output:
> opening chat room for topic <topic> > ticket to join us: <ticket> -
User B joins the chat room using the ticket:
./iron-messenger-cli join --ticket <ticket>
-
Both users can now exchange messages.
anyhow: Error handling.clap: Command-line argument parsing.data-encoding: Encoding/decoding tickets in Base32.futures-lite: Asynchronous streams.irohandiroh-gossip: Peer-to-peer networking.rand: Random number generation.serdeandserde_json: Serialization and deserialization.tokio: Asynchronous runtime.
src/main.rs: Contains the entire application logic, including:- CLI parsing.
- Gossip protocol setup.
- Message broadcasting and receiving.
- Ticket encoding/decoding.
This project is licensed under the MIT License. See the LICENSE file for details.