# Bridge Operations Runbook

**Purpose**: Step-by-step procedures for common bridge operations

---

## 🔄 Bridge Transfer Procedure

### Standard Transfer

1. **Check System Status**
   ```bash
   bash scripts/health-check.sh
   ```

2. **Verify Balances**
   ```bash
   bash scripts/check-bridge-status.sh
   ```

3. **Estimate Fees**
   ```bash
   bash scripts/fee-management.sh estimate
   ```

4. **Execute Transfer**
   ```bash
   bash scripts/bridge-with-dynamic-gas.sh weth9 1.0 bsc
   ```

5. **Monitor Transfer**
   ```bash
   bash scripts/monitor-bridge-transfers.sh <transaction_hash>
   ```

---

## 🚨 Emergency Procedures

### Pause Bridge Operations

1. **Access Bridge Contract**
   ```bash
   cast send <BRIDGE_ADDRESS> "pause()" --rpc-url $RPC_URL --private-key $PRIVATE_KEY
   ```

2. **Verify Pause**
   ```bash
   cast call <BRIDGE_ADDRESS> "paused()" --rpc-url $RPC_URL
   ```

3. **Resume Operations**
   ```bash
   cast send <BRIDGE_ADDRESS> "unpause()" --rpc-url $RPC_URL --private-key $PRIVATE_KEY
   ```

---

## 🔧 Troubleshooting

### Transaction Stuck

1. **Check Transaction Status**
   ```bash
   cast tx <transaction_hash> --rpc-url $RPC_URL
   ```

2. **Retry with Higher Gas**
   ```bash
   bash scripts/retry-failed-transactions.sh
   ```

3. **Check Nonce**
   ```bash
   cast nonce <address> --rpc-url $RPC_URL
   ```

### Low Balance

1. **Check Balances**
   ```bash
   bash scripts/check-bridge-status.sh
   ```

2. **Add Funds**
   - Transfer ETH to deployer address
   - Transfer LINK tokens if needed

### RPC Issues

1. **Test RPC Connectivity**
   ```bash
   cast block-number --rpc-url $RPC_URL
   ```

2. **Check RPC Health**
   ```bash
   bash scripts/health-check.sh
   ```

---

## 📊 Monitoring

### Daily Checks

```bash
# Run automated monitoring
bash scripts/automated-monitoring.sh

# Generate daily report
bash scripts/generate-bridge-report.sh daily
```

### Weekly Review

```bash
# Generate weekly report
bash scripts/generate-bridge-report.sh weekly

# Run test suite
bash scripts/test-suite.sh all
```

---

**Last Updated**: $(date)

