# Deployment Options

This document describes the different deployment options available for the SMOM-DBIS-138 Besu network.

## Deployment Methods

### 1. LXC Containers (Standard Deployment)

**Description**: Deploys each Besu node in its own LXC container on Proxmox VE.

**Advantages**:
- Resource isolation per node
- Individual scaling and management
- Production-ready architecture
- Better security isolation
- Easier monitoring per node

**Disadvantages**:
- Longer deployment time (~30-45 minutes)
- More complex initial setup
- Requires more Proxmox resources upfront

**Usage**:
```bash
cd /opt/smom-dbis-138-proxmox
sudo ./deploy-all.sh
# Or specifically:
sudo DEPLOY_BESU=true DEPLOY_BESU_TEMP_VM=false ./deploy-all.sh
```

**VMIDs**:
- Validators: 1000-1004
- Sentries: 1500-1503
- RPC Nodes: 2500-2502

### 2. Temporary VM (Quick Deployment)

**Description**: Deploys all Besu nodes in a single VM using Docker containers.

**Advantages**:
- Faster deployment (~15-30 minutes)
- Easier initial testing and validation
- Single point of management
- Lower resource overhead initially
- Easy migration path to LXC later

**Disadvantages**:
- All nodes share VM resources
- Less isolation between nodes
- Not ideal for production long-term
- Single point of failure for all nodes

**Usage**:
```bash
cd /opt/smom-dbis-138-proxmox
sudo DEPLOY_BESU=true DEPLOY_BESU_TEMP_VM=true ./deploy-all.sh
# Or use the dedicated script:
sudo ./scripts/deployment/deploy-besu-temp-vm-complete.sh /opt/smom-dbis-138
```

**VMID**: 9000

**VM Specifications**:
- Memory: 32GB
- CPU: 8 cores
- Disk: 500GB
- IP: 192.168.11.90

## Comparison

| Feature | LXC Containers | Temporary VM |
|---------|----------------|--------------|
| Deployment Time | 30-45 min | 15-30 min |
| Resource Isolation | High | Low |
| Scalability | Individual | Shared |
| Management | Per container | Single VM |
| Production Ready | Yes | No (temporary) |
| Migration Path | N/A | To LXC available |

## When to Use Each Method

### Use LXC Containers When:
- ✅ Production deployment
- ✅ Need resource isolation
- ✅ Individual node scaling required
- ✅ Long-term deployment
- ✅ Maximum security needed

### Use Temporary VM When:
- ✅ Quick testing and validation
- ✅ Development environment
- ✅ Proof of concept
- ✅ Limited initial resources
- ✅ Planning to migrate to LXC later

## Migration Path

You can start with the temporary VM and migrate to LXC containers later:

```bash
# 1. Deploy temporary VM
sudo ./scripts/deployment/deploy-besu-temp-vm-complete.sh /opt/smom-dbis-138

# 2. Test and validate
./scripts/validation/validate-besu-temp-vm.sh

# 3. When ready, deploy LXC containers
sudo ./scripts/deployment/deploy-besu-nodes.sh

# 4. Migrate data
sudo ./scripts/migration/migrate-vm-to-lxc.sh /opt/smom-dbis-138

# 5. Verify and start services
for vmid in 1000 1001 1002 1003 1004; do
    pct exec $vmid -- systemctl start besu-validator
done

# 6. Shut down temporary VM
qm stop 9000
```

## Remote Deployment

### Deploy Temporary VM on ml110

From your local machine:

```bash
cd /home/intlc/projects/proxmox
./scripts/deploy-besu-temp-vm-on-ml110.sh
```

This will:
1. Connect to ml110 (192.168.11.10)
2. Run the complete temporary VM deployment
3. Set up all 12 Besu containers
4. Validate the deployment

## Configuration

Both deployment methods use the same configuration files:
- `config/proxmox.conf` - Proxmox connection settings
- `config/network.conf` - Network configuration
- Source project: `/opt/smom-dbis-138` - Keys and genesis files

## Documentation

- [Temporary VM Deployment Guide](TEMP_VM_DEPLOYMENT.md)
- [Temporary VM Quick Start](TEMP_VM_QUICK_START.md)
- [Standard LXC Deployment](DEPLOYMENT_STEPS_COMPLETE.md)
- [Migration Guide](MIGRATION.md)

