A peer-to-peer collaborative text editing demo that uses iroh for p2p networking and loro for CRDT-based text synchronization.
This demo only works for 2 peers and a single text file at the moment
The demo supports two modes: serving a file (hosting) and joining an existing session.
To start hosting a file for collaborative editing:
cargo run -r serve <FILE_PATH>
This will:
- Start watching the specified file for changes
- Print your Node ID that others can use to connect
- Automatically sync changes on the given text file with any peers that join
To join an existing collaborative editing session:
cargo run -r join <REMOTE_NODE_ID> <LOCAL_FILE_PATH>
Where:
REMOTE_NODE_ID
is the Node ID printed by the hostLOCAL_FILE_PATH
is where you want to save the synchronized file locally