Skip to main content

Running with Docker Compose

Sometimes it is nice to not rely on long docker commands. Running with Docker compose is very similar to using raw Docker and you can find a full specification of the format in the Docker docs.

This is an example docker-compose file for running a validator that should get you most of the way.

{
"chains": {
"ethereum": {
"customRpcUrls": "https://node1.com,https://node2.com,https://node3.com"
}
},
"originchainname": "ethereum",
"validator": {
"id": "alias/validator-signer-ethereum",
"type": "aws",
"region": "us-east-1"
},
"checkpointsyncer": {
"bucket": "signatures-ethereum",
"region": "us-east-1",
"type": "s3"
},
"reorgperiod": 1,
"interval": 30,
"metrics": "9090"
}
services:
ethereum-validator:
image: gcr.io/abacus-labs-dev/hyperlane-agent:3adc0e9-20240319-152359
command: ./validator
ports:
- "9090:9090/tcp"
environment:
CONFIG_FILES: /ethereum_validator.json
AWS_ACCESS_KEY_ID: somesecretkey
AWS_SECRET_ACCESS_KEY: somesecretkey
configs:
- ethereum_validator.json
configs:
ethereum_validator.json:
file: ./ethereum_validator.json

The above has a lot of filler values, you will of course need to update those with real ones.

You can also specify multiple services, so if you are running several validators, you can specify each one under services.

To run the compose configuration use docker compose up and docker compose down to clean up after. Full documentation on the command line can be found on the docker website.