The Safe Gelato Relay Service is a web service which allows relaying transactions via the Gelato Relay Service.
This allows for an entity to sponsor on-chain transactions on behalf of the user, allowing them to submit Safe transactions without the need to have a wallet with funds. Fee collection can happen via other means but it is currently not covered.
Development images are currently being published to Docker Hub.
- Node 18 (LTS) – https://nodejs.org/en/
- Gelato's 1Balance API key – https://docs.gelato.network/developer-services/relay/payment-and-fees/1balance#production
corepack enable && yarn install
Before running the service you need to set up a Gelato API Key – https://docs.gelato.network/developer-services/relay/payment-and-fees/1balance#production. This can be added via an environment variable in the local environment where you are executing the service:
Currently three chains are supported: Goerli (chainId=5), Gnosis Chain (chainId=100) and Sepolia (chainId=11155111).
# To configure Goerli
export GELATO_GOERLI_API_KEY=<GOERLI_GELATO_API_KEY>
# To configure Gnosis Chain
export GELATO_GNOSIS_CHAIN_API_KEY=<GNOSIS_GELATO_API_KEY>
# To configure Sepolia
export GELATO_SEPOLIA_API_KEY=<SEPOLIA_GELATO_API_KEY>
All the chains can be configured simultaneously.
With the API keys configured, to run the service locally:
yarn run start
The service will then be listening for requests under $APPLICATION_PORT
. If $APPLICATION_PORT
was not set, the default
port is 3000
.
Other execution modes are available for local development:
# Run in watch mode (live-reload)
yarn run start:dev
# Run in debug mode (if you want to attach a debugger)
yarn run start:debug
# Launch the service without the NestJS CLI (production target)
yarn run start:prod
If you want to execute the tests for the service, you can execute the following:
yarn run test
Additionally, if you want the test coverage to be generated, you can execute the following:
yarn run test:cov
By default, the coverage results will be under <PROJ_FOLDER>/coverage/
.
We use ESLint as a linter and Prettier as a code formatter.
You can run yarn run lint
to execute ESLint and yarn run format
to execute Prettier.
These checks can be automatically executed using Git hooks. If you wish to install the provided git hooks:
yarn install
yarn husky install