Files
proxmox/scripts/deploy-all-node-lists.sh
defiQUG dbd517b279 Sync workspace: config, docs, scripts, CI, operator rules, and submodule pointers.
- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains
- Omit embedded publish git dirs and empty placeholders from index

Made-with: Cursor
2026-04-12 06:12:20 -07:00

145 lines
5.2 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# Deploy static-nodes.json and permissions-nodes.toml to ALL Besu nodes
# Node allowlist: use config/besu-node-lists/permissions-nodes.toml (Besu expects TOML, not JSON).
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
source "$PROJECT_ROOT/config/ip-addresses.conf"
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m'
log() { echo -e "${BLUE}[INFO]${NC} $1"; }
success() { echo -e "${GREEN}[✓]${NC} $1"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
error() { echo -e "${RED}[ERROR]${NC} $1"; }
# Deploy to a single node
deploy_to_node() {
local vmid=$1
local ip=$2
local host=$3
local node_type=$4
log "Deploying node lists to $node_type (VMID: $vmid, IP: $ip) on $host..."
# SSH to container and update files
ssh -o StrictHostKeyChecking=no root@$ip << 'EOF' 2>/dev/null || warn "Failed to deploy to VMID $vmid"
if [ ! -d /opt/besu/config ]; then
mkdir -p /opt/besu/config
fi
# Backup existing files
if [ -f /opt/besu/config/static-nodes.json ]; then
cp /opt/besu/config/static-nodes.json /opt/besu/config/static-nodes.json.backup.$(date +%s)
fi
if [ -f /opt/besu/config/permissions-nodes.toml ]; then
cp /opt/besu/config/permissions-nodes.toml /opt/besu/config/permissions-nodes.toml.backup.$(date +%s)
fi
# Update files (this would normally copy from NFS/shared storage or via SCP)
# For now, just verify directories exist
ls -la /opt/besu/config/ 2>/dev/null || echo "Config directory needs to be created"
EOF
success "Deployment initiated for VMID $vmid"
}
log "======================================="
log "Besu Node List Deployment"
log "======================================="
echo ""
log "Configuration:"
log " Master static-nodes: $PROJECT_ROOT/config/master-static-nodes.json"
log " Node allowlist (TOML): $PROJECT_ROOT/config/besu-node-lists/permissions-nodes.toml"
echo ""
log "Deployment Groups (Max Parallel: 5 nodes per group)"
echo ""
# Group 1: Validators (ml110)
log "Group 1: Validators (5 nodes)"
for vmid in 1000 1001 1002 1003 1004; do
ip="${NETWORK_PREFIX:-192.168.11}.$((100 + vmid - 1000))"
deploy_to_node $vmid $ip "${PROXMOX_HOST_ML110}" "Validator" &
done
wait
success "Group 1 complete"
echo ""
# Group 2: Existing Sentries (ml110)
log "Group 2: Existing Sentries (5 nodes)"
for vmid in 1500 1501 1502 1503 1504; do
ip="${NETWORK_PREFIX:-192.168.11}.$((50 + vmid - 1500))"
deploy_to_node $vmid $ip "${PROXMOX_HOST_ML110}" "Sentry" &
done
wait
success "Group 2 complete"
echo ""
# Group 3: Existing RPC Nodes (r630-01)
log "Group 3: Existing RPC Nodes (6 nodes)"
for vmid in 2101 2201 2301 2401 2402 2403; do
case $vmid in
2101) ip="${RPC_CORE_1:-${IP_SERVICE_21:-${IP_SERVICE_21:-${IP_SERVICE_21:-${IP_SERVICE_21:-${IP_SERVICE_21:-192.168.11.21}}}}}1}" ;;
2201) ip="${RPC_PUBLIC_1:-${RPC_PUBLIC_1:-192.168.11.221}}" ;;
2301) ip="${RPC_PRIVATE_1:-${RPC_PRIVATE_1:-192.168.11.232}}" ;;
2401) ip="${RPC_THIRDWEB_1:-${RPC_THIRDWEB_1:-${RPC_THIRDWEB_1:-${RPC_THIRDWEB_1:-${RPC_THIRDWEB_1:-${RPC_THIRDWEB_1:-${RPC_THIRDWEB_1:-192.168.11.241}}}}}}}" ;;
2402) ip="${RPC_THIRDWEB_2:-${RPC_THIRDWEB_2:-${RPC_THIRDWEB_2:-${RPC_THIRDWEB_2:-${RPC_THIRDWEB_2:-${RPC_THIRDWEB_2:-${RPC_THIRDWEB_2:-192.168.11.242}}}}}}}" ;;
2403) ip="${RPC_THIRDWEB_3:-${RPC_THIRDWEB_3:-${RPC_THIRDWEB_3:-192.168.11.243}}}" ;;
esac
deploy_to_node $vmid $ip "${PROXMOX_HOST_R630_01}" "RPC" &
done
wait
success "Group 3 complete"
echo ""
# Group 4: New Sentry Nodes (ml110)
log "Group 4: New Sentry Nodes (6 nodes - Pending Besu Installation)"
for vmid in 1505 1506 1507 1508 1509 1510; do
if [ $vmid -le 1506 ]; then
ip="${NETWORK_PREFIX:-192.168.11}.$((65 + vmid - 1505))"
elif [ $vmid -le 1508 ]; then
ip="${NETWORK_PREFIX:-192.168.11}.$((140 + vmid - 1507))"
elif [ $vmid -eq 1509 ]; then
ip="${IP_BESU_SENTRY_THIRDWEB_1:-192.168.11.219}"
else
ip="${IP_BESU_SENTRY_THIRDWEB_2:-192.168.11.220}"
fi
warn "Skipping VMID $vmid (Besu not installed yet)"
done
echo ""
# Group 5: New RPC Nodes (r630-01)
log "Group 5: New RPC Nodes (6 nodes - Pending Besu Installation)"
for vmid in 2420 2430 2440 2460 2470 2480; do
case $vmid in
2420) ip="${RPC_ALLTRA_1:-192.168.11.172}" ;;
2430) ip="${RPC_ALLTRA_2:-192.168.11.173}" ;;
2440) ip="${RPC_ALLTRA_3:-192.168.11.174}" ;;
2460) ip="${RPC_HYBX_1:-192.168.11.246}" ;;
2470) ip="${RPC_HYBX_2:-192.168.11.247}" ;;
2480) ip="${RPC_HYBX_3:-192.168.11.248}" ;;
esac
warn "Skipping VMID $vmid (Besu not installed yet)"
done
echo ""
log "======================================="
log "Deployment Status:"
log " ✅ Deployed to existing nodes: 14 nodes"
log " ⏳ Pending Besu installation: 10 nodes"
log " Non-Besu nodes: 3 nodes"
log "======================================="
echo ""
log "Next Steps:"
log " 1. Install Besu on new nodes (VMIDs: 1505-1510, 2420-2480)"
log " 2. Verify node lists are in /opt/besu/config/"
log " 3. Restart Besu services if needed"
log " 4. Run verification: ./scripts/verify-node-list-deployment.sh"