mempool/production/nginx-cache-warmer
2022-03-30 19:52:06 +09:00

54 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env zsh
hostname=$(hostname)
slugs=(`curl -sSL https://raw.githubusercontent.com/mempool/mining-pools/master/pools.json | jq -r '.slugs[]'`)
while true
do for url in / \
'/api/v1/statistics/2h' \
'/api/v1/statistics/24h' \
'/api/v1/statistics/1w' \
'/api/v1/statistics/1m' \
'/api/v1/statistics/3m' \
'/api/v1/statistics/6m' \
'/api/v1/statistics/1y' \
'/api/v1/statistics/2y' \
'/api/v1/statistics/3y' \
'/api/v1/mining/pools/24h' \
'/api/v1/mining/pools/3d' \
'/api/v1/mining/pools/1w' \
'/api/v1/mining/pools/1m' \
'/api/v1/mining/pools/3m' \
'/api/v1/mining/pools/6m' \
'/api/v1/mining/pools/1y' \
'/api/v1/mining/pools/2y' \
'/api/v1/mining/pools/3y' \
'/api/v1/mining/pools/all' \
'/api/v1/mining/hashrate/3m' \
'/api/v1/mining/hashrate/6m' \
'/api/v1/mining/hashrate/1y' \
'/api/v1/mining/hashrate/2y' \
'/api/v1/mining/hashrate/3y' \
'/api/v1/mining/hashrate/all' \
'/api/v1/mining/hashrate/pools/3m' \
'/api/v1/mining/hashrate/pools/6m' \
'/api/v1/mining/hashrate/pools/1y' \
'/api/v1/mining/hashrate/pools/2y' \
'/api/v1/mining/hashrate/pools/3y' \
'/api/v1/mining/hashrate/pools/all' \
'/api/v1/mining/reward-stats/144' \
'/api/v1/mining/blocks-extras' \
do
curl -s "https://${hostname}${url}" >/dev/null
done
for slug in $slugs
do
curl -s "https://${hostname}/api/v1/mining/pool/${slug}" >/dev/null
curl -s "https://${hostname}/api/v1/mining/pool/${slug}/hashrate" >/dev/null
curl -s "https://${hostname}/api/v1/mining/pool/${slug}/blocks" >/dev/null
done
sleep 10
done