#!/usr/bin/env bash # Run the musiquay end-to-end lab in Docker. # # test/musiquay-lab.sh # # The lab starts a relay + Blossom host, a Cashu mint with a fake Lightning # backend, and a one-shot client that drives the protocol over the network. set -euo pipefail cd "$(dirname "$0")/.." COMPOSE_FILE=docker-compose.musiquay-lab.yml for arg in "$@"; do case "$arg" in -h|--help) sed -n '2,9p' "$0" | sed 's/^# \{0,1\}//' exit 0 ;; *) echo "unknown argument: $arg" >&2 exit 2 ;; esac done cleanup() { docker compose -f "$COMPOSE_FILE" down -v --remove-orphans >/dev/null 2>&1 || true } trap cleanup EXIT # A previous run may have left volumes with spent ecash and old wraps. docker compose -f "$COMPOSE_FILE" down -v --remove-orphans >/dev/null 2>&1 || true echo "==> building images (first run pulls Go/Debian/Alpine layers)" docker compose -f "$COMPOSE_FILE" build echo "==> starting relay and mint" docker compose -f "$COMPOSE_FILE" up --abort-on-container-exit --exit-code-from lab