This project contains Apibara indexers for the Coloniz platform.
- Node.js v22+
- Yarn
- PostgreSQL (optional, can use in-memory database for development)
-
Install dependencies:
yarn install
-
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Run a single indexer in development mode:
yarn dev --indexer coloniz-channel
To run all indexers in development mode:
yarn dev:allThis will:
- Start each indexer in a separate terminal window
- Run each indexer directly with
yarn dev --indexer <name> - Allow you to see logs in real-time in each terminal
To run all indexers in production mode with PM2:
# Build and start all indexers
yarn start:prod
# If you've already built the indexers
yarn start:prod:no-buildThis will:
- Build the indexers (unless --no-build is specified)
- Start each indexer in production mode using PM2
- Save the PM2 process list for persistence
# Check status of all PM2 processes
yarn pm2:status
# View logs from all PM2 processes
yarn pm2:logs
# Stop only Coloniz indexers
yarn pm2:stop
# Remove only Coloniz indexers from PM2
yarn pm2:delete
# Save the current process list
yarn pm2:save
# Set up PM2 to start on system boot
yarn pm2:startupThe project includes the following indexers:
coloniz-channel: Indexes channel-related eventscoloniz-community: Indexes community-related eventscoloniz-handle: Indexes handle-related eventscoloniz-jolt: Indexes jolt-related eventscoloniz-profile: Indexes profile-related eventscoloniz-useraction: Indexes user action events
The indexers use PostgreSQL with Drizzle ORM. You can run migrations with:
yarn drizzle:migrateGenerate migration files with:
yarn drizzle:generateIf you encounter issues with the indexers:
-
Check the logs for specific errors:
yarn pm2:logs
-
Make sure your environment variables are set correctly in
.env -
Ensure the database is properly configured and accessible
-
If you see syntax errors with PM2 and Yarn, try restarting the indexers:
yarn pm2:delete yarn start:prod