Skip to content

CirclesUBI/circles-payment-api

Repository files navigation

circles-payment-api

Proxy API for funding transactions with Gelato Relay and deploying safes with a funder account

Local Development

Installation

npm install

Set up .env file

For development environment:

cp .env.example .env

For staging environment:

cp .env.staging.example .env

Required env variables to run in Ganache:

NODE_ENV=development
FUNDER_ACCOUNT_PRIVATE_KEY=<funder-private-key>

Required env variables to run in real networks:

NODE_ENV=production
GELATO_RELAY_API_KEY=<gelato-api-key>
CHAIN_ID=<chain-id>

Run

npm start

This command starts a local development server and serves a Swagger UI at the /docs endpoint for documentation and example usage.

Test

For development environment:

npm test

For staging environment:

npm run test:staging

Using Gelato Relay

By default the service will use a common wallet for funding transactions unless the NODE_ENV environment variable value is set to production explicitly, then the Gelato Relay will be used instead. This is especially important for local development with Ganache network because of Gelato not supporting it.