Relayer Service

The bridge between Ethereum and Sui.

What It Does

The relayer is like a translator between blockchains:

  • Watches for new swaps on both chains

  • Helps coordinate the swap process

  • Makes sure both sides complete

  • Earns fees for providing this service

How It Works

Ethereum event → Relayer sees it → Creates Sui transaction → Swap completes

Step by step:

  1. User creates swap on Ethereum

  2. Relayer detects the event

  3. Relayer creates matching swap on Sui

  4. Relayer manages the secret coordination

  5. Both users get their tokens

Running a Relayer

Why run one:

  • Earn fees from helping swaps

  • Support the Mesh network

  • Learn cross-chain technology

What you need:

  • Server running 24/7

  • Tokens for gas fees

  • Technical setup knowledge

Costs vs rewards:

  • Pay gas fees on both chains

  • Earn from price differences

  • Volume determines profit

Setup Guide

1. Install and configure

cd relayer
npm install
cp env.example .env
# Edit .env with your settings

2. Configure environment

# Ethereum
ETHEREUM_RPC_URL=https://yourethrpcurl
ETHEREUM_PRIVATE_KEY=your_private_key

# Sui
SUI_RPC_URL=https://yoursuirpcurl
SUI_PRIVATE_KEY=your_sui_private_key

# Contract addresses
ETHEREUM_RESOLVER_ADDRESS=0x123...
SUI_PACKAGE_ID=0xabc...

3. Start relayer

npm start

Monitoring

Check it's working:

  • Look at console logs

  • Monitor token balances

  • Watch for successful swaps

Key metrics:

  • Swaps completed per hour

  • Profit per swap

  • Gas costs vs earnings

Security

Relayers are safe because:

  • Can't steal user funds

  • Smart contracts enforce rules

  • Everything happens on public blockchains

Protect yourself:

  • Monitor for unusual activity

  • Set gas price limits

  • Keep most funds in cold storage

  • Use secure servers

Troubleshooting

Relayer won't start:

  • Check environment variables

  • Verify private keys

  • Test network connections

No swaps being filled:

  • Check token balances

  • Verify contract addresses

  • Look for other relayers competing

Transactions failing:

  • Increase gas limits

  • Check network congestion

  • Verify contract state

Last updated