An open API service indexing awesome lists of open source software.

https://github.com/loro-dev/iroh-loro


https://github.com/loro-dev/iroh-loro

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

# iroh-loro demo

A peer-to-peer collaborative **plain text** editing demo that uses
[iroh](https://github.com/n0-computer/iroh) for p2p networking and
[loro](https://github.com/loro-dev/loro) for CRDT-based **plain text** synchronization.

> This demo only works for 2 peers and a single **plain text** file at the moment

## Usage

The demo supports two modes: serving a file (hosting) and joining an existing
session.

### Hosting a File

To start hosting a file for collaborative editing:

```bash
cargo run -r serve
```

This will:

1. Start watching the specified file for changes
2. Print your Node ID that others can use to connect
3. Automatically sync changes on the given text file with any peers that join

### Joining a Session

To join an existing collaborative editing session:

```bash
cargo run -r join
```

Where:

- `REMOTE_NODE_ID` is the Node ID printed by the host
- `LOCAL_FILE_PATH` is where you want to save the synchronized file locally