Run Relayer
This guide is fairly similar to the Deploy Relayer guide. The main difference is that this guide is focused on running the components of the Surge rollup on the Hoodi testnet, while the other one is for the devnet.
The Relayer is a key component that facilitates cross-layer communication between Layer 1 and Layer 2, such as submitting proofs or syncing finalized state. It ensures that Surge’s L2 state transitions are correctly reflected and verified on L1.
This guide walks you through running and configuring the Surge Relayer.
To understand how the Relayer fits into the broader system, check the Surge Architecture documentation.
Step 1: Clone the Repository
Clone the Surge Taiko Mono repository to your local environment and navigate into it:
git clone https://github.com/NethermindEth/surge-taiko-mono.git
cd surge-taiko-mono/
Step 2: Navigate to the Relayer Directory
cd packages/relayer
Step 3: Environment Configuration
Create your environment configuration file (.env
) by copying the provided sample:
cp .env.hoodi .env
Make sure to update .env
to match your environment such as updating L1_RPC_URL
and L2_RPC_URL
to your own node URLs.
Step 4: Relayer Launch
Launch the relayer components in the following sequence:
Step 1: Initialize Components
Run the command to start necessary services:
docker compose --profile init up -d
This starts essential services such as the relayer database and queue.
Step 2: Run Database Migrations
Allow some time (20 seconds recommended) for services to initialize, then execute migrations:
# Wait for services to initialize
sleep 20
# Execute migrations
docker compose --profile migrations up
This step establishes your database schema and initial configurations required by the relayer.
Step 3: Start Relayer Service
Launch the main relayer services, connecting both L1 and L2:
docker compose --profile l1 --profile l2 --profile api up -d
This will activate the relayer service along with API interfaces.
Verification
Post-launch verification steps:
- Ensure the database initialization succeeded.
- Confirm database migrations completed without errors.
- Validate the relayer is running and properly connected to L1 and L2.
Health Checks
Use the following commands to verify component health:
# List running containers
docker compose ps
# View logs for specific components, e.g., L1 processor
docker logs relayer-l1-processor
# Monitor database logs
docker compose logs db -f --tail=100
# Review migration logs for errors.
docker compose logs migrations
Ensure all relayer components are fully operational before proceeding with network operations. The relayer is a critical component for cross-layer communication.