2026-03-02 11:37:34 -08:00
|
|
|
#!/usr/bin/env bash
|
2026-02-12 15:46:57 -08:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
# Standalone script to update validator transaction pool configuration
|
|
|
|
|
# Can be copied to Proxmox host and executed there
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
VMIDS_ML110="1003 1004"
|
|
|
|
|
VMIDS_R630="1000 1001 1002"
|
|
|
|
|
|
|
|
|
|
TXPOOL_CONFIG="# Transaction Pool Configuration
|
|
|
|
|
tx-pool-max-size=8192
|
|
|
|
|
tx-pool-limit-by-account-percentage=0.5
|
|
|
|
|
tx-pool-price-bump=10"
|
|
|
|
|
|
|
|
|
|
echo "=== Updating Validator Transaction Pool Configuration ==="
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
update_validator() {
|
|
|
|
|
local VMID=$1
|
|
|
|
|
local CONFIG_FILE="/etc/besu/config-validator.toml"
|
|
|
|
|
|
|
|
|
|
echo "--- Updating Validator $VMID ---"
|
|
|
|
|
|
|
|
|
|
# Check if config exists
|
|
|
|
|
if [ ! -f "$CONFIG_FILE" ]; then
|
|
|
|
|
echo " ⚠️ Config file not found at $CONFIG_FILE"
|
|
|
|
|
return 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Check if settings already exist
|
|
|
|
|
if grep -q "tx-pool-max-size" "$CONFIG_FILE" 2>/dev/null; then
|
|
|
|
|
echo " ✅ Transaction pool settings already exist"
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Add settings after Transaction Pool comment
|
|
|
|
|
if grep -q "# Transaction Pool" "$CONFIG_FILE"; then
|
|
|
|
|
sed -i "/# Transaction Pool/a\\$TXPOOL_CONFIG" "$CONFIG_FILE"
|
|
|
|
|
echo " ✅ Configuration updated"
|
|
|
|
|
else
|
|
|
|
|
# Append to end of file
|
|
|
|
|
echo "" >> "$CONFIG_FILE"
|
|
|
|
|
echo "$TXPOOL_CONFIG" >> "$CONFIG_FILE"
|
|
|
|
|
echo " ✅ Configuration appended"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
restart_validator() {
|
|
|
|
|
local VMID=$1
|
|
|
|
|
echo " Restarting validator service..."
|
|
|
|
|
systemctl restart besu-validator && \
|
|
|
|
|
echo " ✅ Validator service restarted" || \
|
|
|
|
|
echo " ⚠️ Could not restart service"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# For ml110 validators
|
|
|
|
|
if [ -n "$VMIDS_ML110" ]; then
|
|
|
|
|
for VMID in $VMIDS_ML110; do
|
|
|
|
|
pct exec $VMID -- bash -c "$(declare -f update_validator restart_validator); update_validator $VMID; restart_validator $VMID"
|
|
|
|
|
echo ""
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# For r630 validators (if on this host)
|
|
|
|
|
if [ -n "$VMIDS_R630" ]; then
|
|
|
|
|
for VMID in $VMIDS_R630; do
|
|
|
|
|
if pct list | grep -q "^$VMID"; then
|
|
|
|
|
pct exec $VMID -- bash -c "$(declare -f update_validator restart_validator); update_validator $VMID; restart_validator $VMID"
|
|
|
|
|
echo ""
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "=== Update Complete ==="
|