docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
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>
This commit is contained in:
defiQUG
2026-02-12 15:46:57 -08:00
parent cc8dcaf356
commit fbda1b4beb
5114 changed files with 498901 additions and 4567 deletions

View File

@@ -0,0 +1,77 @@
#!/usr/bin/env node
/**
* Minimal integration test for multi-chain execution API.
* Creates intent 138 -> 651940, executes, and verifies execution.
* Assumes deterministic contract addresses: same address on 138 and 651940 (CREATE2).
* Run with: BASE_URL=http://localhost:3001 node scripts/integration-test.mjs
* Prerequisite: npm run build && npm start (in another terminal).
*/
const BASE = process.env.BASE_URL || 'http://localhost:3001';
async function request(method, path, body = null) {
const opts = { method, headers: {} };
if (body) {
opts.headers['Content-Type'] = 'application/json';
opts.body = JSON.stringify(body);
}
const res = await fetch(`${BASE}${path}`, opts);
const text = await res.text();
if (!res.ok) throw new Error(`${res.status} ${path}: ${text}`);
return text ? JSON.parse(text) : {};
}
async function main() {
console.log('Integration test (138 -> 651940, deterministic addresses assumed)\n');
const health = await request('GET', '/v1/health');
console.log('Health:', health.status, health.circuit_breaker);
if (health.status !== 'ok' && health.status !== 'degraded') {
throw new Error('Health check failed');
}
const intentPayload = {
type: 'cross_chain',
chain_from: 138,
chain_to: 651940,
asset_in: 'native',
asset_out: 'native',
amount: '1000000',
idempotency_key: `integration-${Date.now()}`,
};
const intent = await request('POST', '/v1/intents', intentPayload);
if (!intent.intent_id) throw new Error('No intent_id');
console.log('Intent created:', intent.intent_id);
const exec = await request('POST', `/v1/intents/${intent.intent_id}/execute`);
if (!exec.execution_id) throw new Error('No execution_id');
console.log('Execution started:', exec.execution_id);
const execution = await request('GET', `/v1/executions/${exec.execution_id}`);
console.log('Execution status:', execution.status || execution);
const commitPayload = {
chain_id: 138,
leaves: [{
chainId: 138,
txHash: '0x' + '0'.repeat(64),
blockNumber: '100',
receiptRootOrLogsBloom: '0x00',
normalizedEventPayloadHash: '0x00',
salJournalEntryHash: null,
}],
uri: 'https://example.com/leaves',
};
const commit = await request('POST', '/v1/mirror/commit', commitPayload);
if (commit.commit_id) {
const got = await request('GET', `/v1/mirror/commits/${commit.commit_id}`);
console.log('Mirror commit verified:', got.commit_id === commit.commit_id);
}
console.log('\nIntegration test OK (deterministic addresses assumed for 138 and 651940).');
}
main().catch((err) => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,58 @@
#!/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."