增加更新重启逻辑

This commit is contained in:
2025-10-17 17:03:19 +08:00
parent 7184defc50
commit 248f9a28e7
24 changed files with 604 additions and 65 deletions

View File

@@ -14,13 +14,13 @@ import (
type (
IP2P interface {
// SendP2P 发送格式化消息
SendP2P(targetID string, typ string, data []byte) (err error)
Start(ctx context.Context, wsStr string) (err error)
// 创建libp2p主机
CreateLibp2pHost(ctx context.Context, port int) (host.Host, error)
// 发现并连接目标节点
DiscoverAndConnect(targetID string) error
// 发送数据到目标节点
SendData(targetID string, data []byte) error
// 初始化无服务器DHT作为节点加入DHT网络
DHTStart(ctx context.Context, h host.Host) (err error)
// 存储数据到DHT比如存储“目标节点ID-公网地址”的映射)