This guide demonstrates how to configure and use the OpenZeppelin Relayer service with metrics monitoring. In this example, we configure and utilize an Ethereum Sepolia Relayer integrated with Prometheus and Grafana for comprehensive performance tracking.
- Docker
- Docker Compose
- Rust (for key generation tools)
Clone this repository to your local machine:
git clone https://github.com/OpenZeppelin/openzeppelin-relayer
cd openzeppelin-relayerCreate a new signer keystore using the provided key generation tool:
cargo run --example create_key -- \
--password <DEFINE_YOUR_PASSWORD> \
--output-dir examples/basic-example-metrics/config/keys \
--filename local-signer.jsonNote: Replace <DEFINE_YOUR_PASSWORD> with a strong password for the keystore.
Create examples/basic-example-metrics/.env file from examples/basic-example-metrics/.env.example.
cp examples/basic-example-metrics/.env.example examples/basic-example-metrics/.envThen, update the KEYSTORE_PASSPHRASE field in the examples/basic-example-metrics/.env file with the password you used.
examples/basic-example-metrics/config/config.json file is partially pre-configured. You need to specify the webhook URL that will receive updates from the relayer service.
For simplicity, visit Webhook.site, copy your unique URL, and then update the notifications[0].url field in examples/basic-example-metrics/config/config.json with this value.
To sign webhook notification payloads, populate the WEBHOOK_SIGNING_KEY entry in the examples/basic-example-metrics/.env file.
For development purposes, you can generate the signing key using:
cargo run --example generate_uuidNote: Alternatively, you can use any online UUID generator.
Copy the generated UUID and update the WEBHOOK_SIGNING_KEY entry in the examples/basic-example-metrics/.env file.
To sign webhook notification payloads, populate the WEBHOOK_SIGNING_KEY entry in the examples/basic-example/.env file.
For development purposes, you can generate the signing key using:
cargo run --example generate_uuidNote: Alternatively, you can use any online UUID generator.
Copy the generated UUID and update the WEBHOOK_SIGNING_KEY entry in the examples/basic-example/.env file.
Generate an API key signing key for development purposes using:
cargo run --example generate_uuidNote: Alternatively, you can use any online UUID generator.
Copy the generated UUID and update the API_KEY entry in the examples/basic-example-metrics/.env file.
Start the service with Docker Compose:
docker compose -f examples/basic-example-metrics/docker-compose.yaml upThe service is available at http://localhost:8080/api/v1
curl -X GET http://localhost:8080/api/v1/relayers \
-H "Content-Type: application/json" \
-H "AUTHORIZATION: Bearer YOUR_API_KEY"- Prometheus is available at: http://localhost:9090
- Grafana is available at: http://localhost:3000
The default Grafana login credentials are:
- Username: admin
- Password: admin
A pre-configured dashboard for OpenZeppelin Relayer metrics is available in Grafana under "Dashboards" → "General" → "OpenZeppelin Relayer Dashboard".