-
Notifications
You must be signed in to change notification settings - Fork 32
Add iroh-loro: P2P CRDT sync using Loro and iroh #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jermsam
wants to merge
8
commits into
n0-computer:main
Choose a base branch
from
Jitpomi:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
- 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
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
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