Giter VIP home page Giter VIP logo

hydra's Introduction

Hydra

A query node builder for Substrate chains

A Substrate query node framework. Inspired by TheGraph, it gives a smooth way to provide powerful GraphQL queries to app developers over your Substrate blockchain state and history.

What's Hydra?

Hydra is a query node for Substrate-based blockchains. A query node ingests data from a substrate chain and provides rich, domain-specific, and highly customizable access to the blockchain data, far beyond the scope of direct RPC calls. For example, expired Kusama Treasury spending proposals are pruned from the state of the Kusama blockchain, so querying, say, one-year-old proposals is problematic. Indeed, one has to track the evolution of the state by sequentially applying the Treasury events and extrinsics in each historical block.

That's where Hydra gets you covered. Define your data model and the Hydra indexer will get it in sync with the chain. On top of that, you get a batteries-included GraphQL server with comprehensive filtering, pagination, and even full-text search capabilities.

Architecture one-liner

A Hydra query node ingests substrate events in a multi-step pipeline:

Substrate Chain => Hydra Indexer => Indexer GraphQL gateway => Hydra Processor => Database => Query Node GraphQL endpoint

For popular chains, one can use an already in-sync publicly available Indexer endpoint. For other chains, a self-hosted indexer should be set up.

Hydra CLI quickstart

Run

$ npx @dzlzv/hydra-cli@next scaffold

and answer the prompts. It will generate a sample project and README with setup instructions.

Monorepo structure

The monorepo contains the following sub-packages:

  • Hydra CLI: Codegen tools to set up and run a Hydra pipeline
  • Hydra Indexer: Hydra indexer for ingesting raw events and extrinsics
  • Hydra Indexer Gateway: GraphQL interface for the Indexer
  • Hydra Processor: Processing part of the pipeline for transforming events into rich business-level objects
  • Hydra Typegen: A tool for generating typesafe typescript classes for events and extrinsics from the runtime metadata. No more manual deserialization of the event data.
  • Sample Project: A quickstart Hydra project set up against a publicly available Kusama indexer. Good starting point.
  • Docs: In-depth documentation covering the Hydra pipeline and API features, such as full-text search, pagination, extensive filtering and a rich GraphQL dialect defining your schema!

hydra's People

Contributors

dzhelezov avatar metmirr avatar bedeho avatar jamiehewitt15 avatar sulejman avatar iorveth avatar

Watchers

James Cloos 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.