Add iroh-loro: P2P CRDT sync using Loro and iroh#132
Draft
jermsam wants to merge 8 commits inton0-computer:mainfrom
Draft
Add iroh-loro: P2P CRDT sync using Loro and iroh#132jermsam wants to merge 8 commits inton0-computer:mainfrom
jermsam wants to merge 8 commits inton0-computer:mainfrom
Conversation
- 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
- 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
Author
|
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
Member
|
I personally think the iroh-loro repo might be a better place for this example, as it's where we've previously put effort. Given that that's where the effort went now again, do you think we should close this PR? Arguably there's still a discoverability issue. Perhaps we can add a link to the iroh-loro example in the readme of iroh-examples? Do you want to open a PR for that? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new example demonstrating Loro CRDT integration with iroh's P2P networking.
https://loro.dev