Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DistributedCollective/sovryn-indexer

Open more actions menu

Repository files navigation

Sovryn Indexer

Requirements

  • Docker
  • Node v20+ (optional, included in docker image)
  • pnpm (optional, included in docker image)

Development

cp .env.example .env
pnpm install
pnpm docker:dev

Migrations

pnpm studio - serves web interface for drizzle studio on https://local.drizzle.studio

pnpm migrate:generate - creates migration file from changes found in schema files.

pnpm migrate - runs migrations

pnpm db:push - pushes schema changes to the database

pnpm db:seed - seeds the database with initial data (/src/database/seed.ts file)

pnpm db:reset - deletes all data and tables from the database

Docker

Build image

docker build -t sovryn/indexer .

Run image

docker run -p 8000:8000 -it sovryn/indexer

API Usage

Refer to the API documentation for more information on how to use the API.

Testing with real data

Dump your production database contents to a file:

If your testing database is empty, dump the entire database (I recommend using this):

pg_dump --no-owner --no-privileges --no-publications --no-subscriptions --no-tablespaces -Fc -v -d "<postgres connection string>" -f database.bak

Otherwise, only dump the data:

pg_dump --no-owner --no-privileges --no-publications --no-subscriptions --no-tablespaces --data-only --column-inserts -Fc -v -d "<postgres connection string>" -f database.bak

Restore the database contents to your local database:

pg_restore --no-owner -v -d "postgresql://postgres:secret@127.0.0.1:5432/db" database.bak

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.