What Is The Graph?
The Graph is a decentralized protocol designed for indexing and querying blockchain data, particularly from complex smart contracts like those found in projects such as Uniswap and NFT initiatives like Bored Ape Yacht Club.
Background
Yaniv Tal, Brandon Ramirez, and Jannis Pohlman founded the Graph in 2018.
How It Works
Blockchain data, especially from projects with intricate smart contracts, can be challenging to query directly due to its complexity. The Graph addresses this issue by providing a decentralized protocol for indexing and efficiently querying blockchain data.
The Graph learns what data to index based on subgraph descriptions. Subgraphs define the smart contracts of interest, events to monitor, and mapping event data to be stored in its database. Once a subgraph manifest is created, it is stored in IPFS, and the indexer begins indexing data for that subgraph. Graph Nodes scan Ethereum for new blocks, identifies relevant events, and runs mapping handlers to store data entities in response to these events. Data indexed by Graph Nodes can be queried through its GraphQL endpoint, where queries are translated into queries for its underlying data store.
Key Takeaways
- The Graph is a decentralized protocol for indexing and querying blockchain data.
- It addresses the challenge of querying complex smart contracts by providing a standardized approach.
- Subgraph descriptions define the smart contracts and events of interest, enabling efficient indexing.
- Graph Nodes continually scan Ethereum for new blocks and index data according to subgraph manifests.
- Queries to Graph Node’s GraphQL endpoint allow users to access indexed blockchain data efficiently.