Skip to content

CirclesUBI/circles-api

Repository files navigation

circles-api

Offchain API service for Circles


An offchain API service to safely store and resolve Circles user data from public adresses and find transitive transfer paths to send tokens within the trust graph.

Features

  • Create and search off-chain data like transfer descriptions and user profiles
  • Indexes and stores Circles trust network
  • Calculate transitive transfer steps to send Circles

Requirements

  • NodeJS environment (tested with v14)
  • PostgreSQL database
  • Redis

Usage

Check out the Dockerfile for running the circles-api on your server.

Development

# Install dependencies
npm install

# Copy .env file for local development
cp .env.example .env

# Seed and migrate database
npm run db:migrate
npm run db:seed

# Run tests
npm run test
npm run test:watch

# Check code formatting
npm run lint

# Start local server and watch changes
npm run watch:all

# Build for production
npm run build

# Run production server
npm start
npm worker:start

Pathfinder

pathfinder is a rust program by chriseth compiled for Linux arm64 in this repository. To update the pathfinder in the api, build a native binary according to the README instructions from chriseth and move the target into your project.

The version we are using corresponds with this commit: https://github.com/chriseth/pathfinder2/commit/641eb7a31e8a4f3418d9b59eb97e5307a265e195

License

GNU Affero General Public License v3.0 AGPL-3.0