Files
proxmox/scripts/verify-all-systems.sh
defiQUG e4c9dda0fd
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
chore: update submodule references and documentation
- Marked submodules ai-mcp-pmm-controller, explorer-monorepo, and smom-dbis-138 as dirty to reflect recent changes.
- Updated documentation to clarify operator script usage, including dotenv loading and task execution instructions.
- Enhanced the README and various index files to provide clearer navigation and task completion guidance.

Made-with: Cursor
2026-03-04 02:03:08 -08:00

124 lines
4.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Comprehensive verification of all deployed systems
# Tests: Explorer, APIs, Services, MetaMask integration
# Runs all tests even if some fail; exits 1 only if any failed
# Note: 301/404/000 in other checks often expected (HTTPS redirect, wrong port, NPMplus). See docs/04-configuration/DETAILED_GAPS_AND_ISSUES_LIST.md §11a.
set -uo pipefail
# Load IP configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
IP_BLOCKSCOUT="${IP_BLOCKSCOUT:-192.168.11.140}"
GREEN='\033[0;32m'
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m'
PASSED=0
FAILED=0
test_endpoint() {
local name="$1"
local url="$2"
local expected="$3"
local timeout="${4:-10}"
local follow_redirects="${5:-false}"
echo -n "Testing $name... "
local body
if [[ "$follow_redirects" == "true" ]]; then
body=$(curl -sL --max-time "$timeout" "$url" 2>/dev/null) || true
else
body=$(curl -s --max-time "$timeout" "$url" 2>/dev/null) || true
fi
if echo "$body" | grep -qE "$expected"; then
echo -e "${GREEN}PASS${NC}"
((PASSED++)) || true
else
echo -e "${RED}FAIL${NC}"
((FAILED++)) || true
fi
}
echo "========================================="
echo "System Verification — All Services"
echo "========================================="
echo ""
echo "1. Explorer (Blockscout) - Public"
test_endpoint "Explorer homepage" "https://explorer.d-bis.org/" "SolaceScanScout|Blockscout|blockscout|<!DOCTYPE html>|<html " 25 "true"
test_endpoint "Explorer stats API" "https://explorer.d-bis.org/api/v2/stats" "total_blocks"
test_endpoint "Explorer blocks API" "https://explorer.d-bis.org/api/v2/blocks" "height|items"
echo ""
echo "1b. Explorer (Blockscout) - Direct IP (if public unreachable)"
test_endpoint "Blockscout API direct" "http://${IP_BLOCKSCOUT}:4000/api/v2/stats" "total_blocks"
echo ""
echo "2. MetaMask Integration"
test_endpoint "Wallet page" "https://explorer.d-bis.org/wallet" "Chain 138|ChainID 138|Add Chain" 25
test_endpoint "Networks config" "https://explorer.d-bis.org/api/config/networks" "chains"
test_endpoint "Token list" "https://explorer.d-bis.org/api/config/token-list" "tokens"
echo ""
echo "3. RPC Nodes"
echo -n "Testing RPC endpoint (public)... "
if curl -sf --max-time 10 -X POST https://rpc-http-pub.d-bis.org \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' 2>/dev/null | grep -q "result"; then
echo -e "${GREEN}PASS${NC}"
((PASSED++)) || true
else
echo -e "${RED}FAIL${NC}"
((FAILED++)) || true
fi
echo ""
echo "4. Token-Aggregation API (Internal)"
echo -n "Testing market health... "
# Health may return 503 when DB missing; use -s (not -sf) to get body for grep
if curl -s --max-time 10 "http://${IP_BLOCKSCOUT}:3001/health" 2>/dev/null | grep -qE 'healthy|"status"|unhealthy'; then
echo -e "${GREEN}PASS${NC}"
((PASSED++)) || true
else
echo -e "${RED}FAIL${NC}"
((FAILED++)) || true
fi
echo -n "Testing market chains... "
if curl -sf --max-time 10 "http://${IP_BLOCKSCOUT}:3001/api/v1/chains" 2>/dev/null | grep -q "chainId"; then
echo -e "${GREEN}PASS${NC}"
((PASSED++)) || true
else
echo -e "${RED}FAIL${NC}"
((FAILED++)) || true
fi
echo ""
echo "5. Service Status (VMID 5000)"
ssh -o ConnectTimeout=10 root@${PROXMOX_HOST_R630_02:-192.168.11.12} "pct exec 5000 -- bash --norc -c '
for s in blockscout explorer-config-api token-aggregation nginx; do
echo -n \" \$s: \"
systemctl is-active \"\$s\" 2>/dev/null && echo Running || echo Stopped
done
'" 2>/dev/null || echo " (SSH to Proxmox unreachable)"
echo ""
echo "========================================="
echo "Summary"
echo "========================================="
echo -e "Passed: ${GREEN}$PASSED${NC}"
echo -e "Failed: ${RED}$FAILED${NC}"
echo ""
if [ $FAILED -eq 0 ]; then
echo -e "${GREEN}✅ All systems operational${NC}"
exit 0
else
echo -e "${RED}⚠️ Some tests failed${NC}"
exit 1
fi