b1.0
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2026 S.A. (SNOWARE). Written for SCU Team.
|
||||
// Licensed under MulanPubL-2.0.
|
||||
// You may obtain a copy at: http://license.coscl.org.cn/MulanPubL-2.0
|
||||
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND.
|
||||
|
||||
// EasyTier 模块:定义 Miner 结构体及其命令行构建方法。
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Miner 代表 EasyTier 连接矿工,作为命令行构建的命名空间(零内存占用空结构体)。
|
||||
type Miner struct{}
|
||||
|
||||
// BuildTaskCommand 根据目标节点、网络名、访问令牌构建 easytier-core.exe 的完整命令行字符串。
|
||||
//
|
||||
// 参数:
|
||||
// - wholenode: 完整节点 URI,如 tcp://host:port
|
||||
// - netname: 网络名称
|
||||
// - accesstoken: 网络密钥
|
||||
//
|
||||
// 示例:./easytier-core.exe --network-name mynet --network-secret key --peers tcp://host:11010 -d
|
||||
func (*Miner) BuildTaskCommand(wholenode string, netname string, accesstoken string) string {
|
||||
cmd := fmt.Sprintf(
|
||||
"./easytier-core.exe --network-name %s --network-secret %s --peers %s -d",
|
||||
netname, accesstoken, wholenode,
|
||||
)
|
||||
log.Info().
|
||||
Str("node", wholenode).
|
||||
Str("network", netname).
|
||||
Msg("构建 EasyTier 连接命令")
|
||||
log.Debug().Str("command", cmd).Msg("EasyTier 完整命令")
|
||||
return cmd
|
||||
}
|
||||
Reference in New Issue
Block a user