lanmojun
lanmojun
发布于 2024-03-24 / 239 阅读 / 0 评论 / 0 点赞

hiveos中使用中转挖qubic

对比了一下hiveos和Ubuntu挖qubic的数据,相同的显卡,相同的超频参数,Ubuntu的算力要低一点,同时功耗还要高,看来hiveos是专门为了挖矿做了优化的。于是决定继续折腾,刷回hiveos。中间还折腾了一下win10,发现B75的主板在Windows下只能识别到6卡,按以往的经验,折腾下去也是没有效果的,果断直接刷hiveos。

但是刷回hiveos必须还得解决一个问题:中转。我用的是广西移动宽带,直连经常丢包,肯定会影响到挖矿效率,必须得走中转。之前研究过几天没找到好的方法。在拆解官方提供的hiveos锄头压缩包( https://github.com/qubic-li/hiveos/releases/download/v1.8.10/qubminer-1.8.10.tar.gz )后,发现h-run.sh脚本中,有执行 ./qli-Client 的命令,那我是不是可以直接使用proxychains4来让它通过中转来运行这个程序?于是我直接在脚本里所有./qli-Client的前面都加上了proxychains4(当然前提是先安装好),文件如下:

# Check ts
if ! command -v ts &> /dev/null; then
    echo "Program ts (moreutils) - not installed. ts is required. Install:"
    # Because HiveOS crashed during the installation of moreutils, I have to install the 'ts' utility from its sources.
    cd /tmp/ && wget https://raw.githubusercontent.com/Worm/moreutils/master/ts && mv ts /usr/local/bin && chmod 777 /usr/local/bin/ts
    #sudo sed -i '/^deb http:\/\/[a-z]*\.*archive\.ubuntu\.com\/ubuntu\ jammy\ [a-zA-Z0-9]*$/d' /etc/apt/sources.list && apt update && apt install moreutils -y
    echo "Program ts (moreutils) - has been installed."
fi

#copy qli-Client to CPU directory and run for CPU, then to GPU directory and run for GPU
cp ./qli-Client ./cpu/
cp ./qli-Client ./gpu/
sleep 4

# Check if both ./cpu/appsettings.json and ./gpu/appsettings.json exist
if [[ -e ./cpu/appsettings.json && -e ./gpu/appsettings.json ]]; then
    # If both files exist, run the program for CPU first, then for GPU
    cd ./gpu/
    proxychains4 ./qli-Client | ts GPU | tee --append $MINER_LOG_BASENAME.log &
    sleep 2
    cd ../cpu/
    proxychains4 ./qli-Client | ts CPU | tee --append $MINER_LOG_BASENAME.log
# Check if only ./cpu/appsettings.json exists
elif [[ -e ./cpu/appsettings.json ]]; then
    # If the file exists only in ./cpu/, run the program for CPU
    cd ./cpu/
    proxychains4 ./qli-Client | ts CPU | tee --append $MINER_LOG_BASENAME.log
# Check if only ./gpu/appsettings.json exists
elif [[ -e ./gpu/appsettings.json ]]; then
    # If the file exists only in ./gpu/, run the program for GPU
    cd ./gpu/
    proxychains4 ./qli-Client | ts GPU | tee --append $MINER_LOG_BASENAME.log
# If neither file exists, display an error message and exit
else
    echo "ERROR: No CPU and GPU config file found, exiting"
    exit 1
fi

然后保存回压缩包,上传到飞行表测试,可以正常走中转运行了~!解决了网络问题,目测确实爆率比之前高了,至少log里没有网络相关的报错了。


评论