From 2c73d25f8fa080344ee34380ae8c965a45676e82 Mon Sep 17 00:00:00 2001 From: Liquid Date: Tue, 27 Jun 2023 07:47:41 -0500 Subject: [PATCH] Delete fetch-params.sh --- src/init.cpp | 16 +-- util/fetch-params.sh | 232 ------------------------------------------- 2 files changed, 10 insertions(+), 238 deletions(-) delete mode 100755 util/fetch-params.sh diff --git a/src/init.cpp b/src/init.cpp index cbe3a90a403e0..56e8c91d0f4b6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -741,12 +741,16 @@ static void LoadSaplingParams() try { initZKSNARKS(); } catch (std::runtime_error &e) { - uiInterface.ThreadSafeMessageBox(strprintf( - _("Cannot find the Sapling parameters in the following directory:\n" - "%s\n" - "Please run 'sapling-fetch-params' or './util/fetch-params.sh' and then restart."), - ZC_GetParamsDir()), - "", CClientUIInterface::MSG_ERROR); + std::string strError = strprintf(_("Cannot find the Sapling parameters in the following directory:\n%s"), ZC_GetParamsDir()); + std::string strErrorPosix = strprintf(_("Please run the included %s script and then restart."), "install-params.sh"); + std::string strErrorWin = strprintf(_("Please copy the included params files to the %s directory."), ZC_GetParamsDir()); + uiInterface.ThreadSafeMessageBox(strError + "\n" +#ifndef WIN32 + + strErrorPosix, +#else + + strErrorWin, +#endif + "", CClientUIInterface::MSG_ERROR); StartShutdown(); return; } diff --git a/util/fetch-params.sh b/util/fetch-params.sh deleted file mode 100755 index 8ed06196c355b..0000000000000 --- a/util/fetch-params.sh +++ /dev/null @@ -1,232 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2015-2020 The Zcash developers -# Copyright (c) 2020-2021 The PIVX Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C.UTF-8 - -set -eu - -if [ -n "${1:-}" ]; then - PARAMS_DIR="$1" -else - if [[ "$OSTYPE" == "darwin"* ]]; then - PARAMS_DIR="$HOME/Library/Application Support/PIVXParams" - else - PARAMS_DIR="$HOME/.pivx-params" - fi -fi - -SAPLING_SPEND_NAME='sapling-spend.params' -SAPLING_OUTPUT_NAME='sapling-output.params' -DOWNLOAD_URL="https://download.z.cash/downloads" -IPFS_HASH="/ipfs/QmXRHVGLQBiKwvNq7c2vPxAKz1zRVmMYbmt7G5TQss7tY7" - -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" ] || [ -n "$ZC_DISABLE_WGET" ]; then - return 1 - fi - - local filename="$1" - local dlname="$2" - - cat <&2 < "${dlname}" - rm "${dlname}.part.1" "${dlname}.part.2" - - "$SHA256CMD" "$SHA256ARGS" -c <&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" <