This guide demonstrates how to configure and use the OpenZeppelin Relayer service with a basic setup. In this example, we configure and utilize an Ethereum Sepolia Relayer.
- 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/config/keys \
--filename local-signer.jsonNote: Replace <DEFINE_YOUR_PASSWORD> with a strong password for the keystore.
Create examples/basic-example/.env file from examples/basic-example/.env.example.
cp examples/basic-example/.env.example examples/basic-example/.envThen, update the KEYSTORE_PASSPHRASE field in the examples/basic-example/.env file with the password you used.
examples/basic-example/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/config/config.json with this value.
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/.env file.
Start the service with Docker Compose:
docker compose -f examples/basic-example/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"