Deploy Relayer
This guide walks you through the process of deploying and configuring the Surge Relayer.
Prerequisites
Before you begin, make sure you have the following contract addresses and endpoints:
L1 Requirements
- L1_BRIDGE
- L1_ERC20_VAULT
- L1_ERC721_VAULT
- L1_ERC1155_VAULT
- L1_TAIKO
- L1_SIGNAL_SERVICE
- L1 RPC URL
L2 Requirements
- L2_BRIDGE
- L2_ERC20_VAULT
- L2_ERC721_VAULT
- L2_ERC1155_VAULT
- L2_TAIKO
- L2_SIGNAL_SERVICE
- L2 RPC URL
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
Update the docker-compose.yml
file with your specific RPC URLs and other required configuration values.
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 relayer 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 relayer logs
docker compose logs relayer -f
# 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