# Etherlink Relay Service

Custom relay for **Etherlink** (chain 42793) when CCIP does not support Etherlink. Receives messages (e.g. from source chain bridge events) and calls `EtherlinkRelayReceiver.relayMintOrUnlock(messageId, token, recipient, amount)` on Etherlink.

## Env

- `ETHERLINK_RELAY_BRIDGE` – EtherlinkRelayReceiver contract on Etherlink
- `ETHERLINK_RPC_URL` – Etherlink RPC
- `ETHERLINK_RELAY_PRIVATE_KEY` or `PRIVATE_KEY` – relayer key (RELAYER_ROLE on receiver)
- `ETHERLINK_RELAY_MAX_CONCURRENT` – max in-flight submissions (default 5)
- `ETHERLINK_RELAY_QUEUE_DEPTH` – max queue depth (default 100)
- `POLL_INTERVAL_MS` – queue process interval (default 5000)

## Run

```bash
npm install && npm start
```

Messages are pushed via `service.pushMessage(messageId, token, recipient, amount)`; wire this to your source-chain event monitor.

## Metrics

In-memory metrics: `etherlink_relay_messages_detected_total`, `etherlink_relay_submissions_success_total`, `etherlink_relay_submissions_failed_total`, `etherlink_relay_queue_depth`.

## Runbook

See [ETHERLINK_RELAY_RUNBOOK](../../docs/bridge/ETHERLINK_RELAY_RUNBOOK.md).
