NAC_Blockchain/docs_center/nac-admin/modules/06-protocol-registry.md

56 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 模块06协议族注册表 - 运维日志
**模块路径**`/protocol-registry`
**前端文件**`client/src/pages/ProtocolRegistry.tsx`
**后端路由**`server/routers.ts` → `protocol.*`
**数据源**MongoDBnac_knowledge_engine.protocols
---
## 功能说明
协议族注册表管理 NAC 公链的核心协议,包括 ACC-20、CBPP、CSNP、GNACS、CNNL 等原生协议的版本注册和状态管理。
## 预置协议4个活跃
| 协议 | 版本 | 说明 | 状态 |
|------|------|------|------|
| ACC-20 | v2.0 | 资产合规协议 | active |
| CBPP | v1.5 | 宪政区块生产协议 | active |
| CSNP | v1.2 | 合规安全网络协议 | active |
| GNACS | v1.0 | 全球资产分类系统 | active |
| CNNL | v0.9 | 宪政神经网络语言 | inactive |
## 数据模型
```typescript
interface Protocol {
_id: ObjectId;
protocol_id: string; // 协议标识,如 "ACC-20"
name: string; // 协议全名
version: string; // 当前版本
description: string; // 协议说明
trigger_conditions: string[]; // 触发条件
status: "active" | "inactive" | "deprecated";
registered_at: Date;
updated_at: Date;
}
```
## API 端点
| 端点 | 方法 | 说明 |
|------|------|------|
| `protocol.list` | Query | 获取协议列表 |
| `protocol.register` | Mutation | 注册新协议 |
| `protocol.toggle` | Mutation | 切换协议状态 |
| `protocol.updateVersion` | Mutation | 更新协议版本 |
## 运维操作
```bash
# 查看协议状态
mongosh "mongodb://root:idP0ZaRGyLsTUA3a@localhost:27017/nac_knowledge_engine?authSource=admin" \
--eval "db.protocols.find({}, {protocol_id:1, version:1, status:1}).pretty()"
```