2025-11-26 11:39:20 +08:00
|
|
|
|
package message
|
|
|
|
|
|
|
|
|
|
|
|
type GPU struct {
|
|
|
|
|
|
Brand string `json:"brand"` // 品牌
|
|
|
|
|
|
Model string `json:"model"` // 型号
|
|
|
|
|
|
Mem float64 `json:"mem,omitempty"` // 显存容量(MB)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ServerMsg struct {
|
|
|
|
|
|
ID string `json:"id"` // 身份码.主机码
|
|
|
|
|
|
Method string `json:"method"`
|
|
|
|
|
|
Params any `json:"params"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ServerMsgResp struct {
|
|
|
|
|
|
ID string `json:"id"`
|
2025-12-01 15:45:05 +08:00
|
|
|
|
Method string `json:"method"`
|
2025-11-26 11:39:20 +08:00
|
|
|
|
Result bool `json:"result"`
|
|
|
|
|
|
Data any `json:"data,omitempty"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// server -> client, method:"mining.req"
|
|
|
|
|
|
type ConfigurationMiningMsg struct {
|
|
|
|
|
|
Coin string `json:"coin"` // 币种
|
|
|
|
|
|
Algo string `json:"algo"` // 算法
|
|
|
|
|
|
Pool string `json:"pool"` // 矿池
|
|
|
|
|
|
WalletMining bool `json:"wallet_mining"` // 是否支持钱包挖矿
|
|
|
|
|
|
PoolUrl string `json:"pool_url"` // 挖矿地址
|
|
|
|
|
|
WalletAddress string `json:"wallet_address"` // 收款钱包
|
|
|
|
|
|
PoolUser string `json:"pool_user,omitempty"` // 矿池挖矿账号,仅针对不支持钱包挖矿的矿池,如f2pool、m2pool等,支持钱包挖矿的矿池不需该字段
|
|
|
|
|
|
WorkerID string `json:"worker_id"` // 矿工号
|
|
|
|
|
|
EndTimestamp uint64 `json:"end_timestamp"` // 合约结束时间戳,使用时统一转换成UTC+0时区
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// client -> server, method:"mining.resp"
|
|
|
|
|
|
type ConfigurationMiningResp struct {
|
|
|
|
|
|
Coin string `json:"coin"` // 币种
|
|
|
|
|
|
Algo string `json:"algo"` // 算法
|
|
|
|
|
|
Pool string `json:"pool"` // 矿池
|
|
|
|
|
|
PoolUrl string `json:"pool_url"` // 挖矿地址
|
|
|
|
|
|
WorkerID string `json:"worker_id"` // 矿工号
|
|
|
|
|
|
WalletAddress string `json:"wallet_address"` // 收款钱包
|
|
|
|
|
|
WatchUrl string `json:"watch_url"` // 挖矿信息页面,只有在StartMining字段为true的时候才有,false时该字段为空字符串
|
|
|
|
|
|
}
|