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
+58
View File
@@ -237,6 +237,7 @@
"systemSettings": "System",
"systemOverview": "Overview",
"language": "Language",
"rpcNodes": "RPC Nodes",
"apiHealth": "API Health",
"builderApiKey": "Builder API Key",
"proxy": "Proxy",
@@ -1065,5 +1066,62 @@
"averagePnl": "Average PnL",
"maxPnl": "Max PnL",
"minPnl": "Min PnL"
},
"rpcNodeSettings": {
"title": "Polygon RPC Node Configuration",
"fetchFailed": "Failed to fetch node list",
"checkHealthSuccess": "Health check completed",
"checkHealthFailed": "Health check failed",
"deleteSuccess": "Deleted successfully",
"deleteFailed": "Failed to delete",
"adjustPrioritySuccess": "Priority adjusted successfully",
"adjustPriorityFailed": "Failed to adjust priority",
"priority": "Priority",
"providerType": "Provider",
"name": "Name",
"status": "Status",
"statusHealthy": "Available",
"statusUnhealthy": "Unavailable",
"statusUnknown": "Unknown",
"responseTime": "Response Time",
"actions": "Actions",
"check": "Check",
"checkSuccess": "Check completed",
"checkFailed": "Check failed",
"deleteConfirm": "Are you sure you want to delete this node?",
"deleteConfirmOk": "Confirm",
"deleteConfirmCancel": "Cancel",
"delete": "Delete",
"batchCheck": "Batch Check",
"addNode": "Add Node",
"addNodeTitle": "Add RPC Node",
"validateAndAdd": "Validate and Add",
"providerTypeLabel": "Provider Type",
"providerTypeRequired": "Please select provider type",
"nodeNameLabel": "Node Name",
"nodeNameRequired": "Please enter node name",
"nodeNamePlaceholder": "e.g.: My Alchemy Node",
"apiKeyLabel": "API Key",
"getApiKey": "Get API Key",
"apiKeyRequired": "Please enter API Key",
"apiKeyPlaceholder": "Enter your API Key",
"httpUrlLabel": "HTTP RPC URL",
"httpUrlRequired": "Please enter HTTP RPC URL",
"httpUrlInvalid": "Please enter a valid URL",
"httpUrlPlaceholder": "https://polygon-rpc.com",
"wsUrlLabel": "WebSocket URL (Optional)",
"wsUrlInvalid": "Please enter a valid URL",
"wsUrlPlaceholder": "wss://polygon-rpc.com",
"validateFailed": "Node validation failed:",
"addSuccess": "Added successfully",
"addFailed": "Failed to add",
"validateError": "Validation failed",
"operationFailed": "Operation failed",
"customNode": "Custom Node",
"providerAlchemy": "Alchemy",
"providerInfura": "Infura",
"providerQuickNode": "QuickNode",
"providerChainstack": "Chainstack",
"providerGetBlock": "GetBlock"
}
}
+58
View File
@@ -237,6 +237,7 @@
"systemSettings": "系统管理",
"systemOverview": "概览",
"language": "语言",
"rpcNodes": "RPC节点管理",
"apiHealth": "API健康",
"builderApiKey": "Builder API Key",
"proxy": "代理",
@@ -1065,5 +1066,62 @@
"averagePnl": "平均盈亏",
"maxPnl": "最大盈亏",
"minPnl": "最小盈亏"
},
"rpcNodeSettings": {
"title": "Polygon RPC 节点配置",
"fetchFailed": "获取节点列表失败",
"checkHealthSuccess": "健康检查完成",
"checkHealthFailed": "健康检查失败",
"deleteSuccess": "删除成功",
"deleteFailed": "删除失败",
"adjustPrioritySuccess": "调整成功",
"adjustPriorityFailed": "调整失败",
"priority": "优先级",
"providerType": "服务商",
"name": "名称",
"status": "状态",
"statusHealthy": "可用",
"statusUnhealthy": "不可用",
"statusUnknown": "未知",
"responseTime": "响应时间",
"actions": "操作",
"check": "检查",
"checkSuccess": "检查完成",
"checkFailed": "检查失败",
"deleteConfirm": "确定删除此节点吗?",
"deleteConfirmOk": "确定",
"deleteConfirmCancel": "取消",
"delete": "删除",
"batchCheck": "批量检查",
"addNode": "添加节点",
"addNodeTitle": "添加 RPC 节点",
"validateAndAdd": "验证并添加",
"providerTypeLabel": "服务商类型",
"providerTypeRequired": "请选择服务商类型",
"nodeNameLabel": "节点名称",
"nodeNameRequired": "请输入节点名称",
"nodeNamePlaceholder": "例如: My Alchemy Node",
"apiKeyLabel": "API Key",
"getApiKey": "获取 API Key",
"apiKeyRequired": "请输入 API Key",
"apiKeyPlaceholder": "输入您的 API Key",
"httpUrlLabel": "HTTP RPC URL",
"httpUrlRequired": "请输入 HTTP RPC URL",
"httpUrlInvalid": "请输入有效的 URL",
"httpUrlPlaceholder": "https://polygon-rpc.com",
"wsUrlLabel": "WebSocket URL (可选)",
"wsUrlInvalid": "请输入有效的 URL",
"wsUrlPlaceholder": "wss://polygon-rpc.com",
"validateFailed": "节点验证失败:",
"addSuccess": "添加成功",
"addFailed": "添加失败",
"validateError": "验证失败",
"operationFailed": "操作失败",
"customNode": "自定义节点",
"providerAlchemy": "Alchemy",
"providerInfura": "Infura",
"providerQuickNode": "QuickNode",
"providerChainstack": "Chainstack",
"providerGetBlock": "GetBlock"
}
}
+58
View File
@@ -237,6 +237,7 @@
"systemSettings": "系統管理",
"systemOverview": "概覽",
"language": "語言",
"rpcNodes": "RPC節點管理",
"apiHealth": "API健康",
"builderApiKey": "Builder API Key",
"proxy": "代理",
@@ -1065,5 +1066,62 @@
"averagePnl": "平均盈虧",
"maxPnl": "最大盈虧",
"minPnl": "最小盈虧"
},
"rpcNodeSettings": {
"title": "Polygon RPC 節點配置",
"fetchFailed": "獲取節點列表失敗",
"checkHealthSuccess": "健康檢查完成",
"checkHealthFailed": "健康檢查失敗",
"deleteSuccess": "刪除成功",
"deleteFailed": "刪除失敗",
"adjustPrioritySuccess": "調整成功",
"adjustPriorityFailed": "調整失敗",
"priority": "優先級",
"providerType": "服務商",
"name": "名稱",
"status": "狀態",
"statusHealthy": "可用",
"statusUnhealthy": "不可用",
"statusUnknown": "未知",
"responseTime": "響應時間",
"actions": "操作",
"check": "檢查",
"checkSuccess": "檢查完成",
"checkFailed": "檢查失敗",
"deleteConfirm": "確定刪除此節點嗎?",
"deleteConfirmOk": "確定",
"deleteConfirmCancel": "取消",
"delete": "刪除",
"batchCheck": "批量檢查",
"addNode": "添加節點",
"addNodeTitle": "添加 RPC 節點",
"validateAndAdd": "驗證並添加",
"providerTypeLabel": "服務商類型",
"providerTypeRequired": "請選擇服務商類型",
"nodeNameLabel": "節點名稱",
"nodeNameRequired": "請輸入節點名稱",
"nodeNamePlaceholder": "例如: My Alchemy Node",
"apiKeyLabel": "API Key",
"getApiKey": "獲取 API Key",
"apiKeyRequired": "請輸入 API Key",
"apiKeyPlaceholder": "輸入您的 API Key",
"httpUrlLabel": "HTTP RPC URL",
"httpUrlRequired": "請輸入 HTTP RPC URL",
"httpUrlInvalid": "請輸入有效的 URL",
"httpUrlPlaceholder": "https://polygon-rpc.com",
"wsUrlLabel": "WebSocket URL (可選)",
"wsUrlInvalid": "請輸入有效的 URL",
"wsUrlPlaceholder": "wss://polygon-rpc.com",
"validateFailed": "節點驗證失敗:",
"addSuccess": "添加成功",
"addFailed": "添加失敗",
"validateError": "驗證失敗",
"operationFailed": "操作失敗",
"customNode": "自定義節點",
"providerAlchemy": "Alchemy",
"providerInfura": "Infura",
"providerQuickNode": "QuickNode",
"providerChainstack": "Chainstack",
"providerGetBlock": "GetBlock"
}
}