mirror of
https://github.com/tig-pool-nk/tig-monorepo.git
synced 2026-02-21 16:27:22 +08:00
Print total solutions.
This commit is contained in:
parent
41b5a5890e
commit
078ea823ac
@ -9,9 +9,18 @@ RESP=$(curl -s "https://mainnet-api.tig.foundation/get-benchmarks?block_id=$BLOC
|
||||
|
||||
BENCHMARKS=$(echo $RESP | jq -c '[.benchmarks[]] | sort_by(.settings.challenge_id, -.details.num_solutions)')
|
||||
|
||||
declare -A SOLUTIONS_COUNT
|
||||
|
||||
for BENCHMARK in $(echo $BENCHMARKS | jq -c '.[]'); do
|
||||
ID=$(echo $BENCHMARK | jq -r '.id')
|
||||
SETTINGS=$(echo $BENCHMARK | jq -c '.settings')
|
||||
CHALLENGE_ID=$(echo $BENCHMARK | jq -r '.settings.challenge_id')
|
||||
NUM_SOLUTIONS=$(echo $BENCHMARK | jq -r '.details.num_solutions')
|
||||
printf "ID: %-38s #Solutions: %-5s Settings: %-50s \n" "$ID" "$NUM_SOLUTIONS" "$SETTINGS"
|
||||
SOLUTIONS_COUNT["$CHALLENGE_ID"]=$(( ${SOLUTIONS_COUNT["$CHALLENGE_ID"]:-0} + NUM_SOLUTIONS ))
|
||||
done
|
||||
|
||||
echo "Total solutions by Challenge ID:"
|
||||
for CHALLENGE_ID in "${!SOLUTIONS_COUNT[@]}"; do
|
||||
echo "Challenge ID: $CHALLENGE_ID, Total Solutions: ${SOLUTIONS_COUNT[$CHALLENGE_ID]}"
|
||||
done
|
||||
Loading…
Reference in New Issue
Block a user