fix(ops): Proxmox SSH user for pool clear; optional preflight RPC override

- clear-all-transaction-pools: use PROXMOX_SSH_USER (never root@pam for SSH);
  align R630 host with ip-addresses PROXMOX_R630_01; document post-clear RPC delay
- preflight-chain138-deploy: CHAIN138_PREFLIGHT_RPC_URL for nonce/RPC checks when
  Core 2101 is restarting (e.g. after pool clear) but public RPC is up

Made-with: Cursor
This commit is contained in:
defiQUG
2026-04-01 11:46:20 -07:00
parent d81375117a
commit de1a274f6a
2 changed files with 17 additions and 4 deletions

View File

@@ -1,6 +1,10 @@
#!/usr/bin/env bash
# Clear transaction pools on all Besu nodes (RPC and Validators)
# This script clears transaction pool databases to remove stuck transactions
#
# SSH: uses PROXMOX_SSH_USER from config/ip-addresses.conf (root). If .env sets PROXMOX_USER=root@pam for the API,
# that value is NOT used for SSH (see PROXMOX_USER= assignment below).
# Afterward: Core RPC (2101) can take several minutes to bind JSON-RPC while RocksDB opens/compacts; public RPC may recover first.
set -euo pipefail
@@ -9,10 +13,12 @@ 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
PROXMOX_USER="${PROXMOX_USER:-root}"
PROXMOX_ML110="${PROXMOX_ML110:-192.168.11.10}"
PROXMOX_R630="${PROXMOX_R630:-192.168.11.11}"
# Shell SSH must be root@host — not root@pam@host (.env often sets PROXMOX_USER=root@pam for API).
PROXMOX_SSH_USER="${PROXMOX_SSH_USER:-root}"
[[ "$PROXMOX_SSH_USER" == *"@"* ]] && PROXMOX_SSH_USER="root"
PROXMOX_USER="$PROXMOX_SSH_USER"
PROXMOX_ML110="${PROXMOX_ML110:-${PROXMOX_HOST_ML110:-192.168.11.10}}"
PROXMOX_R630="${PROXMOX_R630:-${PROXMOX_R630_01:-${PROXMOX_HOST_R630_01:-192.168.11.11}}}"
# Colors
RED='\033[0;31m'

View File

@@ -4,6 +4,8 @@
#
# Usage: ./scripts/deployment/preflight-chain138-deploy.sh [--cost]
# --cost Also run cost estimate (smom-dbis-138/scripts/deployment/calculate-costs-consolidated.sh).
# Optional env: CHAIN138_PREFLIGHT_RPC_URL=https://... Same chainId 138; use when Core RPC (2101) is down briefly
# (e.g. after tx-pool clear / RocksDB WAL) and public RPC (e.g. 192.168.11.221:8545) is up. Deploy still use Core when healthy.
#
# Requires: run from repo root. Uses smom-dbis-138/.env only (PRIVATE_KEY, RPC_URL_138).
# See: docs/03-deployment/DEPLOYMENT_ORDER_OF_OPERATIONS.md § Deployment safety
@@ -54,6 +56,11 @@ else
fi
RPC="${RPC_URL_138:-http://192.168.11.211:8545}"
# Optional: same chain, different endpoint (e.g. public RPC 2201) when Core 2101 is restarting after pool maintenance.
if [[ -n "${CHAIN138_PREFLIGHT_RPC_URL:-}" ]]; then
RPC="$CHAIN138_PREFLIGHT_RPC_URL"
echo "NOTE: Using CHAIN138_PREFLIGHT_RPC_URL for this preflight only: $RPC" >&2
fi
if [[ -z "${PRIVATE_KEY:-}" ]]; then
echo "FAIL: PRIVATE_KEY not set in $SMOM/.env." >&2
exit 1