From f5699b0608ad0240f6bc99ec8f108c3a4b99c43c Mon Sep 17 00:00:00 2001 From: gcharang Date: Sun, 13 Jun 2021 13:02:03 +0530 Subject: [PATCH 1/5] adds fetch-params script that still uses zcash url --- zcutil/fetch-params-zcash.sh | 210 +++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 zcutil/fetch-params-zcash.sh diff --git a/zcutil/fetch-params-zcash.sh b/zcutil/fetch-params-zcash.sh new file mode 100644 index 00000000000..bd298a5d255 --- /dev/null +++ b/zcutil/fetch-params-zcash.sh @@ -0,0 +1,210 @@ +#!/bin/bash + +set -eu + +if [[ "$OSTYPE" == "darwin"* ]]; then + PARAMS_DIR="$HOME/Library/Application Support/ZcashParams" +else + PARAMS_DIR="$HOME/.zcash-params" +fi + +SPROUT_PKEY_REALNAME='sprout-proving.key.deprecated-sworn-elves' +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" + +SHA256CMD="$(command -v sha256sum || echo shasum)" +SHA256ARGS="$(command -v sha256sum >/dev/null || echo '-a 256')" + +WGETCMD="$(command -v wget || echo '')" +IPFSCMD="$(command -v ipfs || echo '')" +CURLCMD="$(command -v curl || echo '')" + +# fetch methods can be disabled with ZC_DISABLE_SOMETHING=1 +ZC_DISABLE_WGET="${ZC_DISABLE_WGET:-}" +ZC_DISABLE_IPFS="${ZC_DISABLE_IPFS:-}" +ZC_DISABLE_CURL="${ZC_DISABLE_CURL:-}" + +function fetch_wget { + if [ -z "$WGETCMD" ] || ! [ -z "$ZC_DISABLE_WGET" ]; then + return 1 + fi + + local filename="$1" + local dlname="$2" + + cat <&2 <&2 + exit 1 + fi + fi +} + +# Use flock to prevent parallel execution. +function lock() { + local lockfile=/tmp/fetch_params.lock + if [[ "$OSTYPE" == "darwin"* ]]; then + if shlock -f ${lockfile} -p $$; then + return 0 + else + return 1 + fi + else + # create lock file + eval "exec 200>$lockfile" + # acquire the lock + flock -n 200 \ + && return 0 \ + || return 1 + fi +} + +function exit_locked_error { + echo "Only one instance of fetch-params.sh can be run at a time." >&2 + exit 1 +} + +function main() { + + lock fetch-params.sh \ + || exit_locked_error + + cat <> "$README_PATH" < Date: Sun, 13 Jun 2021 13:16:39 +0530 Subject: [PATCH 2/5] makes fetch-params-zcash script executable --- zcutil/fetch-params-zcash.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 zcutil/fetch-params-zcash.sh diff --git a/zcutil/fetch-params-zcash.sh b/zcutil/fetch-params-zcash.sh old mode 100644 new mode 100755 From 52bed7905cdf6d374f130b57ad442053d57b3c47 Mon Sep 17 00:00:00 2001 From: gcharang Date: Sun, 13 Jun 2021 14:39:23 +0530 Subject: [PATCH 3/5] updates windows fetchparam urls --- zcutil/VerusCoin.xml | 2 +- zcutil/fetch-params.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zcutil/VerusCoin.xml b/zcutil/VerusCoin.xml index 610533787a0..01cd64accef 100644 --- a/zcutil/VerusCoin.xml +++ b/zcutil/VerusCoin.xml @@ -252,7 +252,7 @@ ${windows_folder_appdata}/ZcashParams/sprout-proving.key Zcash Params file: sprout-proving.key 0 - https://komodoplatform.com/downloads/sprout-proving.key + https://z.cash/downloads/sprout-proving.key.deprecated-sworn-elves diff --git a/zcutil/fetch-params.bat b/zcutil/fetch-params.bat index 46124d95230..519ef1c3b3a 100644 --- a/zcutil/fetch-params.bat +++ b/zcutil/fetch-params.bat @@ -6,7 +6,7 @@ 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://komodoplatform.com/downloads/sprout-proving.key -O "%APPDATA%"\ZcashParams\sprout-proving.key + .\wget64.exe --progress=dot:giga --continue --retry-connrefused --waitretry=3 --timeout=30 https://z.cash/downloads/sprout-proving.key.deprecated-sworn-elves -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 ... From a77a8b90bf46fc3ad9ca4739c40cb47a2c3c4dce Mon Sep 17 00:00:00 2001 From: gcharang Date: Sun, 13 Jun 2021 15:35:45 +0530 Subject: [PATCH 4/5] updates fetch params scripts to use zcash urls for now --- zcutil/VerusCoin.xml | 2 +- zcutil/fetch-params-zcash.sh | 210 ----------------------------------- zcutil/fetch-params.bat | 8 +- zcutil/fetch-params.sh | 5 +- 4 files changed, 8 insertions(+), 217 deletions(-) delete mode 100755 zcutil/fetch-params-zcash.sh diff --git a/zcutil/VerusCoin.xml b/zcutil/VerusCoin.xml index 01cd64accef..7e4b39d9468 100644 --- a/zcutil/VerusCoin.xml +++ b/zcutil/VerusCoin.xml @@ -274,7 +274,7 @@ ${windows_folder_appdata}/ZcashParams/sprout-verifying.key Zcash Params file: sprout-verifying.key 0 - https://komodoplatform.com/downloads/sprout-verifying.key + https://z.cash/downloads/sprout-verifying.key diff --git a/zcutil/fetch-params-zcash.sh b/zcutil/fetch-params-zcash.sh deleted file mode 100755 index bd298a5d255..00000000000 --- a/zcutil/fetch-params-zcash.sh +++ /dev/null @@ -1,210 +0,0 @@ -#!/bin/bash - -set -eu - -if [[ "$OSTYPE" == "darwin"* ]]; then - PARAMS_DIR="$HOME/Library/Application Support/ZcashParams" -else - PARAMS_DIR="$HOME/.zcash-params" -fi - -SPROUT_PKEY_REALNAME='sprout-proving.key.deprecated-sworn-elves' -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" - -SHA256CMD="$(command -v sha256sum || echo shasum)" -SHA256ARGS="$(command -v sha256sum >/dev/null || echo '-a 256')" - -WGETCMD="$(command -v wget || echo '')" -IPFSCMD="$(command -v ipfs || echo '')" -CURLCMD="$(command -v curl || echo '')" - -# fetch methods can be disabled with ZC_DISABLE_SOMETHING=1 -ZC_DISABLE_WGET="${ZC_DISABLE_WGET:-}" -ZC_DISABLE_IPFS="${ZC_DISABLE_IPFS:-}" -ZC_DISABLE_CURL="${ZC_DISABLE_CURL:-}" - -function fetch_wget { - if [ -z "$WGETCMD" ] || ! [ -z "$ZC_DISABLE_WGET" ]; then - return 1 - fi - - local filename="$1" - local dlname="$2" - - cat <&2 <&2 - exit 1 - fi - fi -} - -# Use flock to prevent parallel execution. -function lock() { - local lockfile=/tmp/fetch_params.lock - if [[ "$OSTYPE" == "darwin"* ]]; then - if shlock -f ${lockfile} -p $$; then - return 0 - else - return 1 - fi - else - # create lock file - eval "exec 200>$lockfile" - # acquire the lock - flock -n 200 \ - && return 0 \ - || return 1 - fi -} - -function exit_locked_error { - echo "Only one instance of fetch-params.sh can be run at a time." >&2 - exit 1 -} - -function main() { - - lock fetch-params.sh \ - || exit_locked_error - - cat <> "$README_PATH" < Date: Sun, 13 Jun 2021 15:56:31 +0530 Subject: [PATCH 5/5] adds alt windows fetchparam script --- zcutil/fetch-params-alt.bat | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 zcutil/fetch-params-alt.bat diff --git a/zcutil/fetch-params-alt.bat b/zcutil/fetch-params-alt.bat new file mode 100644 index 00000000000..46124d95230 --- /dev/null +++ b/zcutil/fetch-params-alt.bat @@ -0,0 +1,32 @@ +@echo off +call :GET_CURRENT_DIR +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://komodoplatform.com/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://komodoplatform.com/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 ... + .\wget64.exe --progress=dot:giga --continue --retry-connrefused --waitretry=3 --timeout=30 https://komodoplatform.com/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 ... + .\wget64.exe --progress=dot:giga --continue --retry-connrefused --waitretry=3 --timeout=30 https://komodoplatform.com/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://komodoplatform.com/downloads/sprout-groth16.params -O "%APPDATA%"\ZcashParams\sprout-groth16.params +) +goto :EOF +:GET_CURRENT_DIR +pushd %~dp0 +set THIS_DIR=%CD% +popd +goto :EOF