20 lines
586 B
Bash
20 lines
586 B
Bash
#!/bin/bash
|
|
|
|
#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
|
|
total_rewards=0
|
|
files=$(find . -maxdepth 2 -type f -name "*.json")
|
|
for keyfile in $files;
|
|
do
|
|
if [ -f ./rpc_config ]; then
|
|
source ./rpc_config
|
|
fi
|
|
rewards=$(ore --rpc $rpc --keypair $keyfile rewards 2>/dev/null | sed 's/ ORE//')
|
|
total_rewards=$(echo "$total_rewards + $rewards" | bc)
|
|
echo $keyfile $rewards ORE
|
|
done
|
|
printf "Total rewards: %.9f ORE\n" "$total_rewards"
|
|
#echo "Total rewards: $total_rewards ORE"
|