npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@maci-protocol-extended/relayer

v1.0.0

Published

Relayer service for MACI

Readme

MACI Relayer Service

This repository contains the setup and instructions to run the MACI Relayer service along with MongoDB using Docker.

For more details on how to use and integrate the offchain relayer service into your application, please refer to this guide.

Flow Diagram

Below is a high-level diagram illustrating the flow of the Relayer Service:

MACI Relayer Flow

High-Level Overview of the Relayer:

Functionality

The Relayer serves as an intermediary between users and the MACI system. It performs the following tasks:

  • Allows users to send messages without having to pay gas fees by processing these messages off-chain.
  • Receives user messages.
  • Prepare messages batches and upload it to IPFS
  • Submits the message hashes to the Poll contract with IPFS hash of the batch.

This process ensures that user actions are recorded on-chain without compromising their privacy.

Privacy Preservation

By verifying the zero-knowledge proofs, the Relayer ensures that only authorized users can send messages. Users must know the pre-image to a state leaf in the poll state tree.

Decentralization and Trust

It's recommended that the coordinator only runs this service for now. That is because if the service malfunctions and batch hashes are pushed on chain without the messages actually being stored on ipfs, then polls can't be finalized.

Integration with MACI Components

The Relayer interacts with other components of the MACI system, such as the Coordinator and the on-chain smart contracts:

  • The Coordinator fetches all the messages stored in IPFS and uses them as regular on-chain messages.
  • This ensures that user messages are properly processed and recorded, contributing to the overall functionality and security of the voting protocol.

Prerequisites

Make sure you have the following tools installed on your system:

Getting Started

Follow these steps to run the MACI Relayer service using Docker.

1. Clone the Repository

First, clone the repository to your local machine.

git clone https://github.com/privacy-scaling-explorations/maci
cd maci

2. Configure Environment Variables

The .env file contains sensitive configuration values that will be injected into the Docker containers at runtime. To set them up:

  1. Copy the .env.example file to .env.
cp .env.example .env
  1. Edit the .env file and configure the variables.

3. Build and Run the Docker Containers

Now that your environment is set up, it's time to build and run the Docker containers.

Run the following command from the root directory of your project:

docker-compose up --build

This command does the following:

  • Builds the Docker images based on the Dockerfile and docker-compose.yml files.
  • Starts the service container (the MACI relayer application) and the mongodb container.

The MACI Relayer service will be available on port 3000 by default (you can modify this in the .env file).

4. Access the Service

Once the containers are up and running, you can access the relayer service at:

http://localhost:3000

Additionally, the Swagger UI documentation for the Relayer service API can be accessed at:

http://localhost:3000/api

You can interact with the API through the Swagger interface, which provides a convenient way to test endpoints and view the API methods.

5. Check Logs

To view the logs from the containers and troubleshoot any issues, run:

docker-compose logs

This will display logs from both the service (relayer) and mongodb containers.

6. Stop the Services

To stop the containers and remove the containers (but keep the volumes), use the following command:

docker-compose down

This will stop and remove the containers but retain the volumes (like MongoDB data). To also remove the volumes, run:

docker-compose down --volumes

7. MongoDB Persistence

MongoDB data is persisted using Docker volumes (mongodb-data). Even if you remove and recreate the MongoDB container, the data will persist.

This ensures that any data stored in the MongoDB database is not lost even if the container is restarted or removed.

If you'd like to remove the persisted data as well, you can remove the volume by running:

docker volume rm your-repo_mongodb-data

This will delete the volume, along with all the data stored in MongoDB.

Additional Information

For more details, you can read the following post on EthResearch:

MACI with Mostly Off-Chain Happy Path