rpc array
This commit is contained in:
23
claim.sh
23
claim.sh
@@ -12,15 +12,24 @@ monitor_value=${1:-0.1}
|
||||
#export http_proxy="http://10.3.255.132:51837"
|
||||
#export https_proxy="http://10.3.255.132:51837"
|
||||
|
||||
#rpc=https://api.mainnet-beta.solana.com
|
||||
rpc=https://solana-mainnet.core.chainstack.com/b366b2ab269b22f4b6dd521c59079618
|
||||
#rpc=https://mainnet.helius-rpc.com/?api-key=fa8414c7-043e-4888-922a-344a2d413ec8
|
||||
#rpc=https://prettiest-multi-scion.solana-mainnet.quiknode.pro/879eb32f3cd556cfff80973ff6a51b9e8b7a81ec/
|
||||
#rpc=https://silent-tiniest-diamond.solana-mainnet.quiknode.pro/fcef276a3d99aa044e9d7d7193aced24563de630/
|
||||
# 定义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://api.mainnet-beta.solana.com"
|
||||
)
|
||||
|
||||
echo $rpc
|
||||
toaddress="DefJYX8sJmaLBQGyvWPS3rRgVbJRf9kvKEJ19uJpJQEf"
|
||||
|
||||
echo "toaddress=" $toaddress
|
||||
files=$(find . -maxdepth 2 -type f -name "*.json")
|
||||
for keyfile in $files; do
|
||||
# 随机选择一个RPC URL
|
||||
index=$((RANDOM % ${#rpcurls[@]}))
|
||||
rpc=${rpcurls[$index]}
|
||||
echo "选中rpc=$rpc"
|
||||
|
||||
echo $keyfile
|
||||
rewards=$(ore --rpc $rpc --keypair "$keyfile" rewards | sed 's/ ORE//')
|
||||
if [ -z "$rewards" ]; then
|
||||
@@ -34,7 +43,7 @@ for keyfile in $files; do
|
||||
echo "claim reward $keyfile"
|
||||
echo "================================================"
|
||||
echo "Rewards ($rewards) is greater than monitor value ($monitor_value). Claiming rewards..."
|
||||
./ore --rpc $rpc --keypair $keyfile --priority-fee 10000 claim
|
||||
./ore --rpc $rpc --keypair $keyfile --priority-fee 10000 claim $rewards $toaddress
|
||||
else
|
||||
echo "Rewards ($rewards) is less than or equal to monitor value ($monitor_value). No action needed."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user