Files
proxmox/docs/07-ccip/CCIP_RELAY_DEPLOYMENT.md
defiQUG bea1903ac9
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Sync all local changes: docs, config, scripts, submodule refs, verification evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 15:46:06 -08:00

119 lines
4.4 KiB
Markdown

# CCIP Relay Service Deployment
**Last Updated:** 2026-02-12
**Status:** ✅ Deployed on Proxmox host r630-01
**Purpose:** Custom relay mechanism for delivering CCIP messages from Chain 138 to Ethereum Mainnet
---
## Overview
The CCIP Relay Service monitors `MessageSent` events on Chain 138 and relays messages to Ethereum Mainnet. It runs as a Node.js process on the Proxmox host r630-01.
### Deployment Summary
| Attribute | Value |
|-----------|-------|
| **Host** | r630-01 (192.168.11.11) |
| **Path** | `/opt/smom-dbis-138/services/relay` |
| **Chain 138 RPC** | `RPC_URL_138_PUBLIC` — VMID 2201 (192.168.11.221:8545, besu-rpc-public-1) |
| **Source** | `smom-dbis-138/services/relay` (in project) |
| **Start block** | `latest` (monitors from current block) |
### Architecture
1. **Chain 138 (Source):** Monitors CCIP Router `MessageSent` events via **RPC_URL_138_PUBLIC** (VMID 2201, 192.168.11.221:8545)
2. **Ethereum Mainnet (Destination):** Submits relay transactions via Infura or configured RPC
3. **Contracts:** CCIPRelayRouter + CCIPRelayBridge on mainnet; CCIP Router + WETH9 Bridge on Chain 138
---
## Configuration
### Required Environment
| Variable | Value | Notes |
|----------|-------|-------|
| `RPC_URL_138_PUBLIC` (or `RPC_URL_138`) | `http://192.168.11.221:8545` | Chain 138 **Public** RPC — VMID 2201 (relay reads RPC_URL_138_PUBLIC first) |
| `RPC_URL_MAINNET` | Infura or `ETHEREUM_MAINNET_RPC` | From smom-dbis-138/.env |
| `PRIVATE_KEY` | Relayer private key | Needs ETH on mainnet for gas |
| `START_BLOCK` | `latest` | Avoids RPC range limit errors |
| `CCIP_ROUTER_CHAIN138` | 0x42DAb7b888Dd382bD5Adcf9E038dBF1fD03b4817 | Chain 138 router |
| `CCIP_RELAY_ROUTER_MAINNET` | 0xAd9A228CcEB4cbB612cD165FFB72fE090ff10Afb | Mainnet relay router |
| `CCIP_RELAY_BRIDGE_MAINNET` | 0xF9A32F37099c582D28b4dE7Fca6eaC1e5259f939 | Mainnet relay bridge |
**Important:** Use `START_BLOCK=latest` to avoid "Requested range exceeds maximum RPC range limit" from Besu when querying `eth_getLogs`. Use `.env.local` with expanded `PRIVATE_KEY` if `${PRIVATE_KEY}` is used in `.env`.
---
## Operational Commands
### Start Relay
```bash
ssh root@192.168.11.11
cd /opt/smom-dbis-138/services/relay
nohup ./start-relay.sh >> relay-service.log 2>&1 &
```
### View Logs
```bash
ssh root@192.168.11.11 "tail -f /opt/smom-dbis-138/services/relay/relay-service.log"
```
### Check Status
```bash
ssh root@192.168.11.11 "pgrep -af 'node index.js' | grep relay; tail -30 /opt/smom-dbis-138/services/relay/relay-service.log"
```
### Restart
```bash
ssh root@192.168.11.11 "pkill -f 'node index.js' 2>/dev/null; sleep 2; cd /opt/smom-dbis-138/services/relay && nohup ./start-relay.sh >> relay-service.log 2>&1 &"
```
---
## Deployment (from project root)
### Sync and deploy to Proxmox host
```bash
# Create directory
ssh root@192.168.11.11 "mkdir -p /opt/smom-dbis-138/services/relay /opt/smom-dbis-138"
# Sync relay service (excludes node_modules)
rsync -avz --exclude='node_modules' \
smom-dbis-138/services/relay/ \
root@192.168.11.11:/opt/smom-dbis-138/services/relay/
# Sync parent .env for PRIVATE_KEY
scp smom-dbis-138/.env root@192.168.11.11:/opt/smom-dbis-138/.env
# Install and start
ssh root@192.168.11.11 "cd /opt/smom-dbis-138/services/relay && npm install && nohup ./start-relay.sh >> relay-service.log 2>&1 &"
```
---
## Troubleshooting
| Issue | Solution |
|-------|----------|
| `EHOSTUNREACH 192.168.11.250` | Set `RPC_URL_138_PUBLIC=http://192.168.11.221:8545` (VMID 2201) in `.env` or `.env.local` |
| `Requested range exceeds maximum RPC range limit` | Set `START_BLOCK=latest` in `.env` or `.env.local` |
| `PRIVATE_KEY required` | Ensure `smom-dbis-138/.env` has `PRIVATE_KEY` or use `.env.local` with expanded key |
| Messages not relaying | Check relayer has ETH on mainnet; verify bridge WETH9 balance; see [DEPLOYMENT_GUIDE.md](../../smom-dbis-138/services/relay/DEPLOYMENT_GUIDE.md) |
---
## Related Documentation
- **[CCIP_DEPLOYMENT_SPEC.md](CCIP_DEPLOYMENT_SPEC.md)** - CCIP fleet deployment
- **[CCIP_BRIDGE_MAINNET_CONNECTION.md](CCIP_BRIDGE_MAINNET_CONNECTION.md)** - Bridge/mainnet connection
- **[OPERATIONAL_RUNBOOKS.md](../03-deployment/OPERATIONAL_RUNBOOKS.md#ccip-operations)** - CCIP operations runbook
- **[RPC_ENDPOINTS_MASTER.md](../04-configuration/RPC_ENDPOINTS_MASTER.md)** - RPC endpoints (VMID 2201)
- **Source:** [smom-dbis-138/services/relay/](../../smom-dbis-138/services/relay/) - Code and DEPLOYMENT_GUIDE.md