Deploy Relayer
This guide walks you through deploying and configuring the Surge Relayer, a critical component responsible for cross-layer communication between L1 and L2 networks.
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: Checkout the Branch
Switch to the correct branch (surge/devnet
):
git checkout surge/devnet
Step 3: Environment Configuration
Navigate to the relayer package and set up your environment variables:
cd packages/relayer
cp .default.env .env
The .default.env
file contains default values for L1_RPC_URL
and L2_RPC_URL
based on the configuration steps completed earlier. These defaults are suitable for most setups, but feel free to update them to match your own environment if needed.
Step 4: Relayer Deployment
Deploy the relayer components in the following sequence:
- 1. Initialize Components
- 2. Run Database Migrations
- 3. Start the Relayer Service
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.
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.
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-deployment 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.