Update ore.sh
This commit is contained in:
parent
e41d15f8dd
commit
76684f5f43
26
ore.sh
26
ore.sh
@ -141,6 +141,30 @@ function check_and_install_dependencies() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function start() {
|
||||||
|
# 获取用户输入的 RPC 地址或使用默认地址
|
||||||
|
read -p "请输入自定义的 RPC 地址,建议使用免费的Quicknode 或者alchemy SOL rpc(默认设置使用 https://api.mainnet-beta.solana.com): " custom_rpc
|
||||||
|
RPC_URL=${custom_rpc:-https://api.mainnet-beta.solana.com}
|
||||||
|
|
||||||
|
# 获取用户输入的线程数或使用默认值
|
||||||
|
read -p "请输入挖矿时要使用的线程数 (默认设置 4): " custom_threads
|
||||||
|
THREADS=${custom_threads:-4}
|
||||||
|
|
||||||
|
# 获取用户输入的优先费用或使用默认值
|
||||||
|
read -p "请输入交易的优先费用 (默认设置 1): " custom_priority_fee
|
||||||
|
PRIORITY_FEE=${custom_priority_fee:-1}
|
||||||
|
|
||||||
|
# 使用 screen 和 Ore CLI 开始挖矿
|
||||||
|
session_name="ore"
|
||||||
|
echo "开始挖矿,会话名称为 $session_name ..."
|
||||||
|
|
||||||
|
start="while true; do ore --rpc $RPC_URL --keypair ~/.config/solana/id.json --priority-fee $PRIORITY_FEE mine --threads $THREADS; echo '进程异常退出,等待重启' >&2; sleep 1; done"
|
||||||
|
screen -dmS "$session_name" bash -c "$start"
|
||||||
|
|
||||||
|
echo "挖矿进程已在名为 $session_name 的 screen 会话中后台启动。"
|
||||||
|
echo "使用 'screen -r $session_name' 命令重新连接到此会话。"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
# 主菜单
|
# 主菜单
|
||||||
function main_menu() {
|
function main_menu() {
|
||||||
@ -154,11 +178,13 @@ function main_menu() {
|
|||||||
echo "请选择要执行的操作:"
|
echo "请选择要执行的操作:"
|
||||||
echo "1. 安装新节点"
|
echo "1. 安装新节点"
|
||||||
echo "2. 导入钱包运行"
|
echo "2. 导入钱包运行"
|
||||||
|
echo "3. 单独启动运行"
|
||||||
read -p "请输入选项(1-2): " OPTION
|
read -p "请输入选项(1-2): " OPTION
|
||||||
|
|
||||||
case $OPTION in
|
case $OPTION in
|
||||||
1) install_node ;;
|
1) install_node ;;
|
||||||
2) export_wallet ;;
|
2) export_wallet ;;
|
||||||
|
3) start ;;
|
||||||
esac
|
esac
|
||||||
echo "按任意键返回主菜单..."
|
echo "按任意键返回主菜单..."
|
||||||
read -n 1
|
read -n 1
|
||||||
|
Loading…
Reference in New Issue
Block a user