diff --git a/scripts/clear-all-transaction-pools.sh b/scripts/clear-all-transaction-pools.sh index ee21175..ca9cf50 100755 --- a/scripts/clear-all-transaction-pools.sh +++ b/scripts/clear-all-transaction-pools.sh @@ -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' diff --git a/scripts/deployment/preflight-chain138-deploy.sh b/scripts/deployment/preflight-chain138-deploy.sh index e85ce82..fa3159b 100755 --- a/scripts/deployment/preflight-chain138-deploy.sh +++ b/scripts/deployment/preflight-chain138-deploy.sh @@ -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