|
1 | 1 | --- |
2 | 2 | title: About The Graph |
| 3 | +description: This page summarizes the core concepts and basics of The Graph Network. |
3 | 4 | --- |
4 | 5 |
|
5 | | -> The Graph is a decentralized protocol for indexing and querying blockchain data. It enables efficient and secure access to onchain data via Subgraphs, Substreams, TokenAPI, and GraphQL, simplifying dapp development and improving performance. |
6 | | -
|
7 | | -This page summarizes the core concepts and basics of The Graph protocol. |
8 | | - |
9 | 6 | ## Explanation |
10 | 7 |
|
11 | 8 | ### What is the Graph? |
12 | 9 |
|
13 | | -The Graph is a decentralized protocol for indexing and querying blockchain data, empowering developers to access onchain data via open APIs called [Subgraphs](https://thegraph.com/docs/en/subgraphs/developing/subgraphs/). Its suite includes The Graph Network, Subgraphs, [Substreams](https://thegraph.com/docs/en/substreams/introduction/), [Token API BETA](https://thegraph.com/docs/en/token-api/quick-start/), and tools like [Graph Explorer](https://thegraph.com/docs/en/subgraphs/explorer/) and [Subgraph Studio](https://thegraph.com/docs/en/subgraphs/developing/deploying/using-subgraph-studio/). The Graph supports multiple blockchains and enhances data access in the web3 ecosystem. |
| 10 | +The Graph is a decentralized protocol for indexing and querying blockchain data, empowering developers to access onchain data via open APIs called Subgraphs. Its suite includes [Subgraphs](/en/subgraphs/developing/subgraphs/), [Substreams](/en/substreams/introduction/), [Token API BETA](/en/token-api/quick-start/), and tools like [Graph Explorer](/en/subgraphs/explorer/) and [Subgraph Studio](/en/subgraphs/developing/deploying/using-subgraph-studio/). |
| 11 | + |
| 12 | +The Graph supports [90+ blockchains](/en/supported-networks/), enhancing dapp development and data retrieval. |
14 | 13 |
|
15 | | -### Why is Blockchain Data hard to Query? |
| 14 | +### Why is Blockchain Data Hard to Query? |
16 | 15 |
|
17 | 16 | Reading onchain data from the blockchain (e.g., ownership history, metadata, relationships between assets) typically requires processing smart contract events, parsing metadata from IPFS, and aggregating data manually. This is very slow, complex, and resource-intensive. |
18 | 17 |
|
19 | 18 | ## Solution |
20 | 19 |
|
21 | 20 | ### How The Graph Solves This |
22 | 21 |
|
23 | | -The Graph uses open APIs called Subgraphs to index blockchain data. Each Subgraph defines: |
| 22 | +The Graph simplifies the complex process of retrieving blockchain data through a global, decentralized network of Indexers that index Subgraphs. This infrastructure facilitates efficient, censorship-resistant query handling, allowing developers to build applications using blockchain data without the hassle of managing servers or custom indexing. |
| 23 | + |
| 24 | +Each Subgraph defines: |
24 | 25 |
|
25 | 26 | - Which smart contracts to watch |
26 | 27 | - Which events to extract |
27 | | -- How to map event data into a queryable format using GraphQL |
28 | | - |
29 | | -Indexing blockchain data is complex, but The Graph simplifies it through a global, decentralized network of Indexers. This infrastructure enables efficient, censorship-resistant query handling, allowing developers to build applications using blockchain data without the hassle of managing servers or custom indexing. |
| 28 | +- How to map event data into a queryable format using [GraphQL](https://graphql.org/learn/) |
30 | 29 |
|
31 | | -### Building a Subgraph |
| 30 | +### [Building a Subgraph](/en/subgraphs/developing/creating/starting-your-subgraph/) |
32 | 31 |
|
33 | | -1. Define a **Subgraph Manifest** with the data sources and mappings |
34 | | -2. Use **Graph CLI** to deploy the manifest to IPFS |
35 | | -3. An **Indexer** picks it up and starts indexing Ethereum blocks |
36 | | -4. Data becomes queryable via a **GraphQL endpoint** |
| 32 | +1. Define a [Subgraph Manifest](/en/subgraphs/developing/creating/subgraph-manifest/) with data sources and mappings. |
| 33 | +2. Use [Graph CLI](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli) to deploy the manifest to IPFS. |
| 34 | +3. An [Indexer](/en/indexing/overview/) picks it up and starts indexing Ethereum blocks. |
| 35 | +4. Data becomes queryable via a [GraphQL endpoint](/en/subgraphs/querying/graphql-api/). |
37 | 36 |
|
38 | 37 | ### Data Flow Overview |
39 | 38 |
|
40 | 39 | 1. A dapp triggers a transaction on Ethereum by interacting with a smart contract. |
41 | 40 |
|
42 | 41 | 2. As the transaction is processed, the smart contract emits one or more events. |
43 | 42 |
|
44 | | -3. Graph Node continuously scans the Ethereum blockchain for new blocks and filters for events relevant to a deployed Subgraph. |
| 43 | +3. [Graph Node](/en/indexing/tooling/graph-node/) continuously scans the Ethereum blockchain for new blocks and filters for events relevant to a deployed Subgraph. |
45 | 44 |
|
46 | | -4. When a matching event is identified, the Graph Node executes the Subgraph’s mapping logic, which is a WASM module that transforms event data into structured entities. These entities are subsequently stored and indexed. |
| 45 | +4. When a matching event is identified, Graph Node executes the Subgraph’s mapping logic, which is a WASM module that transforms event data into structured entities. These entities are subsequently stored and indexed. |
47 | 46 |
|
48 | 47 | 5. The dapp queries the Graph Node via a [GraphQL API](https://graphql.org/learn/), retrieving indexed data to render in the UI. Users can then take actions that generate new transactions, continuing the cycle. |
49 | 48 |
|
|
0 commit comments