Files
proxmox/scripts/verify/check-allmainnet-protocol-surface.sh
defiQUG 6db45b4d2b
All checks were successful
Deploy to Phoenix / validate (push) Successful in 1m19s
Deploy to Phoenix / deploy (push) Successful in 52s
Deploy to Phoenix / deploy-atomic-swap-dapp (push) Successful in 2m33s
phoenix-deploy Deployed to cloudflare-sync
Deploy to Phoenix / cloudflare (push) Successful in 39s
Add ALL Mainnet readiness gate generator
2026-04-28 19:38:54 -07:00

70 lines
2.7 KiB
Bash

#!/usr/bin/env bash
# Validate config/allmainnet-non-dodo-protocol-surface.json shape and internal consistency.
# Usage: from repo root: bash scripts/verify/check-allmainnet-protocol-surface.sh
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
F="$PROJECT_ROOT/config/allmainnet-non-dodo-protocol-surface.json"
if [[ ! -f "$F" ]]; then
echo "[ERROR] Missing $F"
exit 1
fi
if ! command -v jq &>/dev/null; then
echo "[ERROR] jq is required for ALL Mainnet surface validation"
exit 1
fi
jq -e '
(.chainId == 651940)
and (.status | type == "string")
and (.summary | type == "object")
and (.summary.bridgeOnlyLive | type == "boolean")
and (.summary.sameChainSwapInventoryPublished | type == "boolean")
and (.classificationFramework.metadataDomains | type == "array")
and ((.classificationFramework.metadataDomains - [
"backingMetadata",
"bridgeMetadata",
"cashMetadata",
"commodityMetadata",
"reserveMetadata",
"securityMetadata",
"settlementMetadata"
]) | length == 0)
and (.documentedTokens | type == "array")
and ((.documentedTokens | length) > 0)
and all(.documentedTokens[]; . as $token | (
(.symbol | type == "string")
and (.address | test("^0x[0-9a-fA-F]{40}$"))
and (.category | type == "string")
and (.instrumentType | type == "string")
and (.backingAssets | type == "array")
and (.tags | type == "array")
and (.backingMetadata | type == "object")
and (.bridgeMetadata | type == "object")
and (.cashMetadata | type == "object")
and (.commodityMetadata | type == "object")
and (.reserveMetadata | type == "object")
and (.securityMetadata | type == "object")
and (.settlementMetadata | type == "object")
and (($token.gruVersion == null) or (($token.tags | index("gru:" + $token.gruVersion)) != null))
))
and (.bridgeSurface.adapter.address | test("^0x[0-9a-fA-F]{40}$"))
and (.bridgeSurface.adapter.status == "live")
' "$F" >/dev/null || {
echo "[ERROR] allmainnet-non-dodo-protocol-surface.json: expected chainId 651940, summary flags, metadata domains, documented token metadata, GRU version tags, and live bridge adapter"
exit 1
}
PUBLISHED="$(jq -r '.summary.sameChainSwapInventoryPublished' "$F")"
STATUS="$(jq -r '.status' "$F")"
if [[ "$PUBLISHED" == "true" ]] && [[ "$STATUS" == "bridge_live_swap_inventory_pending" ]]; then
echo "[ERROR] Inconsistent: summary.sameChainSwapInventoryPublished is true but status is still bridge_live_swap_inventory_pending (update status when promoting inventory)"
exit 1
fi
echo "[OK] allmainnet-non-dodo-protocol-surface.json OK (chainId, summary flags, publication vs status)"
exit 0