# Genesis File Deployment Status

## Current Status

### Upload to Azure Storage
✅ **Success** - Genesis file uploaded to Azure Storage container `genesis`

### Deployment to VMs
⏳ **In Progress** - Azure Run Command is experiencing "Bad Request" errors

## Issues Encountered

1. **SSH Key Not Configured**: The Nginx proxy cannot SSH to backend VMs (Permission denied)
2. **Azure Run Command Failures**: All attempts to use `az vm run-command invoke` are returning "Bad Request" errors
3. **Genesis File Still Missing**: The genesis file on VMs is still the old error XML (223 bytes)

## Solutions Attempted

1. ✅ **Direct SSH from Nginx proxy** - Failed: SSH keys not configured
2. ✅ **Azure Run Command with base64** - Failed: Bad Request errors
3. ✅ **Azure Run Command with simple curl** - Failed: Bad Request errors
4. ✅ **Azure Storage upload** - Success: File uploaded successfully

## Next Steps

### Option 1: Configure SSH Keys
Set up SSH key forwarding or copy SSH keys to Nginx proxy to enable direct SSH access to backend VMs.

### Option 2: Use Azure Storage with Managed Identity
Configure VMs with Managed Identity and download genesis file using Azure Storage SDK or `az storage blob download`.

### Option 3: Manual Deployment
Manually SSH into each VM and copy the genesis file.

### Option 4: Fix Azure Run Command
Investigate why Azure Run Command is failing (VM state, permissions, service issues).

## Current Genesis File Location

- **Azure Storage**: `https://azpcusdiagde00c5.blob.core.windows.net/genesis/genesis-138.json`
- **SAS Token**: Generated (valid for 1 hour)
- **VM Location**: `/opt/besu/config/genesis.json` (currently contains error XML)

## Verification Commands

```bash
# Check genesis file on VM
az vm run-command invoke \
  --resource-group az-p-cus-rg-comp-001 \
  --name az-p-cus-vm-besu-node-0 \
  --command-id RunShellScript \
  --scripts "ls -lh /opt/besu/config/genesis.json && wc -c /opt/besu/config/genesis.json"

# Download from storage (if VM has curl)
curl -s "https://azpcusdiagde00c5.blob.core.windows.net/genesis/genesis-138.json?<SAS_TOKEN>" \
  -o /opt/besu/config/genesis.json
```

---

**Last Updated**: After multiple deployment attempts

