Please refer to Offchain relayer service documentation for more information.
- Node.js version 20.0.0.
- pnpm package manager.
- rapidsnark program.
- (Optional) Redis database if you want to use the scheduler module.
- Please note that the build process might fail in a Windows environment. If you are using Windows, it is recommended to use Windows Subsystem for Linux (WSL) or a virtual machine with a Linux distribution.
- Install dependencies and build the project
pnpm install
pnpm run build-
Install Redis database (if the scheduler module is going to be used) using the official guide
-
Download the zkeys
pnpm run download-zkeys:test
# for production zkeys
# pnpm run download-zkeys:ceremony- Move to the coordinator service directory
cd apps/coordinator- Generate the RSA key pair to encrypt values throughout the communication workflow
pnpm run generate-keypair- Setup .env file (see
.env.examplefor reference)
cp .env.example .env- Run the NestJS application
pnpm run start
# or
pnpm run start:prodRemember to run it from the monorepo root directory.
# Build docker
docker compose -f apps/coordinator/docker-compose.yml build
# Run container detached
docker compose -f apps/coordinator/docker-compose.yml up -d
# Enter the container
docker compose -f apps/coordinator/docker-compose.yml exec coordinator-service /bin/sh
# Stop container
docker compose -f apps/coordinator/docker-compose.yml downIt is possible to deploy subgraph using coordinator service.
First, you need to setup subgraph and create a project. Subgraph dashboard.
Then, set env variables:
# Subgraph name
SUBGRAPH_NAME="maci-subgraph"
# Subgraph provider url
SUBGRAPH_PROVIDER_URL=https://api.studio.thegraph.com/deploy/
# Subgraph deploy key
SUBGRAPH_DEPLOY_KEY=*******
# Subgraph project folder
SUBGRAPH_FOLDER=../subgraph
After deployment, subgraph url will be available in studio dashboard and you can use this type of url to get latest deployed version in your application:
https://api.studio.thegraph.com/.../{SUBGRAPH_NAME}/version/latest