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