Files
proxmox/scripts/create-all-chain138-containers-direct.sh
defiQUG cb47cce074 Complete markdown files cleanup and organization
- Organized 252 files across project
- Root directory: 187 → 2 files (98.9% reduction)
- Moved configuration guides to docs/04-configuration/
- Moved troubleshooting guides to docs/09-troubleshooting/
- Moved quick start guides to docs/01-getting-started/
- Moved reports to reports/ directory
- Archived temporary files
- Generated comprehensive reports and documentation
- Created maintenance scripts and guides

All files organized according to established standards.
2026-01-06 01:46:25 -08:00

99 lines
3.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Direct container creation script for ChainID 138
# Creates all 13 missing containers with correct specifications
set -euo pipefail
PROXMOX_HOST="${PROXMOX_HOST:-192.168.11.10}"
TEMPLATE="local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst"
STORAGE="local-lvm"
NETWORK="vmbr0"
GATEWAY="192.168.11.1"
# 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"; }
# Check if container exists
exists() {
local vmid=$1
ssh -o StrictHostKeyChecking=no root@${PROXMOX_HOST} "pct list | grep -q '^$vmid ' && echo 'yes' || echo 'no'"
}
# Create container
create() {
local vmid=$1
local hostname=$2
local ip=$3
local mem=$4
local cores=$5
local disk=$6
local desc="$7"
if [[ "$(exists $vmid)" == "yes" ]]; then
warn "Container $vmid already exists, skipping..."
return 0
fi
log "Creating $vmid: $hostname ($ip) - ${mem}GB RAM, ${cores} cores, ${disk}GB disk..."
ssh -o StrictHostKeyChecking=no root@${PROXMOX_HOST} <<EOF
pct create $vmid $TEMPLATE \
--hostname $hostname \
--memory $((mem * 1024)) \
--cores $cores \
--rootfs $STORAGE:${disk} \
--net0 name=eth0,bridge=$NETWORK,ip=$ip/24,gw=$GATEWAY \
--description "$desc" \
--start 1 \
--onboot 1 \
--unprivileged 0 2>&1 | grep -v "WARNING: Ignoring duplicate" || true
EOF
if [[ "$(exists $vmid)" == "yes" ]]; then
success "Container $vmid created successfully"
return 0
else
error "Failed to create container $vmid"
return 1
fi
}
log "Creating ChainID 138 containers on $PROXMOX_HOST..."
echo ""
# Besu Sentry
create 1504 "besu-sentry-5" "192.168.11.154" 4 2 100 "Besu Sentry Node - Ali's dedicated host"
# Besu RPC Nodes
create 2503 "besu-rpc-4" "192.168.11.253" 16 4 200 "Besu RPC Node - Ali (0x8a identity)"
create 2504 "besu-rpc-4" "192.168.11.254" 16 4 200 "Besu RPC Node - Ali (0x1 identity)"
create 2505 "besu-rpc-luis" "192.168.11.255" 16 4 200 "Besu RPC Node - Luis (0x8a identity)"
create 2506 "besu-rpc-luis" "192.168.11.256" 16 4 200 "Besu RPC Node - Luis (0x1 identity)"
create 2507 "besu-rpc-putu" "192.168.11.257" 16 4 200 "Besu RPC Node - Putu (0x8a identity)"
create 2508 "besu-rpc-putu" "192.168.11.258" 16 4 200 "Besu RPC Node - Putu (0x1 identity)"
# Hyperledger Services
create 6200 "firefly-1" "192.168.11.66" 4 2 50 "Hyperledger Firefly Core"
create 6201 "firefly-2" "192.168.11.67" 4 2 50 "Hyperledger Firefly Node - ChainID 138"
create 5200 "cacti-1" "192.168.11.64" 4 2 50 "Hyperledger Cacti"
create 6000 "fabric-1" "192.168.11.65" 8 4 100 "Hyperledger Fabric"
create 6400 "indy-1" "192.168.11.68" 8 4 100 "Hyperledger Indy"
# Explorer
create 5000 "blockscout-1" "192.168.11.69" 8 4 200 "Blockscout Explorer - ChainID 138"
echo ""
log "Container creation complete!"
log "Checking final status..."
ssh -o StrictHostKeyChecking=no root@${PROXMOX_HOST} "pct list | grep -E '(1504|2503|2504|2505|2506|2507|2508|6200|6201|5200|6000|6400|5000)' | sort -n"