A gentle intro to building on @graphprotocol:

First, why build on the Graph?

Because censorship resistant, trusted contracts on #Ethereum is a good starting point but client files (ipfs) and app data also need to be served from decentralized sources to create unstoppable 1/6
client dapps. If you are building on #Ethereum, the Graph is a key part of your tech stack for storing and retrieving data.

There are 3 main files you will work with when building on the Graph:

1. Yaml file - config that tells the Indexers what data to read from #Ethereum 2/6
2. Graphql file - defines the data types for Indexers to store
3. Mapping file(s) - manipulates the raw #Ethereum data into the defined data types and saves these as records for Indexers to serve.

Each yaml/ graphql/ mapping file combo represents a specific subgraph. 3/6
A protocol might have a single subgraph or multiple depending on complexity. At @synthetix_io we have many subgraphs to capture a variety of data across synth rates, exchanges data, staking info, ether loans, liquidations, binary options, etc... 4/6
The yaml config file includes the addresses & abis for the contracts a subgraph should track.

The yaml file also has a path based reference to the graphql file which types the entities Indexers will serve and another path to the 5/6
mapping file where you use assembly script to manipulate data from #Ethereum events, calls & blocks data into the defined entities for indexers to serve.

The Graph is a key part of the web3 stack. If you would like to learn more, check out their docs 6/6 thegraph.com/docs/

• • •

Missing some Tweet in this thread? You can try to force a refresh

Keep Current with David Schwartz

David Schwartz Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!


Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!

This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!