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>
98 lines
3.3 KiB
Bash
Executable File
98 lines
3.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Complete deployment and fix for Blockscout Explorer
|
|
# This script deploys Blockscout if needed, then fixes all configuration issues
|
|
# Usage: ./deploy-and-fix-blockscout.sh [VMID] [IP]
|
|
# Defaults: VMID=5000, IP=${IP_BLOCKSCOUT:-${IP_DEVICE_14:-${IP_DEVICE_14:-${IP_DEVICE_14:-192.168.11.14}}}0}
|
|
|
|
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
|
|
|
|
|
|
VMID="${1:-5000}"
|
|
IP="${2:-${IP_DEVICE_14:-${IP_DEVICE_14:-${IP_DEVICE_14:-192.168.11.14}}}0}"
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
# Colors
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
CYAN='\033[0;36m'
|
|
NC='\033[0m'
|
|
|
|
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"; }
|
|
log_section() { echo -e "${CYAN}════════════════════════════════════════${NC}"; }
|
|
|
|
PROXMOX_HOST="${PROXMOX_HOST:-192.168.11.10}"
|
|
|
|
log_section
|
|
log_info "Blockscout Explorer - Complete Deployment and Fix"
|
|
log_info "VMID: $VMID"
|
|
log_info "IP: $IP"
|
|
log_section
|
|
echo ""
|
|
|
|
# Check if container exists
|
|
log_section
|
|
log_info "Checking if container exists..."
|
|
log_section
|
|
|
|
CONTAINER_EXISTS=$(ssh -o StrictHostKeyChecking=no root@"$PROXMOX_HOST" "pct list | grep -E '^\s*$VMID\s' >/dev/null 2>&1 && echo 'yes' || echo 'no'")
|
|
|
|
if [ "$CONTAINER_EXISTS" = "no" ]; then
|
|
log_warn "Container $VMID does not exist. Deploying..."
|
|
|
|
# Check if we're on the Proxmox host or remote
|
|
if command -v pct >/dev/null 2>&1; then
|
|
log_info "Running on Proxmox host - deploying directly..."
|
|
DEPLOY_SCRIPT="$PROJECT_ROOT/smom-dbis-138-proxmox/scripts/deployment/deploy-explorer.sh"
|
|
if [ -f "$DEPLOY_SCRIPT" ]; then
|
|
# Source config if available
|
|
if [ -f "$PROJECT_ROOT/smom-dbis-138-proxmox/config/proxmox.conf" ]; then
|
|
source "$PROJECT_ROOT/smom-dbis-138-proxmox/config/proxmox.conf" || true
|
|
fi
|
|
export VMID_EXPLORER_START="$VMID"
|
|
export PUBLIC_SUBNET="${PUBLIC_SUBNET:-192.168.11}"
|
|
bash "$DEPLOY_SCRIPT" || {
|
|
log_error "Deployment failed"
|
|
exit 1
|
|
}
|
|
else
|
|
log_error "Deployment script not found: $DEPLOY_SCRIPT"
|
|
exit 1
|
|
fi
|
|
else
|
|
log_warn "Not running on Proxmox host. Please deploy manually:"
|
|
log_info ""
|
|
log_info " ssh root@$PROXMOX_HOST"
|
|
log_info " cd /home/intlc/projects/proxmox/smom-dbis-138-proxmox/scripts/deployment"
|
|
log_info " export VMID_EXPLORER_START=$VMID"
|
|
log_info " export PUBLIC_SUBNET=192.168.11"
|
|
log_info " ./deploy-explorer.sh"
|
|
log_info ""
|
|
log_info "After deployment, run this script again to configure."
|
|
exit 1
|
|
fi
|
|
|
|
log_success "Container deployed. Waiting 10 seconds for it to start..."
|
|
sleep 10
|
|
else
|
|
log_success "Container already exists"
|
|
fi
|
|
|
|
# Now run the fix script
|
|
log_section
|
|
log_info "Running fix script..."
|
|
log_section
|
|
|
|
"$SCRIPT_DIR/fix-blockscout-explorer.sh" "$VMID" "$IP"
|
|
|