5.4 KiB
Besu Deployment Fixes Applied
This document describes all the fixes applied to resolve deployment issues with Besu containers.
Issues Fixed
1. IP Address Configuration ✅
Problem: Containers were using DHCP and getting assigned IP addresses from 10.3.1.X/24 range instead of the intended 192.168.11.X/24 range.
Solution:
- Created
scripts/fix-container-ips.shto configure static IP addresses on existing containers - Updated
config/network.confto use192.168.11.Xsubnet instead of10.3.1.X - Updated
scripts/deployment/deploy-besu-nodes.shto use static IP configuration instead of DHCP
IP Address Mapping:
- Validators:
192.168.11.100-104(VMID 1000-1004) - Sentries:
192.168.11.150-153(VMID 1500-1503) - RPC Nodes:
192.168.11.250-252(VMID 2500-2502)
Usage:
# Fix IP addresses on existing containers
./scripts/fix-container-ips.sh
2. Service Management ✅
Problem: Besu services may not be enabled or running on containers.
Solution:
- Created
scripts/fix-besu-services.shto:- Check service status on all containers
- Enable services if not enabled
- Start services if not running
- Validate service health (checking ports)
- Verify configuration files exist before starting services
Usage:
# Fix and start all Besu services
./scripts/fix-besu-services.sh
3. Configuration Validation ✅
Problem: Need to ensure all configuration files are correctly placed and formatted.
Solution:
- Created
scripts/validate-besu-config.shto validate:genesis.jsonexists and is valid JSON- Configuration files (config-validator.toml, config-sentry.toml, config-rpc-*.toml) exist
- Validator keys exist and are properly formatted
- Key file permissions are secure (600 or 400)
- Address files contain valid Ethereum addresses
- Directory ownership is correct (besu:besu)
nodekeyfiles are correct size (32 bytes)permissions-nodes.tomlandstatic-nodes.jsonexist
Usage:
# Validate all Besu configurations
./scripts/validate-besu-config.sh
4. Master Fix Script ✅
Problem: Multiple fixes need to be applied in the correct order.
Solution:
- Created
scripts/fix-all-besu.shas a master script that:- Fixes container IP addresses
- Copies missing configuration files (if source project available)
- Validates configuration files
- Fixes and starts services
Usage:
# Run all fixes in sequence
./scripts/fix-all-besu.sh
Files Modified
Configuration Files
config/network.conf- Updated subnet from10.3.1.Xto192.168.11.X
Deployment Scripts
scripts/deployment/deploy-besu-nodes.sh- Updated to use static IP configuration instead of DHCP
New Scripts Created
scripts/fix-container-ips.sh- Fixes IP addresses on existing containersscripts/fix-besu-services.sh- Ensures services are enabled and runningscripts/validate-besu-config.sh- Validates all Besu configuration filesscripts/fix-all-besu.sh- Master script to run all fixes
Configuration File Locations
All Besu configuration files should be in the following locations:
On Containers
- genesis.json:
/etc/besu/genesis.json - Config files:
/etc/besu/config-validator.toml,/etc/besu/config-sentry.toml,/etc/besu/config-rpc-*.toml - Permissions:
/etc/besu/permissions-nodes.toml,/etc/besu/permissions-accounts.toml - Static nodes:
/etc/besu/static-nodes.json - Validator keys:
/keys/validators/validator-*/(validators only) - Nodekey:
/data/besu/nodekey(auto-generated if not provided)
Next Steps
After running the fix scripts:
-
Verify IP addresses:
pct exec <vmid> -- ip addr show eth0 -
Check service status:
pct exec <vmid> -- systemctl status besu-validator pct exec <vmid> -- systemctl status besu-sentry pct exec <vmid> -- systemctl status besu-rpc -
View service logs:
pct exec <vmid> -- journalctl -u besu-validator -f -
Test connectivity:
pct exec <vmid> -- ping -c 3 192.168.11.1 -
Update static-nodes.json with actual enodes if needed:
./scripts/network/bootstrap-network.sh
Troubleshooting
IP Address Not Changed
If IP address didn't change after running fix-container-ips.sh:
- Ensure container is stopped:
pct stop <vmid> - Manually update:
pct set <vmid> --net0 "bridge=vmbr0,name=eth0,ip=192.168.11.X/24,gw=192.168.11.1,type=veth" - Start container:
pct start <vmid>
Service Won't Start
- Check logs:
pct exec <vmid> -- journalctl -u besu-<type> -n 50 - Verify configuration files exist
- Check file permissions and ownership
- Ensure genesis.json is valid JSON
Configuration Validation Errors
- Run
copy-besu-config-with-nodes.shto copy missing files - Check source project directory structure
- Verify key files exist and are readable
Network Configuration
Gateway
- IP:
192.168.11.1 - Subnet:
192.168.11.0/24 - Bridge:
vmbr0(default)
DNS Servers
- Primary:
8.8.8.8 - Secondary:
8.8.4.4
Service Configuration
Besu Services
- besu-validator: Validator nodes (VMID 1000-1004)
- besu-sentry: Sentry nodes (VMID 1500-1503)
- besu-rpc: RPC nodes (VMID 2500-2502)
All services are:
- Enabled to start on boot
- Configured to restart on failure
- Running as
besu:besuuser - Using appropriate memory limits (configured in service files)