Files
mining-client/internal/msg/msg.go
2025-12-01 15:45:05 +08:00

45 lines
1.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"`
Method string `json:"method"`
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时该字段为空字符串
}