Code Monkey home page Code Monkey logo

squid-sdk's Introduction

Squid SDK - an ETL framework for Web3 data

The Squid SDK is a set of tools to ingest, transform and present blockchain data.

The SDK currently supports indexing of EVM- and Substrate-based chains.

Getting started

The best way to get started is to install squid CLI and scaffold a squid project with sqd init.

For step-by-step instructions, follow one of the Quickstart guides.

Overview

The Squid SDK consists of several key components.

Processor

substrate-processor (for Substrate-based networks) and evm-processor(for EVM networks) fetch on-chain data from an Archive and execute user-defined data mapping code to transform and persist the data into the target database.

Typegen tools

squid-substrate-typegen(1) generates facade TypeScript classes for type-safe decoding substrate events, calls and RPC storage queries. It natively supports Substrate runtime upgrades by inspecting the historical metadata changes and generating runtime version-aware data access methods.

Similarly, squid-evm-typegen(1) generates facade TypeScript classes for type-safe decoding of EVM event logs, transaction data and RPC contract state responses.

Postgres

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

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 the produced data.

See the docs for more details on the data modelling using the schema file and an auto-generated GraphQL API over it.

Other tools

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

Archives

An Archive is a specialized data lake optimized for batch access to the historical event and transaction data. Archives are the primary data sources for squid projects developed with the Squid SDK. Currently, public Archives are maintained by the Subsquid Labs GmbH and will be replaced by a decentralized solution in the future.

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

For a list of public Substrate archives, see the Aquarium page.

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.

Developer community

Our developers are active on Telegram and Discord. 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.

squid-sdk's People

Contributors

eldargab avatar belopash avatar tmcgroul avatar dzhelezov avatar mo4islona avatar rightjelkin avatar ozgrakkurt avatar raekwoniii avatar boo-0x avatar vikiival avatar igorgro avatar acdibble avatar andrew-frank avatar abernatskiy avatar dlangellotti avatar osipov-mit avatar hyunggyujang avatar octo-gone avatar justraman avatar

Stargazers

 avatar Huseyin avatar Fatih avatar

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.