Skip to content

Conversation

jermsam
Copy link

@jermsam jermsam commented Sep 5, 2025

This PR adds a new example demonstrating Loro CRDT integration with iroh's P2P networking.
https://loro.dev

- Implement IrohLoroProtocol for syncing Loro documents over P2P connections
- Add snapshot-based sync protocol with clean termination
- Support key-value data replication between nodes
- Include comprehensive README with usage examples
- Clean, production-ready code without debug output
- Add .idea/ to .gitignore
@n0bot n0bot bot added this to iroh Sep 5, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Sep 5, 2025
- Complete real-time protocol with incremental sync and persistent connections
- Presence awareness with cursor tracking and user indicators
- Conflict resolution with automatic and manual strategies
- Connection management with heartbeats and reconnection
- TUI editor example for collaborative text editing
- CLI demo with interactive commands
- Comprehensive documentation with architecture diagrams
- Updated main README with new package entry
- Update imports for iroh v0.91 compatibility
- Fix NodeId import paths in all modules
- Move demo binary to examples/ directory following Rust conventions
- Fix TUI editor blocking runtime error by using try_read() instead of blocking_read()
- Clean up unused imports and variables
- All examples now compile and run successfully
- Support for real-time collaborative editing with both CLI and TUI interfaces
- Created comprehensive collaborative-editor example with terminal UI
- Implemented real-time collaborative editing using Loro CRDTs and iroh P2P
- Added modular architecture with separate modules for:
  - Protocol handling (protocol.rs)
  - Connection management (connection.rs)
  - Presence management (presence.rs)
  - Event system (events.rs)
- Features include:
  - Real-time text editing with cursor synchronization
  - User presence indicators with colors
  - P2P networking with relay fallback
  - CLI options for connection and configuration
- Cleaned up all compiler warnings with #[allow(dead_code)] attributes
- Removed old example files and consolidated functionality
- Updated project structure and dependencies

Tested successfully with Alice/Bob demo showing:
- P2P connection establishment (relay + direct)
- Document synchronization
- Peer join/leave detection
- Real-time collaboration
@jermsam jermsam changed the title Add iroh-loro: P2P CRDT sync using Loro and iroh Draft: Add iroh-loro: P2P CRDT sync using Loro and iroh Sep 6, 2025
@jermsam
Copy link
Author

jermsam commented Sep 6, 2025

I dmed @zxch3non the loro team and he shared a better example. https://github.com/loro-dev/iroh-loro However, the example he shared is using iroh 0.35. I will change my PR to draft mode, upgrade the example that he shared to use iroh 0.91.2's protocol. Then modify my PR accordingly

- Implement IrohLoroProtocol using Loro CRDT for conflict-free text editing
- Add real-time peer-to-peer synchronization via Iroh networking
- Support concurrent sync operations with bounded futures
- Include demo files for testing collaborative editing
- Add proper error handling and logging throughout
@jermsam jermsam changed the title Draft: Add iroh-loro: P2P CRDT sync using Loro and iroh Add iroh-loro: P2P CRDT sync using Loro and iroh Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

1 participant