Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 2.15 KB

RESEARCH.md

File metadata and controls

42 lines (30 loc) · 2.15 KB

Introduction

Subgraphs are the decentralized data querying layer of the blockchain powered by The Graph protocol https://thegraph.com/. The Graph has released a powerful tool called substreams which allows for much more flexibility than subgraphs. This document is a research on substream powered subgraphs, use cases and analysis of existing projects. Check ./README.md for an implementation of this on the pooltogether protocol https://pooltogether.com/.

Substream Docs & Example Projects.

Example Projects & Resources

How do substreams work

  • There is the firehose node https://firehose.streamingfast.io/.
  • Then there is the substream engine which can run substreams (subsreams are arbitrary processing logic written in rust.).
  • And finally there is the arbitrary persistent storage solution.
  • This means that blockchain data processed with substreams can be stored anywhere you wish.
  • A subgraph powered substream is just a substream which uses subgraph storage as persistent layer.

How do substream powered subgraphs work.

  • First you need to define your substream
  • Then you define your subgraph and reference the substream package as datasource for he subgraph.
  • As long as the substream output data entities (graph_out) is compatible with the subgraph schema entities defined, you have a substream powered subgraph.
  • Finally you can deploy and start consumption with graphql just like subgraphs.