92b75d1926
- 创建 PolymarketConstants 常量类,集中管理所有 Polymarket API URL - 更新所有服务类,将配置注入改为使用常量: * ApiHealthCheckService: 移除配置注入,使用常量 * RetrofitFactory: 移除 CLOB 和 Gamma API URL 配置注入 * RelayClientService: 移除 Builder Relayer URL 配置注入 * BlockchainService: 移除 Data API URL 配置注入 * PolymarketApiKeyService: 移除 CLOB API URL 配置注入 * RetrofitConfig: 移除 CLOB API URL 配置注入 * OrderPushService: 移除 RTDS WebSocket URL 配置注入 * PolymarketActivityWsService: 移除 Activity WebSocket URL 配置注入 * CopyTradingWebSocketService: 移除 User WebSocket URL 配置注入 * PolymarketWebSocketHandler: 移除 RTDS WebSocket URL 配置注入 * UnifiedOnChainWsService: 添加连接状态查询方法 - 从 application.properties 移除相关配置项,添加说明注释 - 完善 API 健康检查,添加缺失的检测项: * Polymarket Activity WebSocket * 链上 WebSocket - 更新相关文档说明
85 lines
3.1 KiB
Properties
85 lines
3.1 KiB
Properties
# 应用配置
|
|
spring.application.name=polyhermes-backend
|
|
|
|
# 数据源配置(默认配置,可通过环境变量覆盖)
|
|
spring.datasource.url=${DB_URL:jdbc:mysql://localhost:3306/polyhermes?useSSL=false&serverTimezone=UTC&characterEncoding=utf8&allowPublicKeyRetrieval=true}
|
|
spring.datasource.username=${DB_USERNAME:root}
|
|
spring.datasource.password=${DB_PASSWORD:11111111}
|
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
|
|
|
# HikariCP 连接池配置
|
|
spring.datasource.hikari.maximum-pool-size=10
|
|
spring.datasource.hikari.minimum-idle=2
|
|
spring.datasource.hikari.connection-timeout=30000
|
|
|
|
# JPA 配置
|
|
spring.jpa.hibernate.ddl-auto=validate
|
|
spring.jpa.show-sql=false
|
|
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
|
|
|
|
# Flyway 配置
|
|
spring.flyway.enabled=true
|
|
spring.flyway.locations=classpath:db/migration
|
|
spring.flyway.baseline-on-migrate=true
|
|
|
|
# 服务器配置
|
|
server.port=${SERVER_PORT:8000}
|
|
|
|
# Spring Profile 配置
|
|
# 默认使用 dev 环境,可通过 --spring.profiles.active=prod 切换
|
|
spring.profiles.active=${SPRING_PROFILES_ACTIVE:dev}
|
|
|
|
# 日志配置(支持通过环境变量配置)
|
|
logging.level.root=${LOG_LEVEL_ROOT:WARN}
|
|
logging.level.com.wrbug.polymarketbot=${LOG_LEVEL_APP:INFO}
|
|
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} - %msg%n
|
|
|
|
# Polymarket API 配置
|
|
# 注意:Polymarket API URL 现在使用代码常量(PolymarketConstants),不再从配置文件读取
|
|
# 如需修改,请修改 com.wrbug.polymarketbot.constants.PolymarketConstants 类
|
|
|
|
# Builder Relayer 配置(用于 Gasless 交易)
|
|
# 从 polymarket.com/settings?tab=builder 获取 Builder API 凭证
|
|
# Builder API Key、Secret、Passphrase 现在通过系统设置页面配置,存储在数据库中
|
|
# 如果未配置,将使用手动发送交易的方式(需要用户支付 gas)
|
|
# 注意:Builder Relayer URL 现在使用代码常量(PolymarketConstants.BUILDER_RELAYER_URL),不再从配置文件读取
|
|
|
|
# 跟单轮询配置
|
|
# 轮询间隔(毫秒),默认2秒
|
|
copy.trading.polling.interval=${COPY_TRADING_POLLING_INTERVAL:2000}
|
|
# 是否启用轮询,默认true
|
|
copy.trading.polling.enabled=${COPY_TRADING_POLLING_ENABLED:true}
|
|
|
|
# 跟单监听配置
|
|
# 链上 WebSocket 重连延迟(毫秒),默认3秒
|
|
copy.trading.onchain.ws.reconnect.delay=${COPY_TRADING_ONCHAIN_WS_RECONNECT_DELAY:3000}
|
|
|
|
# WebSocket 配置
|
|
websocket.heartbeat-timeout=${WEBSOCKET_HEARTBEAT_TIMEOUT:60000}
|
|
|
|
# JWT配置
|
|
jwt.secret=${JWT_SECRET:your-secret-key-change-in-production}
|
|
# 7天(毫秒)
|
|
jwt.expiration=604800000
|
|
# 1天(毫秒),超过此时间但未过期时自动刷新
|
|
jwt.refresh-threshold=86400000
|
|
|
|
# 加密配置(用于加密私钥等敏感数据)
|
|
# 如果不设置,默认使用 jwt.secret
|
|
encryption.key=${ENCRYPTION_KEY:${jwt.secret}}
|
|
|
|
# 密码重置配置
|
|
admin.reset-password.key=${ADMIN_RESET_PASSWORD_KEY:change-me-in-production}
|
|
|
|
# 频率限制配置
|
|
# 1分钟内最多3次
|
|
rate-limit.reset-password.max-attempts=3
|
|
# 时间窗口(秒)
|
|
rate-limit.reset-password.window-seconds=60
|
|
|
|
# GitHub 配置(用于公告功能)
|
|
github.repo.owner=WrBug
|
|
github.repo.name=PolyHermes
|
|
github.announcement.issue.number=1
|
|
|