Files
proxmox/scripts/lib/vmid-ip-maps.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

67 lines
3.1 KiB
Bash

#!/usr/bin/env bash
# Shared VMID → IP mapping for Chain 138 / Proxmox
# Exports: VMID_VALIDATORS, VMID_SENTRIES, VMID_RPC, VMID_CURRENT_NODES,
# RPC_NODES, VALIDATOR_NODES, SENTRY_NODES, CURRENT_NODES, RPC_URL_138_DEFAULT
# Usage: source "${PROJECT_ROOT}/scripts/lib/vmid-ip-maps.sh"
# Resolve paths if not set
[[ -z "${PROJECT_ROOT:-}" ]] && PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
[[ -f "${PROJECT_ROOT}/config/ip-addresses.conf" ]] && source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
# Validators (1000-1004)
declare -gA VMID_VALIDATORS=(
["1000"]="${IP_VALIDATOR_0:-192.168.11.100}"
["1001"]="${IP_VALIDATOR_1:-192.168.11.101}"
["1002"]="${IP_VALIDATOR_2:-192.168.11.102}"
["1003"]="${IP_VALIDATOR_3:-192.168.11.103}"
["1004"]="${IP_VALIDATOR_4:-192.168.11.104}"
)
# Sentries (1500-1503)
declare -gA VMID_SENTRIES=(
["1500"]="${IP_BESU_RPC_0:-192.168.11.150}"
["1501"]="${IP_BESU_RPC_1:-192.168.11.151}"
["1502"]="${IP_BESU_RPC_2:-192.168.11.152}"
["1503"]="${IP_BESU_RPC_3:-192.168.11.153}"
)
# RPC nodes (current active)
# 2101: admin/deployment; 2201: bridge, monitoring, public-facing (8545 HTTP, 8546 WS) — FIXED PERMANENT
declare -gA VMID_RPC=(
["2101"]="${RPC_CORE_1:-192.168.11.211}"
["2201"]="${RPC_PUBLIC_1:-192.168.11.221}"
["2400"]="${RPC_THIRDWEB_PRIMARY:-192.168.11.240}"
["2401"]="${RPC_THIRDWEB_1:-192.168.11.241}"
["2402"]="${RPC_THIRDWEB_2:-192.168.11.242}"
["2500"]="${RPC_ALLTRA_1:-192.168.11.250}"
["2501"]="${RPC_ALI_1:-192.168.11.251}"
["2502"]="${RPC_ALI_2:-192.168.11.252}"
["2503"]="${RPC_ALI_1_ALT:-192.168.11.253}"
["2504"]="${RPC_ALI_2_ALT:-192.168.11.254}"
["2505"]="${IP_VAULT_PHOENIX_2:-192.168.11.201}"
["2506"]="${IP_SERVICE_202:-192.168.11.202}"
["2507"]="${IP_SERVICE_203:-192.168.11.203}"
["2508"]="${IP_SERVICE_204:-192.168.11.204}"
)
# Combined current nodes (validators + sentries + rpc)
declare -gA VMID_CURRENT_NODES=()
for k in "${!VMID_VALIDATORS[@]}"; do VMID_CURRENT_NODES["$k"]="${VMID_VALIDATORS[$k]}"; done
for k in "${!VMID_SENTRIES[@]}"; do VMID_CURRENT_NODES["$k"]="${VMID_SENTRIES[$k]}"; done
for k in "${!VMID_RPC[@]}"; do VMID_CURRENT_NODES["$k"]="${VMID_RPC[$k]}"; done
# Aliases for backward compatibility
declare -gA RPC_NODES=()
declare -gA VALIDATOR_NODES=()
declare -gA SENTRY_NODES=()
declare -gA CURRENT_NODES=()
for k in "${!VMID_RPC[@]}"; do RPC_NODES["$k"]="${VMID_RPC[$k]}"; done
for k in "${!VMID_VALIDATORS[@]}"; do VALIDATOR_NODES["$k"]="${VMID_VALIDATORS[$k]}"; done
for k in "${!VMID_SENTRIES[@]}"; do SENTRY_NODES["$k"]="${VMID_SENTRIES[$k]}"; done
for k in "${!VMID_CURRENT_NODES[@]}"; do CURRENT_NODES["$k"]="${VMID_CURRENT_NODES[$k]}"; done
# Default RPC URL (admin: RPC_URL_138; public/bridge: RPC_URL_138_PUBLIC)
RPC_URL_138_DEFAULT="${RPC_URL_138:-http://${RPC_CORE_1:-192.168.11.211}:8545}"
RPC_URL_138_PUBLIC_DEFAULT="${RPC_URL_138_PUBLIC:-http://${RPC_PUBLIC_1:-192.168.11.221}:8545}"
WS_URL_138_PUBLIC_DEFAULT="${WS_URL_138_PUBLIC:-ws://${RPC_PUBLIC_1:-192.168.11.221}:8546}"