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>
271 lines
11 KiB
Bash
Executable File
271 lines
11 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Verify Besu Configuration Deployment Readiness
|
|
# Checks all prerequisites before deploying configurations to nodes
|
|
|
|
set -euo 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
|
|
|
|
|
|
# Colors
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m'
|
|
|
|
# Script directory
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
# Configuration
|
|
PROXMOX_HOST="${PROXMOX_HOST:-192.168.11.10}"
|
|
SSH_KEY="${SSH_KEY:-~/.ssh/id_ed25519_proxmox}"
|
|
|
|
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
|
|
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
|
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
|
|
|
# Counters
|
|
CHECKS_PASSED=0
|
|
CHECKS_FAILED=0
|
|
CHECKS_WARN=0
|
|
|
|
# Function to check result
|
|
check_result() {
|
|
local status=$1
|
|
local message=$2
|
|
|
|
if [ "$status" -eq 0 ]; then
|
|
log_success "$message"
|
|
((CHECKS_PASSED++))
|
|
return 0
|
|
else
|
|
log_error "$message"
|
|
((CHECKS_FAILED++))
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
check_warn() {
|
|
local status=$1
|
|
local message=$2
|
|
|
|
if [ "$status" -eq 0 ]; then
|
|
log_success "$message"
|
|
((CHECKS_PASSED++))
|
|
else
|
|
log_warn "$message"
|
|
((CHECKS_WARN++))
|
|
fi
|
|
}
|
|
|
|
echo -e "${BLUE}╔══════════════════════════════════════════════════════════════╗${NC}"
|
|
echo -e "${BLUE}║ BESU DEPLOYMENT READINESS VERIFICATION ║${NC}"
|
|
echo -e "${BLUE}╚══════════════════════════════════════════════════════════╝${NC}"
|
|
echo ""
|
|
|
|
# Phase 1: Configuration File Checks
|
|
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
|
|
echo -e "${BLUE}Phase 1: Configuration Files${NC}"
|
|
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
|
|
echo ""
|
|
|
|
# Check config files exist
|
|
log_info "Checking configuration files exist..."
|
|
CONFIG_COUNT=0
|
|
for config in \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-validator.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-core.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-public.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-perm.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-thirdweb.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-4.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-putu-1.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-putu-8a.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-luis-1.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-rpc-luis-8a.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138/config/config-member.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs/config-validator.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs/config-rpc-core.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs/config-rpc.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs/config-rpc-4.toml" \
|
|
"$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs/config-sentry.toml"; do
|
|
if [ -f "$config" ]; then
|
|
((CONFIG_COUNT++))
|
|
fi
|
|
done
|
|
|
|
if [ "$CONFIG_COUNT" -ge 16 ]; then
|
|
log_success "All $CONFIG_COUNT configuration files found"
|
|
((CHECKS_PASSED++))
|
|
else
|
|
log_error "Missing configuration files (found: $CONFIG_COUNT/16)"
|
|
((CHECKS_FAILED++))
|
|
fi
|
|
|
|
# Validate configs
|
|
log_info "Validating configuration files..."
|
|
if [ -f "$PROJECT_ROOT/scripts/validate-besu-config.sh" ]; then
|
|
if "$PROJECT_ROOT/scripts/validate-besu-config.sh" 2>&1 | grep -q "All configuration files passed validation"; then
|
|
log_success "All configuration files validated"
|
|
((CHECKS_PASSED++))
|
|
else
|
|
log_error "Configuration validation failed"
|
|
((CHECKS_FAILED++))
|
|
fi
|
|
else
|
|
log_error "Validation script not found"
|
|
((CHECKS_FAILED++))
|
|
fi
|
|
|
|
# Check for deprecated options
|
|
log_info "Checking for deprecated options..."
|
|
if [ -f "$PROJECT_ROOT/scripts/cleanup-besu-deprecated-options.sh" ]; then
|
|
DEPRECATED_COUNT=0
|
|
for config in "$PROJECT_ROOT/smom-dbis-138/config"/*.toml "$PROJECT_ROOT/smom-dbis-138-proxmox/templates/besu-configs"/*.toml; do
|
|
if [ -f "$config" ]; then
|
|
if grep -qE '^(log-destination|fast-sync-min-peers|database-path|trie-logs-enabled|accounts-enabled|max-remote-initiated-connections|rpc-http-host-allowlist|rpc-tx-feecap="0x0"|tx-pool-max-size|tx-pool-price-bump|tx-pool-retention-hours)' "$config" 2>/dev/null; then
|
|
((DEPRECATED_COUNT++))
|
|
fi
|
|
fi
|
|
done
|
|
|
|
if [ "$DEPRECATED_COUNT" -eq 0 ]; then
|
|
log_success "No deprecated options detected"
|
|
((CHECKS_PASSED++))
|
|
else
|
|
log_warn "Found deprecated options in $DEPRECATED_COUNT files"
|
|
((CHECKS_WARN++))
|
|
fi
|
|
fi
|
|
|
|
echo ""
|
|
|
|
# Phase 2: Script Availability
|
|
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
|
|
echo -e "${BLUE}Phase 2: Deployment Scripts${NC}"
|
|
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
|
|
echo ""
|
|
|
|
REQUIRED_SCRIPTS=(
|
|
"scripts/validate-besu-config.sh"
|
|
"scripts/deploy-besu-configs.sh"
|
|
"scripts/audit-besu-configs.sh"
|
|
)
|
|
|
|
for script in "${REQUIRED_SCRIPTS[@]}"; do
|
|
script_path="$PROJECT_ROOT/$script"
|
|
if [ -f "$script_path" ] && [ -x "$script_path" ]; then
|
|
log_success "$script: Available and executable"
|
|
((CHECKS_PASSED++))
|
|
else
|
|
if [ -f "$script_path" ]; then
|
|
log_warn "$script: Not executable (run: chmod +x $script_path)"
|
|
((CHECKS_WARN++))
|
|
else
|
|
log_error "$script: Not found"
|
|
((CHECKS_FAILED++))
|
|
fi
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
|
|
# Phase 3: Network Connectivity (Optional - only warn if unavailable)
|
|
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
|
|
echo -e "${BLUE}Phase 3: Network Connectivity${NC}"
|
|
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
|
|
echo ""
|
|
|
|
# Check SSH access to Proxmox host
|
|
log_info "Checking SSH access to Proxmox host ($PROXMOX_HOST)..."
|
|
if ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no -i "${SSH_KEY/#\~/$HOME}" "root@${PROXMOX_HOST}" "echo 'SSH OK'" &>/dev/null 2>&1; then
|
|
log_success "SSH access to Proxmox host confirmed"
|
|
((CHECKS_PASSED++))
|
|
SSH_AVAILABLE=1
|
|
else
|
|
log_warn "Cannot access Proxmox host via SSH (deployment will require manual steps)"
|
|
log_warn " Host: $PROXMOX_HOST"
|
|
log_warn " SSH Key: ${SSH_KEY}"
|
|
log_warn " Note: This is OK if you'll deploy manually"
|
|
((CHECKS_WARN++))
|
|
SSH_AVAILABLE=0
|
|
fi
|
|
|
|
# If SSH available, check container accessibility
|
|
if [ "$SSH_AVAILABLE" -eq 1 ]; then
|
|
log_info "Checking sample container accessibility..."
|
|
SAMPLE_VMID=1000
|
|
if ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no -i "${SSH_KEY/#\~/$HOME}" "root@${PROXMOX_HOST}" "pct status $SAMPLE_VMID 2>/dev/null | grep -q running" 2>/dev/null; then
|
|
log_success "Sample container (VMID $SAMPLE_VMID) is accessible"
|
|
((CHECKS_PASSED++))
|
|
else
|
|
log_warn "Sample container (VMID $SAMPLE_VMID) not accessible or not running"
|
|
log_warn " Note: This is OK if container is stopped"
|
|
((CHECKS_WARN++))
|
|
fi
|
|
fi
|
|
|
|
echo ""
|
|
|
|
# Phase 4: Deployment Script Dry-Run
|
|
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
|
|
echo -e "${BLUE}Phase 4: Deployment Script Test${NC}"
|
|
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
|
|
echo ""
|
|
|
|
if [ -f "$PROJECT_ROOT/scripts/deploy-besu-configs.sh" ] && [ -x "$PROJECT_ROOT/scripts/deploy-besu-configs.sh" ]; then
|
|
log_info "Running deployment script dry-run..."
|
|
if "$PROJECT_ROOT/scripts/deploy-besu-configs.sh" --dry-run 2>&1 | grep -q "DRY-RUN MODE"; then
|
|
log_success "Deployment script dry-run successful"
|
|
((CHECKS_PASSED++))
|
|
else
|
|
log_warn "Deployment script dry-run had issues (check output above)"
|
|
((CHECKS_WARN++))
|
|
fi
|
|
fi
|
|
|
|
echo ""
|
|
|
|
# Summary
|
|
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
|
|
echo -e "${BLUE}Summary${NC}"
|
|
echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
|
|
echo ""
|
|
|
|
TOTAL_CHECKS=$((CHECKS_PASSED + CHECKS_FAILED + CHECKS_WARN))
|
|
|
|
echo "Checks passed: $CHECKS_PASSED"
|
|
echo "Checks failed: $CHECKS_FAILED"
|
|
echo "Warnings: $CHECKS_WARN"
|
|
echo "Total checks: $TOTAL_CHECKS"
|
|
echo ""
|
|
|
|
if [ "$CHECKS_FAILED" -eq 0 ]; then
|
|
if [ "$CHECKS_WARN" -eq 0 ]; then
|
|
log_success "✅ All checks passed! Ready for deployment."
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo " 1. Review configuration files"
|
|
echo " 2. Run: ./scripts/deploy-besu-configs.sh --dry-run"
|
|
echo " 3. Deploy: ./scripts/deploy-besu-configs.sh"
|
|
exit 0
|
|
else
|
|
log_warn "⚠️ Ready with warnings (non-critical issues)"
|
|
echo ""
|
|
echo "You can proceed with deployment, but review warnings above."
|
|
exit 0
|
|
fi
|
|
else
|
|
log_error "❌ Not ready for deployment. Fix errors above first."
|
|
echo ""
|
|
echo "Required fixes:"
|
|
echo " - Fix all failed checks before deploying"
|
|
exit 1
|
|
fi
|