mempool: init at 2.5.0

This commit is contained in:
Erik Arvstedt 2023-08-06 21:07:44 +02:00
parent 8cdedac046
commit f0bf94cc5a
No known key found for this signature in database
GPG key ID: 33312B944DD97846
9 changed files with 435 additions and 0 deletions

View file

@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
# Fetch hash-locked versions of assets that are dynamically fetched via
# https://github.com/mempool/mempool/blob/master/frontend/sync-assets.js
# when running `npm run build` in the frontend.
#
# This file is updated by ./frontend-assets-update.sh
declare -A revs=(
["mempool/mining-pools"]=e889230b0924d7d72eb28186db6f96ef94361fa5
["mempool/mining-pool-logos"]=9cb443035878c3f112af97384d624de245afe72d
)
fetchFile() {
repo=$1
file=$2
rev=${revs["$repo"]}
curl -fsS "https://raw.githubusercontent.com/$repo/$rev/$file"
}
fetchRepo() {
repo=$1
rev=${revs["$repo"]}
curl -fsSL "https://github.com/$repo/archive/$rev.tar.gz"
}
# shellcheck disable=SC2094
fetchFile "mempool/mining-pools" pools.json > pools.json
mkdir mining-pools
fetchRepo "mempool/mining-pool-logos" | tar xz --strip-components=1 -C mining-pools