Skip to content

Iron Messenger CLI is a Rust-based peer-to-peer chat app for the command line, using iroh and iroh-gossip for secure, decentralized messaging. Connect via a ticket-based system and chat in real time—no servers required.

Notifications You must be signed in to change notification settings

Silver595/p2p_messanger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Iron Messenger CLI

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.

Features

  • Create or join chat rooms using a ticket system.
  • Broadcast messages to all participants in a chat room.
  • Peer-to-peer communication using the iroh and iroh-gossip libraries.
  • Asynchronous and concurrent message handling.

Installation

  1. Ensure you have Rust installed.
  2. Clone this repository:
    git clone https://github.com/Silver595/p2p_messanger.git
    cd iron-messenger-cli
  3. Build the project:
    cargo build --release

Usage

Open a Chat Room

To create a new chat room and generate a ticket for others to join:

./iron-messenger-cli open

or

cargo run open

Join a Chat Room

To join an existing chat room using a ticket:

./iron-messenger-cli join --ticket <ticket>

or

cargo run join <ticket>

Set a Nickname

You can set your nickname using the --name option:

./iron-messenger-cli --name "YourName" open

or

 cargo run -- --name user

Example Workflow

  1. User A creates a chat room:

    ./iron-messenger-cli open

    Output:

    > opening chat room for topic <topic>
    > ticket to join us: <ticket>
    
  2. User B joins the chat room using the ticket:

    ./iron-messenger-cli join --ticket <ticket>
  3. Both users can now exchange messages.

Development

Dependencies

  • anyhow: Error handling.
  • clap: Command-line argument parsing.
  • data-encoding: Encoding/decoding tickets in Base32.
  • futures-lite: Asynchronous streams.
  • iroh and iroh-gossip: Peer-to-peer networking.
  • rand: Random number generation.
  • serde and serde_json: Serialization and deserialization.
  • tokio: Asynchronous runtime.

Code Structure

  • src/main.rs: Contains the entire application logic, including:
    • CLI parsing.
    • Gossip protocol setup.
    • Message broadcasting and receiving.
    • Ticket encoding/decoding.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Iron Messenger CLI is a Rust-based peer-to-peer chat app for the command line, using iroh and iroh-gossip for secure, decentralized messaging. Connect via a ticket-based system and chat in real time—no servers required.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages