Files
proxmox/scripts/comprehensive-project-update.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

162 lines
5.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Comprehensive Project Update Script
# Updates all files to ensure consistency with current standards
set -euo pipefail
# Load IP configuration
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
PROJECT_ROOT="/home/intlc/projects/proxmox"
PROXMOX_PROJECT="$PROJECT_ROOT/smom-dbis-138-proxmox"
echo "=== Comprehensive Project Update ==="
echo ""
echo "This script will:"
echo " 1. Verify VMID consistency (1000-1004, 1500-1503, 2500-2502)"
echo " 2. Check for outdated IP addresses (10.3.1.X should be ${NETWORK_PREFIX:-192.168.11}.X)"
echo " 3. Verify Besu documentation references"
echo " 4. Check for old VMID references (106-122)"
echo ""
cd "$PROJECT_ROOT"
# Expected values
EXPECTED_VALIDATOR_COUNT=5
EXPECTED_VALIDATOR_RANGE="1000-1004"
EXPECTED_SENTRY_COUNT=4
EXPECTED_SENTRY_RANGE="1500-1503"
EXPECTED_RPC_COUNT=3
EXPECTED_RPC_RANGE="2500-2502"
EXPECTED_SUBNET="192.168.11"
OLD_SUBNET="10.3.1"
EXPECTED_GATEWAY="${NETWORK_GATEWAY:-192.168.11.1}"
errors=0
warnings=0
echo "=== 1. Checking VMID Ranges ==="
echo ""
# Check proxmox.conf for correct VMID ranges
if grep -q "VALIDATOR_COUNT=5" "$PROXMOX_PROJECT/config/proxmox.conf" 2>/dev/null; then
echo " ✅ VALIDATOR_COUNT=5 in proxmox.conf"
else
echo " ⚠️ VALIDATOR_COUNT not set to 5 in proxmox.conf"
warnings=$((warnings + 1))
fi
if grep -q "SENTRY_COUNT=4" "$PROXMOX_PROJECT/config/proxmox.conf" 2>/dev/null; then
echo " ✅ SENTRY_COUNT=4 in proxmox.conf"
else
echo " ⚠️ SENTRY_COUNT not set to 4 in proxmox.conf"
warnings=$((warnings + 1))
fi
if grep -q "RPC_COUNT=3" "$PROXMOX_PROJECT/config/proxmox.conf" 2>/dev/null; then
echo " ✅ RPC_COUNT=3 in proxmox.conf"
else
echo " ⚠️ RPC_COUNT not set to 3 in proxmox.conf"
warnings=$((warnings + 1))
fi
echo ""
echo "=== 2. Checking IP Address References ==="
echo ""
# Check for old IP subnet
old_ips=$(grep -rE "\b10\.3\.1\." "$PROXMOX_PROJECT" \
--include="*.sh" --include="*.md" --include="*.conf" \
2>/dev/null | grep -v ".git" | grep -v "node_modules" | wc -l)
if [[ $old_ips -gt 0 ]]; then
echo " ⚠️ Found $old_ips references to old IP subnet (10.3.1.X)"
echo " These should be updated to ${NETWORK_PREFIX:-192.168.11}.X"
warnings=$((warnings + old_ips))
else
echo " ✅ No old IP subnet references found"
fi
# Check network.conf for correct gateway
if grep -q "GATEWAY=\"$EXPECTED_GATEWAY\"" "$PROXMOX_PROJECT/config/network.conf" 2>/dev/null; then
echo " ✅ Gateway correctly set to $EXPECTED_GATEWAY"
else
echo " ⚠️ Gateway may not be set to $EXPECTED_GATEWAY in network.conf"
warnings=$((warnings + 1))
fi
echo ""
echo "=== 3. Checking Besu Documentation References ==="
echo ""
# Check for generic Besu documentation references
besu_docs=$(grep -rE "Besu.*[Dd]ocumentation|besu.*docs" "$PROXMOX_PROJECT" \
--include="*.md" \
2>/dev/null | grep -v "besu.hyperledger.org" | grep -v "github.com/hyperledger/besu" | wc -l)
if [[ $besu_docs -gt 0 ]]; then
echo " ⚠️ Found $besu_docs generic Besu documentation references"
echo " Should reference https://besu.hyperledger.org or https://github.com/hyperledger/besu"
warnings=$((warnings + besu_docs))
else
echo " ✅ All Besu documentation references include official links"
fi
echo ""
echo "=== 4. Checking for Old VMID References ==="
echo ""
# Check for old VMID ranges (106-122)
old_vmids=$(grep -rE "\b(106|107|108|109|110|111|112|115|116|117|120|121|122)\b" "$PROXMOX_PROJECT" \
--include="*.sh" --include="*.md" --include="*.conf" \
2>/dev/null | grep -v ".git" | grep -v "node_modules" | \
grep -v "1006\|1107\|2106" | grep -v "COMMENT\|#.*old" | wc -l)
if [[ $old_vmids -gt 0 ]]; then
echo " ⚠️ Found $old_vmids potential old VMID references"
echo " These should be reviewed to ensure they're not active references"
warnings=$((warnings + old_vmids))
else
echo " ✅ No old VMID references found (or all are commented/contextual)"
fi
echo ""
echo "=== 5. Checking Validator Key Count ==="
echo ""
SOURCE_PROJECT="${SOURCE_PROJECT:-../smom-dbis-138}"
if [[ -d "$SOURCE_PROJECT/keys/validators" ]]; then
key_count=$(find "$SOURCE_PROJECT/keys/validators" -mindepth 1 -maxdepth 1 -type d 2>/dev/null | wc -l)
if [[ $key_count -eq $EXPECTED_VALIDATOR_COUNT ]]; then
echo " ✅ Validator key count matches: $key_count"
else
echo " ⚠️ Validator key count mismatch: found $key_count, expected $EXPECTED_VALIDATOR_COUNT"
warnings=$((warnings + 1))
fi
else
echo " ⚠️ Source project keys directory not found"
warnings=$((warnings + 1))
fi
echo ""
echo "=== Summary ==="
echo ""
echo "Errors: $errors"
echo "Warnings: $warnings"
echo ""
if [[ $errors -eq 0 && $warnings -eq 0 ]]; then
echo "✅ Project appears to be fully updated and consistent!"
exit 0
elif [[ $errors -eq 0 ]]; then
echo "⚠️ Some warnings found - review recommended"
exit 0
else
echo "❌ Errors found - fix required"
exit 1
fi