rwadurian/backend/mpc-system/services
hailin 28da7f6807 feat(service-party-app): 实现启动时自动注册到 Message Router,状态验证真实化
## 主要变更

### 1. 启动时自动连接并注册
- main.ts: 添加 `connectAndRegisterToMessageRouter()` 函数
- 应用启动时自动连接到 Message Router 并注册为 temporary 角色
- 自动生成并持久化 partyId(使用 crypto.randomUUID)
- 自动订阅会话事件

### 2. 状态验证真实化
- appStore.ts: 重写 `checkAllServices()` 消息路由检测逻辑
- 不再只检测连接成功,而是:
  1. 调用 isConnected() 检查连接状态
  2. 调用 getPartyId() 检查是否已注册
  3. 调用 getRegisteredParties() 从 Message Router 获取注册列表
  4. 验证自己的 partyId 是否在列表中
- 状态显示更准确:
  - "未连接到 xxx" - 未连接
  - "已连接但未注册" - 已连接但没注册
  - "已注册 (在线)" - 完全正常
  - "注册验证失败" - 注册了但验证失败

### 3. 新增 IPC API
- grpc:getPartyId - 获取当前 partyId
- grpc:isConnected - 检查连接状态
- grpc:connect - 连接到 Message Router
- grpc:register - 注册为参与方

### 修改的文件
- electron/main.ts
- electron/preload.ts
- src/stores/appStore.ts
- src/types/electron.d.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 23:29:04 -08:00
..
account feat(co-managed-wallet): 添加签名会话API和Service-Party-App HTTP客户端 2025-12-28 22:34:35 -08:00
message-router debug: add more logging to message broker for broadcast diagnostics 2025-12-06 09:57:34 -08:00
server-party fix: add wait time before TSS protocol to prevent race condition 2025-12-06 10:04:10 -08:00
server-party-api fix(context): use parent context instead of Background() to allow proper cancellation 2025-12-06 06:36:34 -08:00
service-party-app feat(service-party-app): 实现启动时自动注册到 Message Router,状态验证真实化 2025-12-28 23:29:04 -08:00
session-coordinator fix(co-managed-wallet): 修复向后兼容性问题并完善protobuf定义 2025-12-27 23:33:40 -08:00