feat: 实现RPC节点管理功能

- 后端功能:
  - 添加RPC节点配置管理(增删改查、优先级调整)
  - 实现节点健康检查和自动故障转移
  - 修复Retrofit baseUrl处理问题(使用拦截器动态替换URL)
  - 添加RPC节点可用性验证(创建前验证)
  - 默认节点作为兜底,不返回给前端,始终排在最后
  - API健康检查使用动态获取的可用节点

- 前端功能:
  - 添加RPC节点设置页面
  - 支持添加、删除、检查节点
  - 支持调整节点优先级
  - 完整的多语言支持(中文简体/繁体、英文)
  - 添加菜单项多语言key

- 数据库:
  - 添加RPC节点配置表迁移脚本
This commit is contained in:
WrBug
2025-12-25 23:58:50 +08:00
parent 7bc059ec34
commit 1580b60d24
20 changed files with 1856 additions and 70 deletions
+51
View File
@@ -806,3 +806,54 @@ export interface NotificationConfigUpdateRequest {
}
}
/**
* RPC 节点配置类型
*/
export interface RpcNodeConfig {
id: number
providerType: 'ALCHEMY' | 'INFURA' | 'QUICKNODE' | 'CHAINSTACK' | 'GETBLOCK' | 'CUSTOM' | 'PUBLIC'
name: string
httpUrl: string
wsUrl?: string
apiKeyMasked?: string // 脱敏后的 API Key
enabled: boolean
priority: number
lastCheckTime?: number
lastCheckStatus?: 'HEALTHY' | 'UNHEALTHY' | 'UNKNOWN'
responseTimeMs?: number
createdAt: number
updatedAt: number
}
/**
* 添加 RPC 节点请求
*/
export interface RpcNodeAddRequest {
providerType: string
name: string
apiKey?: string // 主流服务商需要
httpUrl?: string // CUSTOM 需要
wsUrl?: string
}
/**
* 更新 RPC 节点请求
*/
export interface RpcNodeUpdateRequest {
id: number
name?: string
enabled?: boolean
priority?: number
}
/**
* 节点健康检查结果
*/
export interface NodeCheckResult {
status: 'HEALTHY' | 'UNHEALTHY' | 'UNKNOWN'
message: string
checkTime: number
responseTimeMs?: number
blockNumber?: string
}