chore: sync docs, config schemas, scripts, and meta task alignment
- 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
2026-03-31 22:31:39 -07:00
#!/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"
2026-04-12 06:12:20 -07:00
WETH10 = "0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f"
USDT = "0x004b63A7B5b0E06f6bB6adb4a5F9f590BF3182D1"
USDC = "0x71D6687F38b93CCad569Fa6352c876eea967201b"
chore: sync docs, config schemas, scripts, and meta task alignment
- 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
2026-03-31 22:31:39 -07:00
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
}
2026-04-12 06:12:20 -07:00
try_post_path( ) {
local prefix = " $1 "
local path = " $2 "
local body = " $3 "
local url = " ${ BASE_URL } ${ prefix } ${ path } "
local code
code = $( curl -sS -o /tmp/ta-check.json -w "%{http_code}" -m 25 \
-H "content-type: application/json" \
-X POST \
--data " $body " \
" $url " || echo "000" )
echo " $code POST ${ prefix } ${ path } "
if [ [ " $code " = = 200 || " $code " = = 400 ] ] ; then
head -c 260 /tmp/ta-check.json
echo
fi
}
chore: sync docs, config schemas, scripts, and meta task alignment
- 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
2026-03-31 22:31:39 -07:00
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 "
2026-04-12 06:12:20 -07:00
if command -v jq >/dev/null 2>& 1; then
qurl = " ${ BASE_URL } ${ prefix } /api/v1/quote?chainId=138&tokenIn= ${ CUSDT } &tokenOut= ${ CUSDC } &amountIn=1000000 "
qcode = $( curl -sS -o /tmp/ta-quote.json -w "%{http_code}" -m 25 " $qurl " 2>/dev/null || echo "000" )
if [ [ " $qcode " = = "200" ] ] ; then
qe = $( jq -r '.quoteEngine // "absent"' /tmp/ta-quote.json 2>/dev/null || echo "?" )
echo " quoteEngine= ${ qe } ( ${ BASE_URL } ${ prefix } /api/v1/quote cUSDT→cUSDC) "
if [ [ " $qe " = = "constant-product" ] ] ; then
echo " (hint: PMM on-chain not used — RPC unset, blocked, or pool not DODO; publication deploy sets RPC_URL_138)"
fi
if [ [ " $qe " = = "absent" ] ] ; then
echo " (hint: redeploy token-aggregation from repo — older build omits quoteEngine; run deploy-token-aggregation-for-publication.sh on explorer host)"
fi
fi
fi
chore: sync docs, config schemas, scripts, and meta task alignment
- 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
2026-03-31 22:31:39 -07:00
try_path " ${ prefix } " "/api/v1/bridge/routes"
try_path " ${ prefix } " "/api/v1/bridge/status"
try_path " ${ prefix } " "/api/v1/bridge/preflight"
2026-04-12 06:12:20 -07:00
try_path " ${ prefix } " "/api/v1/report/gas-registry?chainId=10"
chore: sync docs, config schemas, scripts, and meta task alignment
- 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
2026-03-31 22:31:39 -07:00
try_path " ${ prefix } " "/api/v1/networks"
done
2026-04-12 06:12:20 -07:00
echo ""
echo "== planner-v2 checks =="
echo ""
echo "-- prefix: /token-aggregation (published v2 path) --"
try_path "/token-aggregation" "/api/v2/providers/capabilities?chainId=138"
if [ [ -f /tmp/ta-check.json ] ] && head -c 20 /tmp/ta-check.json | grep -qi '<!DOCTYPE' ; then
echo " [WARN] capabilities response looks like HTML — nginx may not proxy /token-aggregation/api/v2/ to token-aggregation (VMID 5000: scripts/fix-explorer-token-aggregation-api-v2-proxy.sh)"
fi
try_post_path "/token-aggregation" "/api/v2/routes/plan" " {\"sourceChainId\":138,\"tokenIn\":\" ${ WETH10 } \",\"tokenOut\":\" ${ USDT } \",\"amountIn\":\"100000000000000000\"} "
try_post_path "/token-aggregation" "/api/v2/routes/internal-execution-plan" " {\"sourceChainId\":138,\"tokenIn\":\" ${ WETH10 } \",\"tokenOut\":\" ${ USDT } \",\"amountIn\":\"100000000000000000\"} "
echo ""
echo "== DODO stable depth sanity =="
for prefix in "" "/token-aggregation" ; do
code = $( curl -sS -o /tmp/ta-depth.json -w "%{http_code}" -m 20 \
" ${ BASE_URL } ${ prefix } /api/v1/routes/tree?chainId=138&tokenIn= ${ CUSDC } &tokenOut= ${ USDC } &amountIn=1000000 " \
2>/dev/null || echo 000)
echo " ${ prefix :- / } -> HTTP $code "
if [ [ " $code " = = "200" ] ] && command -v jq >/dev/null 2>& 1; then
jq '{pool: .pools[0].poolAddress, tvlUsd: .pools[0].depth.tvlUsd, estimatedTradeCapacityUsd: .pools[0].depth.estimatedTradeCapacityUsd}' /tmp/ta-depth.json 2>/dev/null || head -c 220 /tmp/ta-depth.json
echo
fi
done
chore: sync docs, config schemas, scripts, and meta task alignment
- 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
2026-03-31 22:31:39 -07:00
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
2026-04-12 06:12:20 -07:00
echo ""
echo "== gas-registry summary =="
for prefix in "" "/token-aggregation" ; do
code = $( curl -sS -o /tmp/gas-registry.json -w "%{http_code}" -m 20 " ${ BASE_URL } ${ prefix } /api/v1/report/gas-registry?chainId=10 " 2>/dev/null || echo 000)
echo " ${ prefix :- / } -> HTTP $code "
if [ [ " $code " = = "200" ] ] && command -v jq >/dev/null 2>& 1; then
jq '{gasAssetFamilies: (.gasAssetFamilies | length), gasRedeemGroups: (.gasRedeemGroups | length), chains: (.chains | length), gasProtocolExposure: (.gasProtocolExposure | length)}' /tmp/gas-registry.json 2>/dev/null || head -c 200 /tmp/gas-registry.json
echo
fi
done
chore: sync docs, config schemas, scripts, and meta task alignment
- 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
2026-03-31 22:31:39 -07:00
echo ""
echo "Notes:"
2026-04-12 06:12:20 -07:00
echo " - Empty tokens/pools: set DATABASE_URL, then run bash smom-dbis-138/services/token-aggregation/scripts/apply-lightweight-schema.sh for standalone deployments; RPC to 138; PMM integration now defaults on-chain if env unset."
chore: sync docs, config schemas, scripts, and meta task alignment
- 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
2026-03-31 22:31:39 -07:00
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."
2026-04-12 06:12:20 -07:00
echo " - gas-registry 404: redeploy token-aggregation from repo (implements GET /api/v1/report/gas-registry)."
chore: sync docs, config schemas, scripts, and meta task alignment
- 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
2026-03-31 22:31:39 -07:00
echo " - Health: curl -s http://127.0.0.1:3001/health on explorer VM (not always proxied as /health)."
2026-04-12 06:12:20 -07:00
echo " - planner-v2 publishes under /token-aggregation/api/v2/* so it does not collide with Blockscout /api/v2/* on explorer.d-bis.org."
echo " - Apex https://explorer.d-bis.org/api/v1/* returns 400 while /token-aggregation/api/v1/* works: add HTTP+HTTPS location /api/v1/ → token-aggregation (scripts/fix-explorer-http-api-v1-proxy.sh on explorer VM)."
echo " - POST /token-aggregation/api/v2/* returns 405: insert v2 proxy block (scripts/fix-explorer-token-aggregation-api-v2-proxy.sh on VMID 5000)."
echo " - Fresh binary + PMM env: bash scripts/deploy-token-aggregation-for-publication.sh then rsync dist/node_modules/.env to /opt/token-aggregation; systemctl restart token-aggregation (see TOKEN_AGGREGATION_REPORT_API_RUNBOOK.md)."
echo " - DODO v3 pilot routes should return provider=dodo_v3, routePlanPresent=true, and an internal-execution-plan object targeting EnhancedSwapRouterV2 when CHAIN138_ENABLE_DODO_V3_EXECUTION is live."
echo " - The funded canonical cUSDC/USDC DODO pool should report non-zero route-tree depth on Chain 138; if it falls back to near-zero TVL again, check the DODO valuation path and the canonical PMM integration address."