Files
mining-client/test/test.go
2025-11-26 16:16:17 +08:00

53 lines
1.1 KiB
Go
Raw Permalink 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 main
// import (
// "log"
// "time"
// message "client/internal/msg"
// "client/internal/src/linux"
// )
// func main() {
// auth := "lzx"
// l := linux.NewLinuxClient(auth)
// go func() {
// gpus, err := l.GetGPUInfo()
// if err != nil {
// log.Fatalf("获取GPU信息失败%v", err)
// return
// }
// log.Println(gpus)
// }()
// now_ts := time.Now().Unix()
// cfg := message.ConfigurationMiningMsg{
// Coin: "NEXA",
// Algo: "NexaPow",
// Pool: "m2pool",
// PoolUrl: "47.108.221.51:3333",
// WalletAddress: "m2test",
// PoolUser: "m2test",
// WorkerID: "go",
// EndTimestamp: uint64(now_ts + 600),
// }
// if err := l.Mining(cfg); err != nil {
// log.Fatalf("配置挖矿失败: %v", err)
// }
// endTime := time.Unix(int64(cfg.EndTimestamp), 0)
// waitDuration := time.Until(endTime)
// if waitDuration < 0 {
// waitDuration = 0
// }
// // 等待挖矿任务自然结束,额外多等 5 秒确保清理完成
// time.Sleep(waitDuration + 5*time.Second)
// }
package main
import client "client/internal"
func main() {
client.Star()
}