Update ore.sh
This commit is contained in:
parent
93b9e5a2d1
commit
6f94cae7af
53
ore.sh
53
ore.sh
@ -304,7 +304,6 @@ done
|
||||
|
||||
|
||||
function lonely() {
|
||||
#!/bin/bash
|
||||
|
||||
# 提示用户输入RPC配置地址
|
||||
read -p "请输入RPC配置地址: " rpc_address
|
||||
@ -408,9 +407,57 @@ while true; do
|
||||
echo "成功领取 $start to $end."
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
|
||||
function rerun_rpc() {
|
||||
|
||||
|
||||
# 提示用户输入RPC配置地址
|
||||
read -p "请输入RPC配置地址: " rpc_address
|
||||
|
||||
# 用户输入优先费用
|
||||
read -p "请输入交易的优先费用 (默认设置为 1): " priority_fee
|
||||
priority_fee=${priority_fee:-1}
|
||||
|
||||
# 用户输入线程数
|
||||
read -p "请输入挖矿时要使用的线程数 (默认设置为 4): " threads
|
||||
threads=${threads:-4}
|
||||
|
||||
# 基础会话名
|
||||
session_base_name="ore"
|
||||
|
||||
# 启动命令模板
|
||||
start_command_template="while true; do ore --rpc $rpc_address --keypair {} --priority-fee $priority_fee mine --threads $threads; echo '进程异常退出,等待重启' >&2; sleep 1; done"
|
||||
|
||||
# 自动查找所有的idn.json文件
|
||||
config_files=$(find ~/.config/solana -name "id*.json")
|
||||
for config_file in $config_files
|
||||
do
|
||||
# 使用jq读取文件中的前五个数字,并将它们转换成逗号分隔的字符串
|
||||
key_prefix=$(jq -r '.[0:5] | join(",")' "$config_file")
|
||||
|
||||
# 生成会话名
|
||||
session_name="${session_base_name}_[${key_prefix}]"
|
||||
|
||||
# 替换启动命令中的配置文件路径
|
||||
start_command=$(echo $start_command_template | sed "s|{}|$config_file|g")
|
||||
|
||||
# 打印开始信息
|
||||
echo "开始挖矿,会话名称为 $session_name ..."
|
||||
|
||||
# 使用screen在后台启动挖矿进程
|
||||
screen -dmS "$session_name" bash -c "$start_command"
|
||||
|
||||
# 打印挖矿进程启动信息
|
||||
echo "挖矿进程已在名为 $session_name 的screen会话中后台启动。"
|
||||
echo "使用 'screen -r $session_name' 命令重新连接到此会话。"
|
||||
done
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
# 主菜单
|
||||
function main_menu() {
|
||||
while true; do
|
||||
@ -428,9 +475,10 @@ function main_menu() {
|
||||
echo "5. 单号领取挖矿收益"
|
||||
echo "6. 查看节点运行情况"
|
||||
echo "7. (适合首次安装)单机多开钱包带安装环境,需要自行准备json私钥"
|
||||
echo "8. 单机多开钱包不检查环境,需要自行准备json私钥"
|
||||
echo "8. 单机多开钱包不检查安装环境,需要自行准备json私钥"
|
||||
echo "9. 单机多开钱包,查看奖励"
|
||||
echo "10. 单机多开钱包,领取奖励(自动轮询)"
|
||||
echo "11. 单独更换rpc等配置,并多开自动读取私钥前缀命名监控,请提前安装好jq,不确认安装没,请先执行apt install jq"
|
||||
read -p "请输入选项(1-10): " OPTION
|
||||
|
||||
case $OPTION in
|
||||
@ -444,6 +492,7 @@ function main_menu() {
|
||||
8) lonely ;;
|
||||
9) check_multiple ;;
|
||||
10) cliam_multiple ;;
|
||||
11) rerun_rpc ;;
|
||||
esac
|
||||
echo "按任意键返回主菜单..."
|
||||
read -n 1
|
||||
|
Loading…
Reference in New Issue
Block a user