-
Notifications
You must be signed in to change notification settings - Fork 58
Feature:gemini enable p2p git-clone function #911
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a P2P git-clone functionality in the gemini module and its integration in the gateway HTTP server. Key changes include:
- Updates to repository identifier utility functions and the addition of a new LFS pointer parser.
- Implementation of new P2P endpoints (repo_fork, repo_share, and peer_id) in the gateway API.
- Enhancements to the P2P relay code for handling multiple connection types and data transfers (including git clone and LFS).
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
gemini/src/util.rs | Refactored identifier functions and added LFS pointer data parsing. |
gemini/src/http/handler.rs | Introduced get_path_from_identifier and a corresponding test case. |
gateway/src/api/p2p_router.rs | Added new P2P API endpoints for fork, share, and peer_id retrieval functions. |
gemini/Cargo.toml | Added dependencies for futures util, tokio util, tokio stream, and tracing subscriber. |
gemini/src/p2p/relay.rs | Updated relay connection handling with refined connection map usage and added git clone/LFS support. |
gemini/src/p2p/mod.rs | Extended the P2P action enum and introduced new RequestData/ResponseData structures and headers. |
gateway/src/https_server.rs | Integrated the new p2p_router and updated bootstrap logic for P2P network joining. |
gateway/src/api/nostr_router.rs | Adjusted repo_path_to_identifier usage consistent with the latest signature changes. |
jupiter/callisto/src/import_refs.rs & db_enums.rs | Added serde derives for improved serialization support in data models. |
Comments suppressed due to low confidence (3)
gateway/src/api/p2p_router.rs:31
- [nitpick] Consider updating the error message to 'Identifier not provided' for better grammatical clarity.
String::from("Identifier not provide\n")
gateway/src/api/p2p_router.rs:58
- [nitpick] Consider updating the error message to 'bootstrap node not provided' to improve clarity and maintain consistency.
String::from("bootstrap node not provide\n")
gateway/src/api/p2p_router.rs:84
- [nitpick] Consider updating the error message to 'path not provided' for consistency and clarity.
return Err((StatusCode::BAD_REQUEST, String::from("path not provide\n")));
Now you can start a p2p network through gemini module:
For relay:
For client, you should specify bootstrap_node
In the p2p module of gemini, you can use some methods :
For example to clone a repo with lfs:
Link:#841