# SMOM-DBIS-138 Proxmox Deployment - Summary

This package provides complete Proxmox VE LXC container deployment for the SMOM-DBIS-138 blockchain network.

## ✅ What's Included

### Core Infrastructure
- ✅ **Besu Validator Nodes** - QBFT consensus nodes (4+ containers)
- ✅ **Besu Sentry Nodes** - P2P relay nodes (3-5 containers)
- ✅ **Besu RPC Nodes** - Public RPC endpoints (3-5 containers)
- ✅ **Network Configuration** - VLAN separation and IP management
- ✅ **Auto-Configuration** - Automatic static-nodes.json generation

### Deployment Automation
- ✅ **Main Deployment Script** - `deploy-all.sh` orchestrates everything
- ✅ **Node Deployment** - Automated container creation and Besu installation
- ✅ **Configuration Management** - Centralized config sync
- ✅ **Inventory Management** - Auto-generated container inventory

### Maintenance & Operations
- ✅ **Rolling Upgrades** - Zero-downtime Besu version upgrades
- ✅ **Backup System** - Automated snapshots and backups
- ✅ **Restore Capability** - Easy rollback from snapshots
- ✅ **Network Updates** - Dynamic static-nodes.json updates

### Documentation
- ✅ **Quick Start Guide** - Get started in minutes
- ✅ **Deployment Guide** - Comprehensive deployment instructions
- ✅ **Configuration Examples** - Pre-configured templates
- ✅ **Troubleshooting** - Common issues and solutions

## 📁 File Structure

```
smom-dbis-138-proxmox/
├── README.md                      # Main documentation
├── SUMMARY.md                     # This file
├── setup.sh                       # Quick setup script
├── config/
│   ├── proxmox.conf.example      # Proxmox connection config
│   ├── network.conf.example      # Network configuration
│   └── inventory.example         # Container inventory template
├── scripts/
│   ├── deployment/
│   │   ├── deploy-all.sh         # Main orchestration
│   │   └── deploy-besu-nodes.sh  # Besu nodes deployment
│   ├── upgrade/
│   │   ├── upgrade-all.sh        # Rolling upgrades
│   │   └── upgrade-node.sh       # Single node upgrade
│   ├── backup/
│   │   └── backup-all.sh         # Full backup
│   └── network/
│       └── update-static-nodes.sh # Network config updates
├── install/
│   ├── besu-validator-install.sh # Validator installation
│   ├── besu-sentry-install.sh    # Sentry installation
│   └── besu-rpc-install.sh       # RPC installation
├── lib/
│   ├── common.sh                 # Common utilities
│   └── proxmox-api.sh            # Proxmox API wrapper
└── docs/
    ├── DEPLOYMENT.md             # Full deployment guide
    └── QUICK_START.md            # Quick start guide
```

## 🚀 Quick Start

1. **Copy to Proxmox host**
   ```bash
   scp -r smom-dbis-138-proxmox root@proxmox-host:/opt/
   ```

2. **Run setup**
   ```bash
   cd /opt/smom-dbis-138-proxmox
   ./setup.sh
   ```

3. **Configure**
   ```bash
   nano config/proxmox.conf  # Set Proxmox connection details
   ```

4. **Deploy**
   ```bash
   ./scripts/deployment/deploy-all.sh
   ```

5. **Copy project files**
   - Copy genesis.json and configs from smom-dbis-138 project
   - Copy validator keys
   - Update static-nodes.json
   - Start services

See [QUICK_START.md](docs/QUICK_START.md) for detailed steps.

## 🔧 Features

### ✅ Maintains All Connections
- **P2P Network**: Automatic peer discovery and static node configuration
- **Static Nodes**: Auto-generated enode list with correct IPs
- **Metrics**: Prometheus scrape targets automatically configured
- **Service Discovery**: Internal hostname resolution

### ✅ Upgradeability
- **Rolling Upgrades**: Upgrade nodes one at a time (zero downtime)
- **Version Management**: Easy version tracking and rollback
- **Configuration Migration**: Automatic config format updates
- **Data Preservation**: Blockchain state maintained during upgrades

### ✅ Production Ready
- **Resource Management**: Configurable CPU, memory, disk limits
- **Network Isolation**: VLAN separation for security
- **Backup System**: Automated snapshots and backups
- **Monitoring Ready**: Metrics endpoints exposed
- **Log Management**: Centralized logging with journald

## 📊 Resource Requirements

Per deployment (defaults):
- **Validators**: 4 nodes × (8GB RAM, 4 cores, 100GB disk)
- **Sentries**: 3 nodes × (4GB RAM, 2 cores, 100GB disk)
- **RPC Nodes**: 3 nodes × (16GB RAM, 4 cores, 200GB disk)

**Total**: ~76GB RAM, ~24 cores, ~1.3TB disk

## 🔒 Security Features

- **Network Isolation**: VLAN separation between node types
- **Container Security**: Unprivileged containers where possible
- **Firewall Ready**: Network rules configured
- **Key Management**: Secure key storage and rotation
- **Access Control**: SSH key-based access

## 📝 Configuration

All configuration is done through config files:
- `config/proxmox.conf` - Proxmox connection and resources
- `config/network.conf` - Network topology and IPs
- `config/inventory.conf` - Auto-generated container inventory

## 🔄 Upgrade Path

1. **Upgrade all nodes**
   ```bash
   ./scripts/upgrade/upgrade-all.sh 24.1.0
   ```

2. **Upgrade single node**
   ```bash
   ./scripts/upgrade/upgrade-node.sh 100 24.1.0
   ```

3. **Rollback if needed**
   ```bash
   pct rollback 100 <snapshot-name>
   ```

## 💾 Backup & Restore

**Create backup:**
```bash
./scripts/backup/backup-all.sh
```

**Restore from snapshot:**
```bash
pct listsnapshot 100
pct rollback 100 <snapshot-name>
```

## 📚 Documentation

- [README.md](/docs/01-getting-started/README.md) - Overview and architecture
- [QUICK_START.md](docs/QUICK_START.md) - Get started quickly
- [DEPLOYMENT.md](docs/DEPLOYMENT.md) - Complete deployment guide
- [SUMMARY.md](SUMMARY.md) - This file

## 🎯 Next Steps

After deployment:
1. ✅ Copy genesis.json and configuration files
2. ✅ Copy validator keys
3. ✅ Update static-nodes.json
4. ✅ Start Besu services
5. ✅ Verify network connectivity
6. ✅ Monitor logs and metrics
7. ✅ Set up monitoring stack (optional)
8. ✅ Deploy services (oracle, CCIP monitor) - optional

## 🆘 Support

For issues:
1. Check logs in `logs/` directory
2. Review [DEPLOYMENT.md](docs/DEPLOYMENT.md)
3. Check container status: `pct status <vmid>`
4. View service logs: `pct exec <vmid> -- journalctl -u besu-*`

## 📄 License

Part of the smom-dbis-138 project - same license applies.

