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

OriginProtocol/origin-squid

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Origin Subsquid

See docs/ for specific tasks.

Release Checklist

Ensure we don't miss anything on a release by following this checklist.

  • Go to github repository and create a release
  • Create a new tag following the format v<VERSION_NUMBER> where VERSION_NUMBER is the squid version of the processor (i.e. v54)
  • Generate the release notes automatically or fill them manually
  • Publish the release
  • Wait for processing to complete
  • Set to production at https://app.subsquid.io/squids
  • Check functionality of front-ends
  • Update Grafana Subsquid datasource: https://origindefi.grafana.net/connections/datasources
  • Notify in #defi-data if important
  • Hibernate previous version(s)
  • Delete old versions (keep recently hibernated version as a backup)

Env Options

DEBUG_PERF=true sqd process:oeth     # Run with performance numbers
BLOCK_FROM=18421105 sqd process:oeth # Start processing at block 18421105
BLOCK_TO=18421105 sqd process:oeth   # Process up to block 18421105

Useful Commands

# Code Generation
pnpm run generate          # Generate new migration
pnpm run typegen           # Generate ABI code

pnpm run setup             # Reset database - run prior to starting processing for a fresh start

# Processing Commands
pnpm run process:arbitrum  # Run Arbitrum processor
pnpm run process:base      # Run Base processor
pnpm run process:sonic     # Run Sonic processor
pnpm run process:oeth      # Run OETH processor
pnpm run process:ousd      # Run OUSD processor
pnpm run process:ogv       # Run OGV processor
pnpm run process:mainnet   # Run misc mainnet processor
pnpm run process:test      # Run test processor
pnpm run process           # Run combined processor

# Local GraphQL Server
pnpm run serve             # You'll have to rebuild and rerun to see updates here.

# Deployment Tools
pnpm run postdeploy v81    # Run post-deployment tasks (processing times log and validations)

Quickstart

# 0. Install @subsquid/cli a.k.a. the sqd command globally
pnpm add -g @subsquid/cli

# 1. Install dependencies
pnpm install

# 2. Start a Postgres database container and setup
pnpm run setup

# 3. Build and start the processor (choose one)
pnpm run process:oeth
pnpm run process:ousd
pnpm run process:mainnet
# ... or other available processors

# 4. In a separate terminal, start the GraphQL server
pnpm run serve

A GraphiQL playground will be available at localhost:4350/graphql.

Dev Flow

1. Make Schema Changes

  • Add or modify GraphQL schema files in src/**/*.graphql
  • Run pnpm run generate to:
    • Combine GraphQL files into schema.graphql
    • Generate TypeORM entities
    • Create new database migration
    • Add new files to git

2. Add New Events/Contracts

  • Add ABI JSON files to ./abi/
  • Run pnpm run typegen to generate TypeScript interfaces
  • Create new processor in src/processors/ or add to existing one
  • Update squid.yaml if adding new processor

3. Local Development

# Start fresh
pnpm run setup

# Run processor (choose one)
pnpm run process:oeth
pnpm run process:ousd
# ... etc

# In another terminal
pnpm run serve

4. Testing Changes

  • Use GraphiQL playground at localhost:4350/graphql
  • Check processing times with pnpm run log:processing-times
  • Validate data integrity with generated validation queries

5. Deployment

Development (v999)

# Reset dev environment (v999)
# Only use when you need to reset schema or reload data
sqd deploy . --update --hard-reset

Production Deployment

  1. Create and push a new version branch
git checkout -b v80  # Replace 80 with your version number
# Make any final changes if needed
git push origin v80
  1. Wait for the deployment to complete and validate the data

  2. Tag for production

# Once validated, tag the latest commit for production
git tag prod-v80  # Replace 80 with your version number
git push origin prod-v80
  1. Monitor deployment
  • Check processing at https://app.subsquid.io/squids
  • Follow release checklist at the top of this README
  • Keep the version branch for reference, DO NOT DELETE

Note: Local deployment via sqd deploy . is possible but not recommended for production releases.

Project conventions

Squid tools assume a certain project layout:

  • All compiled js files must reside in lib and all TypeScript sources in src
  • The layout of lib must reflect src
  • All TypeORM classes must be exported by src/model/index.ts
  • Database schema is generated from GraphQL files in src
  • Database migrations must reside in db/migrations and must be plain js files

About

Origin Subsquid

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6

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