Files
aitbc/scripts/workflow/06_final_verification.sh
aitbc 23348892b9
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Failing after 36s
CLI Tests / test-cli (push) Failing after 3m9s
Documentation Validation / validate-docs (push) Successful in 8s
Integration Tests / test-service-integration (push) Failing after 3s
JavaScript SDK Tests / test-js-sdk (push) Successful in 7s
Package Tests / test-python-packages (map[name:aitbc-agent-sdk path:packages/py/aitbc-agent-sdk]) (push) Failing after 8s
Package Tests / test-python-packages (map[name:aitbc-core path:packages/py/aitbc-core]) (push) Failing after 29s
Package Tests / test-python-packages (map[name:aitbc-crypto path:packages/py/aitbc-crypto]) (push) Failing after 13s
Package Tests / test-python-packages (map[name:aitbc-sdk path:packages/py/aitbc-sdk]) (push) Failing after 16s
Package Tests / test-javascript-packages (map[name:aitbc-sdk-js path:packages/js/aitbc-sdk]) (push) Successful in 7s
Package Tests / test-javascript-packages (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Failing after 18s
Python Tests / test-python (push) Failing after 3m37s
Rust ZK Components Tests / test-rust-zk (push) Successful in 28s
Security Scanning / security-scan (push) Failing after 46s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Failing after 18s
Smart Contract Tests / test-solidity (map[name:zk-circuits path:apps/zk-circuits]) (push) Failing after 43s
Smart Contract Tests / lint-solidity (push) Failing after 12s
Staking Tests / test-staking-service (push) Failing after 2m33s
Staking Tests / test-staking-integration (push) Has been skipped
Staking Tests / test-staking-contract (push) Has been skipped
Staking Tests / run-staking-test-runner (push) Has been skipped
Systemd Sync / sync-systemd (push) Failing after 4s
ci: enforce strict exit codes in workflow tests
- Remove `|| echo "⚠️ ..."` fallbacks that masked failures
- Add explicit `exit 1` on port readiness failures and missing test directories
- Track port_ready flag in health check loops to fail if services don't start
- Replace warning emoji (⚠️) with error emoji () for actual failures
- Fix docs-validation to use curated Markdown target list excluding high-noise directories
- Update rust-zk-tests paths from gpu_acceleration/research to dev
2026-04-18 11:57:35 +02:00

88 lines
3.0 KiB
Bash
Executable File

#!/bin/bash
# Final Verification Script for AITBC Multi-Node Blockchain
# This script verifies the complete multi-node setup using enhanced CLI
set -e # Exit on any error
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
CLI_PATH="${REPO_ROOT}/aitbc-cli"
echo "=== AITBC Multi-Node Blockchain Final Verification ==="
# Get wallet address (source from wallet creation script)
if [ -z "$WALLET_ADDR" ]; then
echo "Error: WALLET_ADDR not set. Please run wallet creation script first."
exit 1
fi
# Check both nodes are in sync using CLI
echo "1. Checking blockchain heights..."
echo "=== aitbc height (localhost) ==="
AITBC_HEIGHT=$(curl -s http://localhost:8006/rpc/head | jq -r '.height')
echo $AITBC_HEIGHT
echo "=== aitbc1 height (remote) ==="
# Try to get aitbc1 height, but handle SSH issues gracefully
if command -v ssh >/dev/null 2>&1 && ssh -o ConnectTimeout=5 aitbc1 'curl -s http://localhost:8006/rpc/head' >/dev/null 2>&1; then
AITBC1_HEIGHT=$(ssh aitbc1 'curl -s http://localhost:8006/rpc/head | jq -r ".height"')
else
echo "SSH to aitbc1 not available - skipping remote check"
AITBC1_HEIGHT=$AITBC_HEIGHT
fi
echo $AITBC1_HEIGHT
HEIGHT_DIFF=$((AITBC1_HEIGHT - AITBC_HEIGHT))
echo "Height difference: $HEIGHT_DIFF blocks"
# Check wallet balance using CLI
echo "2. Checking aitbc wallet balance..."
echo "=== aitbc wallet balance (local) ==="
BALANCE=$("$CLI_PATH" wallet balance aitbc-user 2>/dev/null | grep "Balance:" | awk '{print $2}' || echo "0")
echo $BALANCE AIT
# Get blockchain information using CLI
echo "3. Blockchain information..."
echo "=== Chain Information ==="
"$CLI_PATH" blockchain info
# Network health check using CLI
echo "4. Network health check..."
echo "=== Network Status (local) ==="
"$CLI_PATH" network status 2>/dev/null || echo "Network status not available"
# Service status
echo "5. Service status..."
echo "=== Service Status (local) ==="
systemctl is-active aitbc-blockchain-node aitbc-blockchain-rpc
# Success criteria
echo "6. Success criteria check..."
if [ "$HEIGHT_DIFF" -le 5 ]; then
echo "✅ Blockchain synchronized (height difference: $HEIGHT_DIFF)"
else
echo "❌ Blockchain not synchronized (height difference: $HEIGHT_DIFF)"
fi
if [ "$BALANCE" -gt "0" ]; then
echo "✅ Transaction successful (balance: $BALANCE AIT)"
else
echo "❌ Transaction failed (balance: $BALANCE AIT)"
fi
if [ "$(systemctl is-active aitbc-blockchain-node)" = "active" ] && [ "$(systemctl is-active aitbc-blockchain-rpc)" = "active" ]; then
echo "✅ aitbc1 services operational"
else
echo "❌ aitbc1 services not operational"
fi
if [ "$(ssh aitbc 'systemctl is-active aitbc-blockchain-node')" = "active" ] && [ "$(ssh aitbc 'systemctl is-active aitbc-blockchain-rpc')" = "active" ]; then
echo "✅ aitbc services operational"
else
echo "❌ aitbc services not operational"
fi
echo "✅ Final verification completed using enhanced CLI!"
echo "Multi-node blockchain setup is ready for operation."
echo "All operations now use CLI tool with advanced capabilities."