#!/usr/bin/env bash # Run a Quantus dev node from the pinned release binary: the same chain the # integration tests and CI use. Downloads once into .cache/, verifies the # checksum, and runs `quantus-node --dev` in the foreground with a throwaway # base path. Ctrl-C stops it and the chain is gone. # # script/dev-node.sh # start on ws://127.0.0.1:9944 # script/dev-node.sh --rpc-port 9955 # # Bump VERSION and SHA256 together; the sha256sums file is in the release. set -euo pipefail VERSION="v1.0.1" SHA256="5880937c2a933b97d9916c5c9e78425d9918c6d7b68abe69de43680f62c13c93" ARCH="x86_64-unknown-linux-gnu" URL="https://github.com/Quantus-Network/chain/releases/download/${VERSION}/quantus-node-${VERSION}-${ARCH}.tar.gz" here="$(cd "$(dirname "$0")/.." && pwd)" cache="${here}/.cache/quantus-node/${VERSION}" bin="${cache}/quantus-node" if [ ! -x "${bin}" ]; then mkdir -p "${cache}" echo "fetching quantus-node ${VERSION}" >&2 curl -sSL --fail -o "${cache}/node.tgz" "${URL}" echo "${SHA256} ${cache}/node.tgz" | sha256sum -c - >&2 tar -xzf "${cache}/node.tgz" -C "${cache}" rm -f "${cache}/node.tgz" chmod +x "${bin}" fi base="$(mktemp -d -t quantus-dev-XXXXXX)" trap 'rm -rf "${base}"' EXIT exec "${bin}" --dev --base-path "${base}" --rpc-methods unsafe "$@"