Files
explorer-monorepo/scripts/verify/check-explorer-dual-domain-parity.sh
defiQUG 8a61b1bde2
Some checks failed
Deploy Explorer Live / deploy (push) Failing after 15s
Make WalletConnect parity check opt-in until backend deploy.
Default dual-domain verifier skips walletconnect/config; set INCLUDE_WALLETCONNECT=1 after backend rollout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 21:56:38 -07:00

53 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
PRIMARY_DOMAIN="${PRIMARY_DOMAIN:-https://explorer.d-bis.org}"
COMPANION_DOMAIN="${COMPANION_DOMAIN:-https://blockscout.defi-oracle.io}"
paths=(
"/"
"/wallet"
"/operations"
"/bridge"
"/api/v2/stats"
"/explorer-api/v1/track1/bridge/status"
"/token-aggregation/api/v1/routes/matrix?includeNonLive=true"
)
if [[ "${INCLUDE_WALLETCONNECT:-0}" == "1" ]]; then
paths+=("/explorer-api/v1/walletconnect/config")
fi
failures=0
check_path() {
local domain="$1"
local path="$2"
local code
code="$(curl -ksS -o /dev/null -w '%{http_code}' --max-time 20 "${domain}${path}")"
if [[ "$code" =~ ^(200|301|302|307|308)$ ]]; then
printf 'OK %3s %s%s\n' "$code" "$domain" "$path"
else
printf 'FAIL %3s %s%s\n' "$code" "$domain" "$path"
failures=$((failures + 1))
fi
}
echo "Checking explorer dual-domain parity"
echo "Primary: $PRIMARY_DOMAIN"
echo "Companion: $COMPANION_DOMAIN"
echo
for path in "${paths[@]}"; do
check_path "$PRIMARY_DOMAIN" "$path"
check_path "$COMPANION_DOMAIN" "$path"
done
echo
if (( failures > 0 )); then
echo "Dual-domain parity check failed ($failures mismatches/non-200)." >&2
exit 1
fi
echo "Dual-domain parity check passed."