From 9d968518a3774f884b7722eabdfd131e91f679cd Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Mon, 17 Jun 2019 19:38:45 -0700 Subject: [PATCH] Do not fetch sprout params, which saves every new Hush node from needing to download over 1.5GB of stuff it will never use --- zcutil/fetch-params.bat | 16 ++------------ zcutil/fetch-params.sh | 46 ++++++++++++++++++----------------------- 2 files changed, 22 insertions(+), 40 deletions(-) diff --git a/zcutil/fetch-params.bat b/zcutil/fetch-params.bat index 8b14b1845..e2327d7e3 100644 --- a/zcutil/fetch-params.bat +++ b/zcutil/fetch-params.bat @@ -4,26 +4,14 @@ cd %THIS_DIR% IF NOT EXIST %APPDATA%\ZcashParams ( MKDIR %APPDATA%\ZcashParams ) -IF NOT EXIST %APPDATA%\ZcashParams\sprout-proving.key ( - ECHO Downloading Zcash trusted setup sprout-proving.key, this may take a while ... - .\wget64.exe --progress=dot:giga --continue --retry-connrefused --waitretry=3 --timeout=30 https://z.cash/downloads/sprout-proving.key -O %APPDATA%\ZcashParams\sprout-proving.key -) -IF NOT EXIST %APPDATA%\ZcashParams\sprout-verifying.key ( - ECHO Downloading Zcash trusted setup sprout-verifying.key, this may take a while ... - .\wget64.exe --progress=dot:giga --continue --retry-connrefused --waitretry=3 --timeout=30 https://z.cash/downloads/sprout-verifying.key -O %APPDATA%\ZcashParams\sprout-verifying.key -) IF NOT EXIST %APPDATA%\ZcashParams\sapling-spend.params ( - ECHO Downloading Zcash trusted setup sprout-proving.key, this may take a while ... + ECHO Downloading Zcash trusted setup sapling-spend.key, this may take a while ... .\wget64.exe --progress=dot:giga --continue --retry-connrefused --waitretry=3 --timeout=30 https://z.cash/downloads/sapling-spend.params -O %APPDATA%\ZcashParams\sapling-spend.params ) IF NOT EXIST %APPDATA%\ZcashParams\sapling-output.params ( - ECHO Downloading Zcash trusted setup sprout-verifying.key, this may take a while ... + ECHO Downloading Zcash trusted setup sapling-output.key, this may take a while ... .\wget64.exe --progress=dot:giga --continue --retry-connrefused --waitretry=3 --timeout=30 https://z.cash/downloads/sapling-output.params -O %APPDATA%\ZcashParams\sapling-output.params ) -IF NOT EXIST %APPDATA%\ZcashParams\sprout-groth16.params ( - ECHO Downloading Zcash trusted setup sprout-verifying.key, this may take a while ... - .\wget64.exe --progress=dot:giga --continue --retry-connrefused --waitretry=3 --timeout=30 https://z.cash/downloads/sprout-groth16.params -O %APPDATA%\ZcashParams\sprout-groth16.params -) goto :EOF :GET_CURRENT_DIR pushd %~dp0 diff --git a/zcutil/fetch-params.sh b/zcutil/fetch-params.sh index 522de8099..c9ffff278 100755 --- a/zcutil/fetch-params.sh +++ b/zcutil/fetch-params.sh @@ -1,20 +1,20 @@ #!/bin/bash +# Copyright 2019 The Hush developers set -eu +# We do not declare our own location because we can use the params +# from any other installed coins if [[ "$OSTYPE" == "darwin"* ]]; then PARAMS_DIR="$HOME/Library/Application Support/ZcashParams" else PARAMS_DIR="$HOME/.zcash-params" fi -SPROUT_PKEY_NAME='sprout-proving.key' -SPROUT_VKEY_NAME='sprout-verifying.key' SAPLING_SPEND_NAME='sapling-spend.params' SAPLING_OUTPUT_NAME='sapling-output.params' -SAPLING_SPROUT_GROTH16_NAME='sprout-groth16.params' -SPROUT_URL="https://z.cash/downloads" -SPROUT_IPFS="/ipfs/QmZKKx7Xup7LiAtFRhYsE1M7waXcv9ir9eCECyXAFGxhEo" +URL="https://z.cash/downloads" +IPFS="/ipfs/QmZKKx7Xup7LiAtFRhYsE1M7waXcv9ir9eCECyXAFGxhEo" SHA256CMD="$(command -v sha256sum || echo shasum)" SHA256ARGS="$(command -v sha256sum >/dev/null || echo '-a 256')" @@ -38,7 +38,7 @@ function fetch_wget { cat <> "$README_PATH" <