先行版

This commit is contained in:
lzx
2025-11-26 16:16:17 +08:00
parent 789be70a53
commit a000c18c29
11 changed files with 796 additions and 0 deletions

70
test/draft_script Normal file
View File

@@ -0,0 +1,70 @@
str := "#!/bin/bash\n"
str += "POOL=" + cfg.PoolUrl + "\n"
str += "WALLET=" + cfg.WalletAddress + "." + cfg.WorkerID + "\n"
str += "ALGO=" + cfg.Algo + "\n"
str += "END_TIMESTAMP=" + strconv.FormatUint(cfg.EndTimestamp, 10) + "\n"
str += "\n"
str += "# 在后台启动挖矿程序\n"
str += "./lolMiner --algo $ALGO --pool $POOL --user $WALLET $@ &\n"
str += "MINER_PID=$!\n"
str += "\n"
str += "# 循环检查时间戳,直到超过结束时间\n"
str += "while true; do\n"
str += " CURRENT_TIMESTAMP=$(date +%s)\n"
str += " if [ $CURRENT_TIMESTAMP -ge $END_TIMESTAMP ]; then\n"
str += " echo \"时间戳已超过结束时间,退出挖矿脚本\"\n"
str += " kill $MINER_PID 2>/dev/null\n"
str += " wait $MINER_PID 2>/dev/null\n"
str += " exit 0\n"
str += " fi\n"
str += " sleep 10\n"
str += "done\n"
str := "#!/bin/bash\n"
str += "POOL=" + cfg.PoolUrl + "\n"
str += "WALLET=" + cfg.WalletAddress + "." + cfg.WorkerID + "\n"
str += "ALGO=" + cfg.Algo + "\n"
str += "END_TIMESTAMP=" + strconv.FormatUint(cfg.EndTimestamp, 10) + "\n"
str += "\n"
str += "# 在后台启动挖矿程序\n"
str += "./bzminer -a $ALGO -w $WALLET -p $POOL\n"
str += "MINER_PID=$!\n"
str += "\n"
str += "# 循环检查时间戳,直到超过结束时间\n"
str += "while true; do\n"
str += " CURRENT_TIMESTAMP=$(date +%s)\n"
str += " if [ $CURRENT_TIMESTAMP -ge $END_TIMESTAMP ]; then\n"
str += " echo \"时间戳已超过结束时间,退出挖矿脚本\"\n"
str += " kill $MINER_PID 2>/dev/null\n"
str += " wait $MINER_PID 2>/dev/null\n"
str += " exit 0\n"
str += " fi\n"
str += " sleep 10\n"
str += "done\n"
str := "#!/bin/bash\n"
str += "POOL=" + cfg.PoolUrl + "\n"
str += "WALLET=" + cfg.WalletAddress + "\n"
str += "USER=" + cfg.WorkerID + "\n"
str += "ALGO=" + cfg.Algo + "\n"
str += "END_TIMESTAMP=" + strconv.FormatUint(cfg.EndTimestamp, 10) + "\n"
str += "\n"
str += "# 在后台启动挖矿程序\n"
str += "./rigel -a $ALGO -o $POOL -u $WALLET -w $USER --log-file logs/miner.log\n"
str += "MINER_PID=$!\n"
str += "\n"
str += "# 循环检查时间戳,直到超过结束时间\n"
str += "while true; do\n"
str += " CURRENT_TIMESTAMP=$(date +%s)\n"
str += " if [ $CURRENT_TIMESTAMP -ge $END_TIMESTAMP ]; then\n"
str += " echo \"时间戳已超过结束时间,退出挖矿脚本\"\n"
str += " kill $MINER_PID 2>/dev/null\n"
str += " wait $MINER_PID 2>/dev/null\n"
str += " exit 0\n"
str += " fi\n"
str += " sleep 10\n"
str += "done\n"