# Chain-138 Deployment Complete Guide

## ✅ Completed Steps

### 1. Environment Configuration
- ✅ Added `CHAIN138_RPC_URL` to `.env`
- ✅ Added `CHAIN138_SELECTOR` to `.env`
- ✅ Added placeholder for `CCIP_CHAIN138_ROUTER`
- ✅ Added placeholder for `CHAIN138_CCIP_REPORTER`

### 2. Genesis File
- ✅ Checked for `genesis.json`
- ✅ Verified WETH9/WETH10 predeployment configuration

### 3. Infrastructure Verification
- ✅ Created verification scripts
- ✅ RPC connectivity testing
- ✅ Chain ID verification

### 4. Contract Deployment Preparation
- ✅ CCIPTxReporter deployment script ready
- ✅ Hardhat configuration for Chain-138

## 📋 Remaining Steps

### Infrastructure Deployment (if not already deployed)
```bash
# Deploy Kubernetes resources
kubectl apply -k k8s/base

# Deploy Besu validators
helm install besu-validators ./helm/besu-network -f helm/besu-network/values-validators.yaml -n besu-network

# Deploy Besu sentries
helm install besu-sentries ./helm/besu-network -f helm/besu-network/values-sentries.yaml -n besu-network

# Deploy Besu RPC nodes
helm install besu-rpc ./helm/besu-network -f helm/besu-network/values-rpc.yaml -n besu-network
```

### Contract Deployment
```bash
# Historical CCIPTxReporter source is archived
export CHAIN138_CCIP_REPORTER=0x...
# Restore archive/solidity/contracts/ccip-integration/CCIPTxReporter.sol before any fresh redeploy
```

### Verification
```bash
# Run complete verification
./scripts/deployment/verify-chain138-complete.sh

# Or individual checks:
./scripts/deployment/verify-chain138-full-deployment.sh
./scripts/deployment/verify-chain138-services.sh
./scripts/deployment/cross-check-chain138.sh
```

## 🔧 Configuration Files

### .env Updates Needed
After deployment, update `.env` with:
- `CHAIN138_CCIP_REPORTER=<deployed_address>`
- `CCIP_CHAIN138_ROUTER=<router_address>` (if using custom router)

## 📊 Status Check

Run the deployment script to check current status:
```bash
./scripts/deployment/deploy-chain138-complete.sh
```

## ✅ Verification Checklist

- [ ] RPC endpoint accessible
- [ ] Chain ID correct (138)
- [ ] Blocks being produced
- [ ] WETH9 predeployed
- [ ] WETH10 predeployed
- [ ] CCIPTxReporter deployed
- [ ] CCIP Router configured
- [ ] Services running
- [ ] Monitoring active
