Deploy Relayer
This guide walks you through the process of deploying and configuring the Surge Relayer.
Deployment Steps
1. Clone Repository
First, clone the Surge Taiko Mono repository:
git clone https://github.com/NethermindEth/surge-taiko-mono.git
2. Configure Environment
Navigate to the relayer package and prepare the configuration:
cd surge-taiko-mono/packages/relayer
cp .default.env .env
Edit .env
, make sure L1_RPC_URL
and L2_RPC_URL
are set correctly.
3. Deploy Components
Deploy the relayer components in the following sequence:
- Initialize Components
- Run Migrations
- Start Relayer
docker compose --profile init up -d
This command starts the relayer database and queue services.
# Wait for services to be ready
sleep 20
# Run migrations
docker compose --profile migrations up
This step sets up the necessary database schema and initial configurations.
docker compose --profile l1 --profile l2 --profile api up -d
This starts the main relayer service.
Verification
After deployment, verify that:
- Database is properly initialized
- Migrations completed successfully
- Relayer service is running and connected to both L1 and L2
Component Health Checks
Monitor the health of your deployment:
# Check running containers
docker compose ps
# View logs of required relayer components, e.g. processor
docker logs relayer-l1-processor
# Check database status
docker compose logs db -f
Ensure all components are running before proceeding with any network operations. The relayer is a critical component for cross-layer communication.
Troubleshooting
If you encounter issues:
- Connection Issues
- Verify L1 and L2 RPC endpoints are accessible
- Check network connectivity
- Ensure all contract addresses are correct
- Database Issues
- Verify PostgreSQL is running
- Check migration logs for errors
- Ensure database credentials are correct
- Service Issues
- Check container logs for errors
- Verify all environment variables are set
- Ensure sufficient system resources
If you continue to experience issues, check the logs using:
docker compose logs --tail=100