From 40a17232b24ae91dd3f2251265341e2e52c78925 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 26 Nov 2024 15:12:54 +0200 Subject: [PATCH 1/2] removed duplicated file --- fetch-params.sh | 247 ------------------------------------------------ 1 file changed, 247 deletions(-) delete mode 100755 fetch-params.sh diff --git a/fetch-params.sh b/fetch-params.sh deleted file mode 100755 index f5d6fa3..0000000 --- a/fetch-params.sh +++ /dev/null @@ -1,247 +0,0 @@ -#!/usr/bin/env bash - -export LC_ALL=C -set -eu - -SCRIPT_NAME=$(basename $0) - -[[ -v XDG_CACHE_HOME ]] || XDG_CACHE_HOME="${HOME}/.cache" -# We don’t care too much about most of the properties of `XDG_RUNTIME_DIR` in -# this script, so we just fall back to `XDG_CACHE_HOME`. -[[ -v XDG_RUNTIME_DIR ]] || XDG_RUNTIME_DIR="${XDG_CACHE_HOME}" - -uname_S=$(uname -s 2>/dev/null || echo not) - -if [ "$uname_S" = "Darwin" ]; then - PARAMS_DIR="$HOME/Library/Application Support/ZcashParams" -else - PARAMS_DIR="$HOME/.zcash-params" -fi - -# Commented out because these are unused; see below. -#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' -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:-}" - -LOCK_DIR="${XDG_RUNTIME_DIR}/zcash" -mkdir -p "${LOCK_DIR}" -LOCKFILE="${LOCK_DIR}/fetch-params.lock" - -fetch_wget() { - if [ -z "$WGETCMD" ] || [ -n "$ZC_DISABLE_WGET" ]; then - return 1 - fi - - cat <&2 < "${dlname}" - rm "${dlname}.part.1" "${dlname}.part.2" - - "$SHA256CMD" $SHA256ARGS -c <&2 - exit 1 - fi - fi - - unset -v filename - unset -v output - unset -v dlname - unset -v expectedhash -} - -# Use flock to prevent parallel execution. -lock() { - if [ "$uname_S" = "Darwin" ]; then - if shlock -f ${LOCKFILE} -p $$; then - return 0 - else - return 1 - fi - else - # create lock file - eval "exec 9>$LOCKFILE" - # acquire the lock - flock -n 9 \ - && return 0 \ - || return 1 - fi -} - -exit_locked_error() { - echo "Only one instance of ${SCRIPT_NAME} can be run at a time." >&2 - echo "If you are certain no other instance is running, you can try removing" >&2 - echo "${LOCKFILE}" >&2 - exit 1 -} - -main() { - - lock \ - || exit_locked_error - - cat <> "$README_PATH" < Date: Tue, 26 Nov 2024 15:23:16 +0200 Subject: [PATCH 2/2] updated readme and permmissions --- README.md | 20 ++++++++++++++++---- zcutil/fetch-params.sh | 0 2 files changed, 16 insertions(+), 4 deletions(-) mode change 100644 => 100755 zcutil/fetch-params.sh diff --git a/README.md b/README.md index eceab8b..7344def 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,9 @@ This repository includes a simple Zebra Docker image that incorporates the Orcha - **ZSA Support**: Work with Zcash Shielded Assets (Orchard ZSA). - **Version Compatibility**: Supports transaction versions V5 and V6. +## Supported systems +- Tested on Ubuntu 22.04 LTS but should work on any Linux distribution that support the Prerequisites. + ## Core Components 1. **[librustzcash](https://github.com/zcash/librustzcash)**: Used for transaction creation and serialization. This version includes slight modifications for additional functionality. @@ -38,6 +41,12 @@ This repository includes a simple Zebra Docker image that incorporates the Orcha - **Docker**: [Install Docker](https://www.docker.com/get-started) - **Rust & Cargo**: [Install Rust and Cargo](https://www.rust-lang.org/tools/install) - **Diesel CLI**: Installed via Cargo. +- **Linux Dev tools**: +```bash +sudo apt update + +sudo apt install pkg-config libssl-dev libsqlite3-dev +``` ## Getting Started @@ -46,10 +55,10 @@ This repository includes a simple Zebra Docker image that incorporates the Orcha Open a terminal and execute the following commands: ```bash -# Build the Docker image +# Build the Zebra Docker image docker build -t qedit/zebra-regtest-txv6 . -# Run the Docker container +# Run the Zebra Docker container docker run -p 18232:18232 qedit/zebra-regtest-txv6 ``` @@ -59,9 +68,9 @@ For more details on how the Docker image is created and synchronized, refer to t In a separate terminal window, perform the following steps: -#### One-Time Diesel Setup +#### One-Time Setup -Install Diesel CLI and set up the database: +Install Diesel CLI and set up the database and get Zcash Params for Sapling: ```bash # Install Diesel CLI with SQLite support @@ -69,6 +78,9 @@ cargo install diesel_cli --no-default-features --features sqlite # Set up the database diesel setup + +# Get Zcash Params for Sapling (if needed) +./zcutil/fetch-params.sh ``` #### Build and Run the Orchard ZSA Test Case diff --git a/zcutil/fetch-params.sh b/zcutil/fetch-params.sh old mode 100644 new mode 100755