Files
mint_ore/run.sh
2024-04-08 15:53:30 +08:00

44 lines
1.8 KiB
Bash

#!/bin/bash
# 定义RPC URL数组
rpcurls=(
"https://solana-mainnet.core.chainstack.com/b366b2ab269b22f4b6dd521c59079618"
"https://prettiest-multi-scion.solana-mainnet.quiknode.pro/879eb32f3cd556cfff80973ff6a51b9e8b7a81ec/"
"https://silent-tiniest-diamond.solana-mainnet.quiknode.pro/fcef276a3d99aa044e9d7d7193aced24563de630/"
"https://few-billowing-liquid.solana-mainnet.quiknode.pro/85c2480a4641a74c262b93f9a2e4385f9fdd4ab3/"
"https://withered-still-borough.solana-mainnet.quiknode.pro/6568815b3dbf509bb2689d6fba5dd973a7c8cada/"
#"https://mainnet.helius-rpc.com/?api-key=fa8414c7-043e-4888-922a-344a2d413ec8"
#"https://solana-mainnet.core.chainstack.com/b366b2ab269b22f4b6dd521c59079618"
#"https://linguistic-dulcea-fast-mainnet.helius-rpc.com"
#"https://cold-hanni-fast-mainnet.helius-rpc.com"
#"https://api.mainnet-beta.solana.com"
)
rpcurls_str=$(IFS=, ; echo "${rpcurls[*]}")
export RPCURLS_STR=$rpcurls_str
files=$(find key -maxdepth 2 -type f -name "*.json")
for keypair in $files;
do
# 随机选择一个RPC URL
#index=$((RANDOM % ${#rpcurls[@]}))
#rpc=${rpcurls[$index]}
#echo "选中rpc=$rpc"
echo $keypair
keypair_basename=$(basename "$keypair")
screen -dmS mining_$keypair_basename bash -c "
while true; do
rpcurls=(\${RPCURLS_STR//,/ })
index=\$((RANDOM % \${#rpcurls[@]}))
rpc=\${rpcurls[\$index]}
echo \"Starting indefinite ore mining iteration with $keypair and rpc \$rpc ....\"
nice -n 2 ./ore --rpc \$rpc --keypair $keypair --priority-fee 100 mine --threads 2
#ore --rpc \$rpc --keypair $keypair --priority-fee 1000000 mine --threads 16 &
#sleep 5
#ore --rpc \$rpc --keypair $keypair --priority-fee 1000000 mine --threads 16 &
#wait
done
"
# exit
done