Giter Club home page Giter Club logo

squid's Introduction

Subsquid - an ETL framework for Web3 data

Subsquid framework is a set of tools to ingest, transform and present blockchain data.

Our current focus is on substrate-based chains, with support for EVM-based chains coming next.

Overview

Subsquid framework consists of several key components.

Archive

An Archive is a set of services formed by substrate-ingest, substrate-gateway, postgres compatible database and optionally substrate-explorer, which together

  1. ingest blockchain data
  2. decode and persist it in a normalized form
  3. make it available for further processing and exploration.

Compared to data access using a conventional chain node RPC, an archive allows one to access data in a more granular fashion and from multiple blocks at once. The explorer service provides a GraphQL API for querying historical blocks, events and transactions with rich filtering capabilities.

Processor

substrate-processor fetches on-chain data from an archive and executes user-defined mapping code against it.

Typegen tools

substrate-typegen(1) can generate facade TypeScript classes for substrate events, calls and storage items, allowing to work with chain data in a fully typesafe and runtime upgrades aware fashion.

Similarly, squid-evm-typegen(1) generates facade TypeScript classes for type-safe processing of EVM logs.

Postgres

substrate-processor is designed to be able to load the processed data into an arbitrary database and indeed one can run it without a persistent store.

However, extra tooling for data modeling and serving the data with GraphQL is available when a processor is run against a postgres-compatible database. In such a case, the Subsquid framework suggests the following dev flow:

  1. Define the target database schema using a GraphQL dialect enriched with custom directives
  2. Generate TypeORM entity classes with typeorm-codegen
  3. Generate and apply database migrations with typeorm-migration
  4. Use powerful and extensible GraphQL server to serve produced data right away.

Squid

ETL projects built with the Subsquid framework are called Squids.

Squids have a certain structure and are supposed to be developed as regular node.js packages. See squid-template for a reference.

A typical squid implements both data mapping and an API server presenting the data.

Squids can be deployed to a Subsquid cloud service called Aquairum. In the future, the cloud service will be replaced by an open network of decentralized squid operators.

For more details on how to build, run and deploy a squid consult the Docs

Other tools

The Subsquid framework incorporates a few npm packages that might be useful in a standalone mode:

Getting started

The best way to get started is to clone and inspect squid-template project.

Developer community

Our developers are active on telegram. Feel free to join and ask any question!

Contributing

Subsquid is an OpenSource project, contributions are welcomed, encouraged and will be rewarded!

Please consult CONTRIBUTING.md for hacking instructions and make sure to read our code of conduct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.