all-in-one paramfetch
This commit is contained in:
parent
a2a2169ef8
commit
99c9221082
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,6 +7,7 @@
|
||||
**/*.a
|
||||
**/*.pc
|
||||
build/.*
|
||||
build/paramfetch.sh
|
||||
/vendor
|
||||
|
||||
*-fuzz.zip
|
||||
|
7
Makefile
7
Makefile
@ -56,8 +56,11 @@ bin/ipget:
|
||||
PARAM_SECTOR_SIZES:=1024 16777216 268435456 1073741824
|
||||
PARAM_SECTOR_SIZES:=$(addprefix build/.params-,$(PARAM_SECTOR_SIZES))
|
||||
|
||||
$(PARAM_SECTOR_SIZES): build/proof-params/parameters.json bin/ipget
|
||||
./build/proof-params/paramfetch.sh
|
||||
./build/paramfetch.sh: build/proof-params/parameters.json
|
||||
build/proof-params/mkparamfetch.sh
|
||||
|
||||
$(PARAM_SECTOR_SIZES): ./build/paramfetch.sh build/proof-params/parameters.json bin/ipget
|
||||
./build/paramfetch.sh
|
||||
touch $@
|
||||
|
||||
BUILD_DEPS+=build/.params-1024
|
||||
|
6
build/proof-params/mkparamfetch.sh
Executable file
6
build/proof-params/mkparamfetch.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
sed "s/{{PARAMSJSON}}/$(base64 build/proof-params/parameters.json -w 0)/g" build/proof-params/paramfetch.sh.template > ./build/paramfetch.sh
|
||||
chmod +x ./build/paramfetch.sh
|
@ -2,6 +2,8 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PARAMS='{{PARAMSJSON}}'
|
||||
|
||||
die() {
|
||||
echo "$@" >&2
|
||||
exit 1
|
||||
@ -73,10 +75,9 @@ fetch_gateway() {
|
||||
}
|
||||
|
||||
OUT_DIR="/var/tmp/filecoin-proof-parameters"
|
||||
PARAMS="build/proof-params/parameters.json"
|
||||
|
||||
mkdir -p $OUT_DIR
|
||||
jq '. | to_entries | map("'$OUT_DIR'/\(.key) \(.value.cid) \(.value.digest)") | .[]' --raw-output $PARAMS | \
|
||||
printf $PARAMS | base64 -d | jq '. | to_entries | map("'$OUT_DIR'/\(.key) \(.value.cid) \(.value.digest)") | .[]' --raw-output | \
|
||||
while read -r dest cid digest; do
|
||||
if [[ -f "$dest" ]]; then
|
||||
b2=$(b2sum "$dest" | head -c 32)
|
Loading…
Reference in New Issue
Block a user