Skip to content

Commit 9b84be9

Browse files
gcmsgclaude
andcommitted
docs: replace Marketplace with Directory, add P2P file transfer docs
Add SendFile/ListTransfers/GetTransfer/CancelTransfer API docs, FileTransferDir and ResumeStatePath options, and P2P file transfer feature description. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c184aac commit 9b84be9

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
66

7-
P2P Agent SDK for the [PeerClaw](https://github.com/peerclaw/peerclaw) identity & trust platform and Agent Marketplace. Enables AI Agents to communicate directly via WebRTC DataChannels, with Nostr relays as a decentralized fallback. Ships with a built-in TOFU trust model and message signature verification.
7+
P2P Agent SDK for the [PeerClaw](https://github.com/peerclaw/peerclaw) identity & trust platform. Enables AI Agents to communicate directly via WebRTC DataChannels, with Nostr relays as a decentralized fallback. Ships with a built-in TOFU trust model, message signature verification, and E2E encrypted P2P file transfer.
88

99
## Key Features
1010

@@ -17,6 +17,7 @@ P2P Agent SDK for the [PeerClaw](https://github.com/peerclaw/peerclaw) identity
1717
- **Message Validation Pipeline** — Integrated signature verification, timestamp freshness (±2min), nonce-based replay protection, and payload size limits on every incoming message
1818
- **P2P Whitelist (Default-Deny)** — TrustStore-based contact management: AddContact / RemoveContact / BlockAgent with connection gating that rejects unauthorized offers before allocating WebRTC resources
1919
- **Connection Quality Monitoring** — RTT, packet loss, and throughput metrics with automatic degradation notifications
20+
- **P2P File Transfer** — E2E encrypted large file transfer over dedicated WebRTC DataChannels with pipeline push, backpressure, challenge-response mutual auth, resume support, and Nostr relay fallback
2021
- **Auto-Discovery** — Register and discover other Agents through peerclaw-server
2122

2223
## Architecture
@@ -127,6 +128,10 @@ for _, r := range results {
127128
| `agent.RemoveContact(agentID)` | Remove a peer from the whitelist |
128129
| `agent.BlockAgent(agentID)` | Block a peer — all messages and connections are rejected |
129130
| `agent.ListContacts()` | List all trust entries |
131+
| `agent.SendFile(ctx, peerID, path)` | Send a file to a peer via E2E encrypted P2P transfer |
132+
| `agent.ListTransfers()` | List active and recent file transfers |
133+
| `agent.GetTransfer(fileID)` | Get status of a specific file transfer |
134+
| `agent.CancelTransfer(fileID)` | Cancel an in-progress file transfer |
130135
| `agent.OnConnectionRequest(handler)` | Register a callback for connection requests from unknown peers |
131136

132137
### Options
@@ -140,6 +145,8 @@ for _, r := range results {
140145
| `KeypairPath` | Path to the keypair file (if empty, a new keypair is generated each run) |
141146
| `TrustStorePath` | Path to the trust store file |
142147
| `NostrRelays` | List of Nostr relay URLs (e.g., `"wss://relay.damus.io"`) |
148+
| `FileTransferDir` | Directory for received files (defaults to current directory) |
149+
| `ResumeStatePath` | Path to persist file transfer resume state |
143150
| `Logger` | Structured logger |
144151

145152
## Security Model

README_zh.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
66

7-
[PeerClaw](https://github.com/peerclaw/peerclaw) 身份与信任平台及 Agent Marketplace 的 P2P Agent SDK。让 AI Agent 通过 WebRTC DataChannel 直连通信,以 Nostr relay 作为去中心化兜底,内置 TOFU 信任模型与消息签名验证
7+
[PeerClaw](https://github.com/peerclaw/peerclaw) 身份与信任平台的 P2P Agent SDK。让 AI Agent 通过 WebRTC DataChannel 直连通信,以 Nostr relay 作为去中心化兜底,内置 TOFU 信任模型、消息签名验证和端到端加密的 P2P 文件传输
88

99
## 核心特性
1010

@@ -17,6 +17,7 @@
1717
- **消息验证管线** — 集成签名验证、时间戳新鲜度(±2 分钟)、基于 nonce 的重放防护、载荷大小限制
1818
- **P2P 白名单(默认拒绝)** — 基于 TrustStore 的联系人管理:AddContact / RemoveContact / BlockAgent,连接门控在分配 WebRTC 资源之前拒绝未授权 offer
1919
- **连接质量监控** — RTT、丢包率、吞吐统计,连接降级自动通知
20+
- **P2P 文件传输** — 通过专用 WebRTC DataChannel 端到端加密大文件传输,流水线推送、背压控制、Challenge-Response 双向鉴权、断点续传、Nostr relay 兜底
2021
- **自动发现** — 通过 peerclaw-server 注册和发现其他 Agent
2122

2223
## 架构
@@ -127,6 +128,10 @@ for _, r := range results {
127128
| `agent.RemoveContact(agentID)` | 从白名单移除 peer |
128129
| `agent.BlockAgent(agentID)` | 拉黑 peer — 所有消息和连接被拒绝 |
129130
| `agent.ListContacts()` | 列出所有信任条目 |
131+
| `agent.SendFile(ctx, peerID, path)` | 向 peer 发送文件,端到端加密 P2P 传输 |
132+
| `agent.ListTransfers()` | 列出活跃和最近的文件传输 |
133+
| `agent.GetTransfer(fileID)` | 获取特定文件传输状态 |
134+
| `agent.CancelTransfer(fileID)` | 取消进行中的文件传输 |
130135
| `agent.OnConnectionRequest(handler)` | 注册未知 peer 连接请求的回调 |
131136

132137
### Options 配置
@@ -140,6 +145,8 @@ for _, r := range results {
140145
| `KeypairPath` | 密钥文件路径(为空则每次生成新密钥) |
141146
| `TrustStorePath` | 信任存储文件路径 |
142147
| `NostrRelays` | Nostr relay URL 列表(如 `"wss://relay.damus.io"`|
148+
| `FileTransferDir` | 接收文件存放目录(默认当前目录) |
149+
| `ResumeStatePath` | 文件传输断点续传状态持久化路径 |
143150
| `Logger` | 结构化日志器 |
144151

145152
## 安全模型

0 commit comments

Comments
 (0)