Files
proxmox/scripts/verify/check-allmainnet-protocol-surface.sh
defiQUG 485af45c2b feat: regulated treasury wallet master plan + ALL Mainnet CI validation
- Add GOVERNMENT_TREASURY_EMI_WALLET_MASTER_PLAN.md (Rail/RTGS/URA/EMI/wallet/VA gates); index in AGENTS.md and MASTER_INDEX.md
- Add scripts/verify/check-allmainnet-protocol-surface.sh and check-allmainnet-chains-flags.sh (gate alias); wire into validate-config-files.sh
- run-all-validation.sh: remove duplicate Gitea workflow steps (1c/1d)
- smom-dbis-138: ALL_MAINNET_CONFIGURATION + VERIFICATION_COMPLETE aligned with proxmox surface JSON

Made-with: Cursor
2026-04-28 04:20:33 -07:00

40 lines
1.5 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")
' "$F" >/dev/null || {
echo "[ERROR] allmainnet-non-dodo-protocol-surface.json: expected chainId 651940, status string, summary.bridgeOnlyLive and summary.sameChainSwapInventoryPublished booleans"
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