Skip to content
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

[r2cn] 去中心化的 Relay 基础功能 #841

Open
genedna opened this issue Feb 10, 2025 · 1 comment
Open

[r2cn] 去中心化的 Relay 基础功能 #841

genedna opened this issue Feb 10, 2025 · 1 comment
Labels
decentralized enhancement New feature or request r2cn r2cn-30 rust Pull requests that update Rust code 未认领

Comments

@genedna
Copy link
Member

genedna commented Feb 10, 2025

[任务] 去中心化的 Relay 基础功能

[任务分值] 30 分

[背景描述] 为了减少对中心化 Git 服务的依赖,同时为了提供更加开放自由的开源协作环境,使用 QUIC 协议来为 Mega 构建去中心化网络,以支持分布式的仓库分享和消息传递等功能。QUIC 协议是基于 UDP 的可靠传输协议,具有低延迟和高安全的特点,是 HTTP/3 的底层协议。 Mega 将基于 QUIC 协议,并采用 RelayClient 的模型来构建去中心化网络,

Client 是本地 Mega 服务,Relay 是一种特殊 Client ,具备 Client 所有功能的同时,会拥有 节点发现连接管理消息转发 等服务,为 Client 提供去中心化接入支持。

[需求描述] 使用 quinntokio 库来实现 Relay 的功能:

  1. 连接管理
    1. 需要维护一个节点 IDConnection 的对应关系数据结构;
    2. 维持与节点的连接;
    3. 节点下线要清除无效的 Connection
  2. 消息转发服务
    1. 设计一个数据结构,用于接收和发送消息;
    2. 基于 tokio 库实现消息在线程之间传递;
    3. client 封装接口;
  3. 大文件传输功能:
    1. 提供大文件流式的传输功能;
  4. 编写测试用例对基本功能进行测试;
  5. 编写文档对架构设计进行说明;
  6. 更新网站的功能模块;

[代码标准]

  1. 所有 PR 提交必须签署 Signed-off-by 和 使用 GPG 签名,即提交代码时(使用 git commit 命令时)至少使用 -s -S 两个参数,参考 Contributing Guide
  2. 所有 PR 提交必须通过 GitHub Actions 自动化测试,提交 PR 后请关注 GitHub Actions 结果;
  3. 代码注释均需要使用英文;

[PR 提交地址] 提交到 mega 仓库的 main 分支 `` 目录;

[开发指导]

  1. 认领任务参考 r2cn 开源实习计划 - 任务认领与确认;

[导师及邮箱] 请申请此题目的同学使用邮件联系导师,或加入到 R2CN Discord 后在 #p-meta 频道和导师交流。

  1. Quanyi Ma genedna@gmail.com
  2. Tianxing Ye yetianxing2014@gmail.com

[备注]

  1. 认领实习任务的同学,必须完成测试任务和注册流程,请参考: r2cn 开源实习计划 - 测试任务r2cn 开源实习计划 - 学生注册与审核
@genedna genedna added this to the 0.3.0 - Decentralized Git milestone Feb 10, 2025
@genedna genedna added this to r2cn and Mega Feb 10, 2025
@genedna genedna moved this to Backlog in Mega Feb 10, 2025
@genedna genedna moved this to Backlog in r2cn Feb 10, 2025
Copy link

r2cn-bot bot commented Feb 10, 2025

任务创建成功。

@genedna genedna added decentralized rust Pull requests that update Rust code enhancement New feature or request 已认领 未认领 and removed 已认领 labels Feb 10, 2025
@genedna genedna moved this from Backlog to Ready in Mega Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decentralized enhancement New feature or request r2cn r2cn-30 rust Pull requests that update Rust code 未认领
Projects
Status: Ready
Status: Backlog
Development

No branches or pull requests

1 participant