# SMOM-DBIS-138 Project Integration Guide

## Overview

The SMOM-DBIS-138 project is located at `~/projects/smom-dbis-138` and contains the actual blockchain network configuration, contracts, and deployment scripts. This guide explains how to integrate the deployed VMs with the SMOM-DBIS-138 project.

## Project Locations

- **Sankofa Project**: `~/projects/Sankofa` (VM deployment and infrastructure)
- **SMOM-DBIS-138 Project**: `~/projects/smom-dbis-138` (Blockchain network and contracts)

## SMOM-DBIS-138 Project Structure

```
~/projects/smom-dbis-138/
├── scripts/              # Deployment and configuration scripts
├── contracts/           # Smart contracts
├── config/              # Network configuration
├── terraform/           # Infrastructure as code
├── runbooks/            # Operational procedures
├── Makefile             # Main build/deploy commands
└── README.md            # Project documentation
```

## Integration Steps

### 1. Get VM IP Addresses

From the Sankofa project, get all VM IP addresses:

```bash
cd ~/projects/Sankofa

# Get all VM IPs
for vm in nginx-proxy-vm cloudflare-tunnel-vm \
  smom-validator-01 smom-validator-02 smom-validator-03 smom-validator-04 \
  smom-sentry-01 smom-sentry-02 smom-sentry-03 smom-sentry-04 \
  smom-rpc-node-01 smom-rpc-node-02 smom-rpc-node-03 smom-rpc-node-04 \
  smom-services smom-blockscout smom-monitoring smom-management; do
  ip=$(kubectl get proxmoxvm $vm -n default -o jsonpath='{.status.ipAddress}' 2>/dev/null)
  echo "$vm=$ip"
done > /tmp/smom-vm-ips.txt
```

### 2. Update SMOM-DBIS-138 Configuration

Copy VM IPs to SMOM-DBIS-138 project:

```bash
# Copy IPs to SMOM-DBIS-138 project
cp /tmp/smom-vm-ips.txt ~/projects/smom-dbis-138/config/vm-ips.txt

# Or update .env file
cd ~/projects/smom-dbis-138
# Edit .env with VM IPs
```

### 3. Configure Validators

```bash
cd ~/projects/smom-dbis-138

# Use Makefile commands to configure validators
make help  # See available commands

# Example: Deploy validators
# make deploy-validators
```

### 4. Configure Sentries

```bash
cd ~/projects/smom-dbis-138

# Configure sentry nodes
# make deploy-sentries
```

### 5. Configure RPC Nodes

```bash
cd ~/projects/smom-dbis-138

# Configure RPC nodes
# make deploy-rpc-nodes
```

## VM to Component Mapping

### Infrastructure VMs
- **nginx-proxy-vm** → Nginx reverse proxy for SSL/TLS termination
- **cloudflare-tunnel-vm** → Cloudflare Tunnel for public access

### Application VMs
- **smom-validator-01 to 04** → Hyperledger Besu validator nodes
- **smom-sentry-01 to 04** → Sentry nodes (protect validators)
- **smom-rpc-node-01 to 04** → RPC endpoint nodes
- **smom-services** → Application services
- **smom-blockscout** → Blockscout blockchain explorer
- **smom-monitoring** → Prometheus/Grafana monitoring
- **smom-management** → Management and operational tools

## Configuration Files

### SMOM-DBIS-138 Project Files
- `~/projects/smom-dbis-138/config/` - Network configuration
- `~/projects/smom-dbis-138/scripts/` - Deployment scripts
- `~/projects/smom-dbis-138/.env` - Environment variables

### Sankofa Project Files
- `~/projects/Sankofa/examples/production/smom-dbis-138/` - VM manifests
- `~/projects/Sankofa/docs/smom-dbis-138-*.md` - Deployment documentation

## Deployment Workflow

### Phase 1: VM Deployment (Sankofa Project)
```bash
cd ~/projects/Sankofa
kubectl apply -f examples/production/smom-dbis-138/
```

### Phase 2: Network Configuration (SMOM-DBIS-138 Project)
```bash
cd ~/projects/smom-dbis-138
# Update configuration with VM IPs
# Run deployment scripts
make deploy
```

### Phase 3: Verification
```bash
cd ~/projects/Sankofa
./scripts/verify-deployment.sh

cd ~/projects/smom-dbis-138
# Run verification scripts
make verify
```

## Useful Commands

### Get VM Status
```bash
cd ~/projects/Sankofa
kubectl get proxmoxvm -A
```

### SSH to VMs
```bash
# Get IP first
ip=$(kubectl get proxmoxvm smom-validator-01 -n default -o jsonpath='{.status.ipAddress}')

# SSH
ssh admin@$ip
```

### View SMOM-DBIS-138 Documentation
```bash
cd ~/projects/smom-dbis-138
cat README.md
```

## Next Steps

1. **Wait for VMs to be running** (check with `./scripts/verify-deployment.sh`)
2. **Get VM IP addresses** and update SMOM-DBIS-138 configuration
3. **Follow SMOM-DBIS-138 deployment guide** in that project
4. **Configure infrastructure** (Nginx, Cloudflare Tunnel)
5. **Deploy blockchain network** using SMOM-DBIS-138 scripts

## References

- **SMOM-DBIS-138 Project**: `~/projects/smom-dbis-138`
- **Sankofa Deployment Docs**: `~/projects/Sankofa/docs/smom-dbis-138-*.md`
- **SMOM-DBIS-138 README**: `~/projects/smom-dbis-138/README.md`

---

**Last Updated**: 2025-12-08

