- Institutional / JVMTM / reserve-provenance / GRU transport + standards JSON - Validation and verify scripts (Blockscout labels, x402, GRU preflight, P1 local path) - Wormhole wiring in AGENTS, MCP_SETUP, MASTER_INDEX, 04-configuration README - Meta docs, integration gaps, live verification log, architecture updates - CI validate-config workflow updates Operator/LAN items, submodule working trees, and public token-aggregation edge routes remain follow-up (see TODOS_CONSOLIDATED P1). Made-with: Cursor
69 lines
2.9 KiB
Bash
Executable File
69 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Verify token-aggregation HTTP surface for Chain 138 (pools, quotes, bridge routes, and GRU preflight).
|
|
# Usage: BASE_URL=https://explorer.d-bis.org bash scripts/verify/check-token-aggregation-chain138-api.sh
|
|
# Tries both /api/v1/* and /token-aggregation/api/v1/* (explorer nginx layouts differ).
|
|
|
|
set -euo pipefail
|
|
|
|
BASE_URL="${BASE_URL:-https://explorer.d-bis.org}"
|
|
BASE_URL="${BASE_URL%/}"
|
|
|
|
CUSDT="0x93E66202A11B1772E55407B32B44e5Cd8eda7f22"
|
|
CUSDC="0xf22258f57794CC8E06237084b353Ab30fFfa640b"
|
|
|
|
try_path() {
|
|
local prefix="$1"
|
|
local path="$2"
|
|
local url="${BASE_URL}${prefix}${path}"
|
|
local code
|
|
code=$(curl -sS -o /tmp/ta-check.json -w "%{http_code}" -m 25 "$url" || echo "000")
|
|
echo " $code ${prefix}${path}"
|
|
if [[ "$code" == 200 ]]; then
|
|
head -c 220 /tmp/ta-check.json
|
|
echo
|
|
fi
|
|
}
|
|
|
|
echo "== Token-aggregation checks against ${BASE_URL} =="
|
|
for prefix in "" "/token-aggregation"; do
|
|
echo ""
|
|
echo "-- prefix: ${prefix:-/} (root /api/v1) --"
|
|
try_path "${prefix}" "/api/v1/tokens?chainId=138&limit=3&includeDodoPool=true"
|
|
try_path "${prefix}" "/api/v1/tokens/${CUSDT}/pools?chainId=138"
|
|
try_path "${prefix}" "/api/v1/quote?chainId=138&tokenIn=${CUSDT}&tokenOut=${CUSDC}&amountIn=1000000"
|
|
try_path "${prefix}" "/api/v1/bridge/routes"
|
|
try_path "${prefix}" "/api/v1/bridge/status"
|
|
try_path "${prefix}" "/api/v1/bridge/preflight"
|
|
try_path "${prefix}" "/api/v1/networks"
|
|
done
|
|
|
|
echo ""
|
|
echo ""
|
|
echo "== bridge summary =="
|
|
for prefix in "" "/token-aggregation"; do
|
|
code=$(curl -sS -o /tmp/br.json -w "%{http_code}" -m 20 "${BASE_URL}${prefix}/api/v1/bridge/routes" 2>/dev/null || echo 000)
|
|
echo "${prefix:-/} -> HTTP $code"
|
|
if [[ "$code" == "200" ]] && command -v jq >/dev/null 2>&1; then
|
|
jq '{weth9: .chain138Bridges.weth9, weth10: .chain138Bridges.weth10}' /tmp/br.json 2>/dev/null || head -c 200 /tmp/br.json
|
|
echo
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "== bridge/preflight summary =="
|
|
for prefix in "" "/token-aggregation"; do
|
|
code=$(curl -sS -o /tmp/gru-preflight.json -w "%{http_code}" -m 20 "${BASE_URL}${prefix}/api/v1/bridge/preflight" 2>/dev/null || echo 000)
|
|
echo "${prefix:-/} -> HTTP $code"
|
|
if [[ "$code" == "200" ]] && command -v jq >/dev/null 2>&1; then
|
|
jq '{transportPairs: .gruTransport.summary.transportPairs, runtimeReadyTransportPairs: .gruTransport.summary.runtimeReadyTransportPairs, blockedPairs: (.gruTransport.blockedPairs | length)}' /tmp/gru-preflight.json 2>/dev/null || head -c 200 /tmp/gru-preflight.json
|
|
echo
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "Notes:"
|
|
echo " - Empty tokens/pools: set DATABASE_URL + migrations; RPC to 138; PMM integration now defaults on-chain if env unset."
|
|
echo " - bridge/routes 404: redeploy token-aggregation from repo (implements GET /api/v1/bridge/routes)."
|
|
echo " - bridge/preflight blocked pairs: run bash scripts/verify/check-gru-transport-preflight.sh [BASE_URL] for exact missing refs."
|
|
echo " - Health: curl -s http://127.0.0.1:3001/health on explorer VM (not always proxied as /health)."
|