Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
1.8 KiB
Bash
59 lines
1.8 KiB
Bash
#!/usr/bin/env bash
|
|
# Smoke test for multi-chain execution API. Run after: npm run build && npm start (in another terminal).
|
|
set -e
|
|
BASE="${BASE_URL:-http://localhost:3001}"
|
|
|
|
echo "Health..."
|
|
curl -sSf "$BASE/v1/health" | jq .
|
|
|
|
echo "Create intent..."
|
|
INTENT=$(curl -sS -X POST "$BASE/v1/intents" -H "Content-Type: application/json" -d '{
|
|
"type": "cross_chain",
|
|
"chain_from": 138,
|
|
"chain_to": 651940,
|
|
"asset_in": "native",
|
|
"asset_out": "native",
|
|
"amount": "1000000",
|
|
"idempotency_key": "smoke-'$(date +%s)'"
|
|
}')
|
|
echo "$INTENT" | jq .
|
|
INTENT_ID=$(echo "$INTENT" | jq -r '.intent_id')
|
|
if [ -z "$INTENT_ID" ] || [ "$INTENT_ID" = "null" ]; then echo "No intent_id"; exit 1; fi
|
|
|
|
echo "Execute intent..."
|
|
EXEC=$(curl -sS -X POST "$BASE/v1/intents/$INTENT_ID/execute")
|
|
echo "$EXEC" | jq .
|
|
EXEC_ID=$(echo "$EXEC" | jq -r '.execution_id')
|
|
if [ -z "$EXEC_ID" ] || [ "$EXEC_ID" = "null" ]; then echo "No execution_id"; exit 1; fi
|
|
|
|
echo "Get execution..."
|
|
curl -sSf "$BASE/v1/executions/$EXEC_ID" | jq .
|
|
|
|
echo "Mirror commit (minimal)..."
|
|
COMMIT=$(curl -sS -X POST "$BASE/v1/mirror/commit" -H "Content-Type: application/json" -d '{
|
|
"chain_id": 138,
|
|
"leaves": [{
|
|
"chainId": 138,
|
|
"txHash": "0x0000000000000000000000000000000000000000000000000000000000000001",
|
|
"blockNumber": "100",
|
|
"receiptRootOrLogsBloom": "0x00",
|
|
"normalizedEventPayloadHash": "0x00",
|
|
"salJournalEntryHash": null
|
|
}],
|
|
"uri": "https://example.com/leaves"
|
|
}')
|
|
echo "$COMMIT" | jq .
|
|
COMMIT_ID=$(echo "$COMMIT" | jq -r '.commit_id')
|
|
if [ -n "$COMMIT_ID" ] && [ "$COMMIT_ID" != "null" ]; then
|
|
echo "Get commit..."
|
|
curl -sSf "$BASE/v1/mirror/commits/$COMMIT_ID" | jq .
|
|
fi
|
|
|
|
echo "Admin circuit-breaker off..."
|
|
curl -sS -X POST "$BASE/v1/admin/circuit-breaker/off" | jq .
|
|
|
|
echo "Metrics..."
|
|
curl -sSf "$BASE/v1/metrics" | head -5
|
|
|
|
echo "Smoke test OK."
|