#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" source "$SCRIPT_DIR/_common.sh" : "${MERKLE_RUN_DIR:=}" : "${RFC3161_DIR:=}" : "${ETH_RUN_DIR:=}" : "${ETH_RPC_URL:=}" : "${BTC_RUN_DIR:=}" : "${BTC_NETWORK:=testnet}" main() { [[ -n "$MERKLE_RUN_DIR" ]] || { log_error "MERKLE_RUN_DIR is required"; exit 1; } [[ -d "$MERKLE_RUN_DIR" ]] || { log_error "MERKLE_RUN_DIR not found: $MERKLE_RUN_DIR"; exit 1; } [[ -f "$MERKLE_RUN_DIR/ROOT.txt" ]] || { log_error "Missing ROOT.txt in $MERKLE_RUN_DIR"; exit 1; } # tools (soft requirements) need jq || true need openssl || true need cast || true need bitcoin-cli || true log_info "Preflight OK (soft dependencies may be missing; checks will be skipped accordingly)." } main "$@"