Files
proxmox/scripts/recreate-ct-2301.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- 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>
2026-02-12 15:46:57 -08:00

36 lines
1.5 KiB
Bash

#!/usr/bin/env bash
# Recreate CT 2301 (besu-rpc-private-1) after corrupted rootfs
# Uses config - no hardcoded IPs. Destroys and recreates - DATA LOSS.
# Version: 2026-01-31
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/lib/load-project-env.sh"
VMID=2301
PROXMOX_HOST="$(get_host_for_vmid "$VMID")"
SSH_OPTS="-o ConnectTimeout=30 -o ServerAliveInterval=60 -o ServerAliveCountMax=3"
# Config validation (gateway defaults to 192.168.11.1 per config/ip-addresses.conf)
IP="${RPC_PRIVATE_1:-}"
GATEWAY="${NETWORK_GATEWAY:-192.168.11.1}"
[[ -z "$IP" ]] && err_exit "RPC_PRIVATE_1 not set (source config/ip-addresses.conf)"
TEMPLATE="${TEMPLATE:-local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst}"
STORAGE="${STORAGE:-local-lvm}"
NETWORK="${NETWORK:-vmbr0}"
echo "=== Recreate CT 2301 (besu-rpc-private-1) ==="
echo "Host: $PROXMOX_HOST | IP: $IP"
echo "WARNING: This DESTROYS the container and all data."
[[ "${1:-}" != "--yes" ]] && { read -p "Type 'yes' to proceed: " r; [[ "$r" != "yes" ]] && exit 1; }
echo "Destroying CT $VMID..."
ssh $SSH_OPTS root@"$PROXMOX_HOST" "pct destroy $VMID --purge 1" 2>/dev/null || true
echo "Creating new CT $VMID..."
ssh $SSH_OPTS root@"$PROXMOX_HOST" "pct create $VMID $TEMPLATE --hostname besu-rpc-private-1 --memory 16384 --cores 4 --rootfs $STORAGE:200 --net0 name=eth0,bridge=$NETWORK,ip=$IP/24,gw=$GATEWAY --description 'Besu RPC Private Node' --start 1 --onboot 1 --unprivileged 0"
echo "Done. Next: install Besu and config (copy from 2101/2201)."