From 344f2b42bbd63fe6051329e67830cdca4e0a74fd Mon Sep 17 00:00:00 2001 From: Lucas Tortora Date: Mon, 25 Mar 2024 17:02:10 -0300 Subject: [PATCH 1/4] added subgraphs.md --- docs/build/getting-started/sidebars.ts | 5 ++ docs/build/getting-started/subgraphs.md | 93 +++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 docs/build/getting-started/subgraphs.md diff --git a/docs/build/getting-started/sidebars.ts b/docs/build/getting-started/sidebars.ts index 449235b3c6c..5e87ec3e151 100644 --- a/docs/build/getting-started/sidebars.ts +++ b/docs/build/getting-started/sidebars.ts @@ -60,6 +60,11 @@ module.exports = { type: 'doc', id: 'oracles', }, + { + label: 'Subgraphs for Shimmer EVM', + type: 'doc', + id: 'subgraphs', + }, { label: 'Testnet Faucet', type: 'link', diff --git a/docs/build/getting-started/subgraphs.md b/docs/build/getting-started/subgraphs.md new file mode 100644 index 00000000000..7e9a360899a --- /dev/null +++ b/docs/build/getting-started/subgraphs.md @@ -0,0 +1,93 @@ +--- +description: 'Learn about the role of in subgraphs in smart, how they can provide indexed blockchain data to your smart contracts.' +image: /img/logo/WASP_logo_dark.png +tags: + - Blockchain subgraphs + - Smart Contracts + - Shimmer EVM + - TheGraph +--- + +# Subgraphs + +:::info tl;dr; + +Subgraphs provide a streamlined way for developers to access blockchain data relevant to their applications, +significantly enhancing developer efficiency and user experience. + +::: + +Subgraphs collect and organize blockchain data by application needs, making it readily accessible for developers. Unlike +blockchains that store data without application context, subgraphs allow you to quickly retrieve information pertinent +to your application. Services like Alchemy Subgraphs simplify real-time data access, facilitating the creation of +dynamic user interfaces and interactions in your applications. + +## Subgraph Components and Operations + +Subgraphs are built on GraphQL APIs, enabling you to query on-chain transaction data efficiently. This feature is +particularly useful for developers working with complex smart contracts requiring detailed frontend interfaces. For +instance, querying transactions within a specific Uniswap v3 liquidity pool becomes straightforward with subgraphs. By +defining a schema and indexing event data, you can utilize the generated GraphQL API for effective data querying. + +### Subgraph Manifest + +The manifest details the smart contracts your subgraph indexes, the events it tracks, and how event data is mapped to +queryable entities. This foundational document ensures your subgraph accurately reflects the blockchain data your +application needs. + +### Subgraph Schema + +The schema organizes your subgraph data, defining entities like pools in DeFi applications, and their attributes. It is +crucial for structuring your data to support efficient queries. + +### Subgraph Mappings + +Mappings process incoming blockchain events, specified in your manifest, and store them according to your schema. These +AssemblyScript codes are essential for translating raw blockchain data into a format your application can easily query. + +## Popular Use Cases for Subgraphs + +Subgraphs have found widespread adoption in various blockchain applications, from DeFi to NFTs and DAOs, due to their +ability to index and query data effectively. + +* Custom Smart Contract Indexing: Ideal for developers needing to index data for unique smart contracts, especially + those creating frontend interfaces. +* Decentralized Finance (DeFi): Subgraphs provide real-time data on token prices, liquidity, and more, enhancing DeFi + applications. +* Non-fungible Tokens (NFTs): They allow for efficient querying of NFT ownership, transaction history, and off-chain + data. +* Decentralized Autonomous Organizations (DAOs): Subgraphs facilitate on-chain decision-making and data analysis for + DAOs. +* Gaming: They support real-time data access, improving gameplay and in-game transactions. + +## Benefits of Using Subgraphs + +Subgraphs offer a developer-friendly approach to blockchain data indexing, compatible with various blockchains and +enhancing application security and resilience. + +* Ease of Use: With familiar tools like AssemblyScript and GraphQL, subgraphs are accessible to developers, simplifying + the backend data management. +* Cross-Blockchain Compatibility: They work across multiple EVM-compatible networks, allowing applications to operate + seamlessly on different blockchains. +* Security and Decentralization: Opting for decentralized querying with subgraphs can reduce reliance on single data + sources, increasing application robustness. + +## Considerations for Using Subgraphs + +While subgraphs simplify data querying, developing and debugging them can present challenges, including customization +limits and potential costs. + +* Development Complexity: Learning the subgraph ecosystem and debugging can be daunting without adequate tooling. +* Customization Limits: If your application requires highly specific indexing, a custom solution might be necessary. +* Cost and Indexing Speed: Managing costs and ensuring efficient indexing are important factors when deciding to use + subgraphs. + +## Subgraph Providers and Tools + +### The Graph + +[The Graph](https://thegraph.com/) is a prominent provider, offering tools for creating, deploying, and querying +subgraphs. +It supports scalable, cost-effective solutions for blockchain data management, catering to diverse developer needs. + +## TODO add info about the nakama repo, archice nodes and RPC URL \ No newline at end of file From 4b008eda4bc504d30dd74ef9b7297e9d09da7d75 Mon Sep 17 00:00:00 2001 From: Lucas Tortora Date: Mon, 25 Mar 2024 17:09:45 -0300 Subject: [PATCH 2/4] edits --- docs/build/getting-started/subgraphs.md | 40 +++++++++++++------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/docs/build/getting-started/subgraphs.md b/docs/build/getting-started/subgraphs.md index 7e9a360899a..b482c16f44c 100644 --- a/docs/build/getting-started/subgraphs.md +++ b/docs/build/getting-started/subgraphs.md @@ -19,15 +19,15 @@ significantly enhancing developer efficiency and user experience. Subgraphs collect and organize blockchain data by application needs, making it readily accessible for developers. Unlike blockchains that store data without application context, subgraphs allow you to quickly retrieve information pertinent -to your application. Services like Alchemy Subgraphs simplify real-time data access, facilitating the creation of +to your application and simplify real-time data access, facilitating the creation of dynamic user interfaces and interactions in your applications. ## Subgraph Components and Operations -Subgraphs are built on GraphQL APIs, enabling you to query on-chain transaction data efficiently. This feature is -particularly useful for developers working with complex smart contracts requiring detailed frontend interfaces. For -instance, querying transactions within a specific Uniswap v3 liquidity pool becomes straightforward with subgraphs. By -defining a schema and indexing event data, you can utilize the generated GraphQL API for effective data querying. +Subgraphs are built on [GraphQL](https://graphql.org/) APIs, enabling you to query on-chain transaction data efficiently. +This feature is particularly useful for developers working with complex smart contracts requiring detailed frontend +interfaces. For instance, querying transactions within a specific liquidity pool becomes straightforward with subgraphs. +By defining a schema and indexing event data, you can utilize the generated GraphQL API for effective data querying. ### Subgraph Manifest @@ -42,34 +42,36 @@ crucial for structuring your data to support efficient queries. ### Subgraph Mappings -Mappings process incoming blockchain events, specified in your manifest, and store them according to your schema. These -AssemblyScript codes are essential for translating raw blockchain data into a format your application can easily query. +Mappings process incoming blockchain events, specified in your [manifest](#subgraph-manifest), and store them +according to your [schema](#subgraph-schema). +These [AssemblyScript](https://www.assemblyscript.org/) codes are essential for translating raw blockchain data into a +format your application can easily query. ## Popular Use Cases for Subgraphs Subgraphs have found widespread adoption in various blockchain applications, from DeFi to NFTs and DAOs, due to their ability to index and query data effectively. -* Custom Smart Contract Indexing: Ideal for developers needing to index data for unique smart contracts, especially +* **Custom Smart Contract Indexing**: Ideal for developers needing to index data for unique smart contracts, especially those creating frontend interfaces. -* Decentralized Finance (DeFi): Subgraphs provide real-time data on token prices, liquidity, and more, enhancing DeFi +* **Decentralized Finance (DeFi)**: Subgraphs provide real-time data on token prices, liquidity, and more, enhancing DeFi applications. -* Non-fungible Tokens (NFTs): They allow for efficient querying of NFT ownership, transaction history, and off-chain +* **Non-fungible Tokens (NFTs)**: They allow for efficient querying of NFT ownership, transaction history, and off-chain data. -* Decentralized Autonomous Organizations (DAOs): Subgraphs facilitate on-chain decision-making and data analysis for +* **Decentralized Autonomous Organizations (DAOs)**: Subgraphs facilitate on-chain decision-making and data analysis for DAOs. -* Gaming: They support real-time data access, improving gameplay and in-game transactions. +* **Gaming**: They support real-time data access, improving gameplay and in-game transactions. ## Benefits of Using Subgraphs Subgraphs offer a developer-friendly approach to blockchain data indexing, compatible with various blockchains and enhancing application security and resilience. -* Ease of Use: With familiar tools like AssemblyScript and GraphQL, subgraphs are accessible to developers, simplifying +* **Ease of Use**: With familiar tools like AssemblyScript and GraphQL, subgraphs are accessible to developers, simplifying the backend data management. -* Cross-Blockchain Compatibility: They work across multiple EVM-compatible networks, allowing applications to operate +* **Cross-Blockchain Compatibility**: They work across multiple EVM-compatible networks, allowing applications to operate seamlessly on different blockchains. -* Security and Decentralization: Opting for decentralized querying with subgraphs can reduce reliance on single data +* **Security and Decentralization**: Opting for decentralized querying with subgraphs can reduce reliance on single data sources, increasing application robustness. ## Considerations for Using Subgraphs @@ -77,9 +79,9 @@ enhancing application security and resilience. While subgraphs simplify data querying, developing and debugging them can present challenges, including customization limits and potential costs. -* Development Complexity: Learning the subgraph ecosystem and debugging can be daunting without adequate tooling. -* Customization Limits: If your application requires highly specific indexing, a custom solution might be necessary. -* Cost and Indexing Speed: Managing costs and ensuring efficient indexing are important factors when deciding to use +* **Development Complexity**: Learning the subgraph ecosystem and debugging can be daunting without adequate tooling. +* **Customization Limits**: If your application requires highly specific indexing, a custom solution might be necessary. +* **Cost and Indexing Speed**: Managing costs and ensuring efficient indexing are important factors when deciding to use subgraphs. ## Subgraph Providers and Tools @@ -90,4 +92,4 @@ limits and potential costs. subgraphs. It supports scalable, cost-effective solutions for blockchain data management, catering to diverse developer needs. -## TODO add info about the nakama repo, archice nodes and RPC URL \ No newline at end of file +## TODO add info about the nakama repo, how to use archive nodes and RPC URL \ No newline at end of file From 530158215f27de3c84fbef1c0de8124c421a7641 Mon Sep 17 00:00:00 2001 From: Lucas Tortora Date: Mon, 25 Mar 2024 18:58:02 -0300 Subject: [PATCH 3/4] remove unnecessary info --- docs/build/getting-started/subgraphs.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/build/getting-started/subgraphs.md b/docs/build/getting-started/subgraphs.md index b482c16f44c..5b28a53184a 100644 --- a/docs/build/getting-started/subgraphs.md +++ b/docs/build/getting-started/subgraphs.md @@ -74,15 +74,6 @@ enhancing application security and resilience. * **Security and Decentralization**: Opting for decentralized querying with subgraphs can reduce reliance on single data sources, increasing application robustness. -## Considerations for Using Subgraphs - -While subgraphs simplify data querying, developing and debugging them can present challenges, including customization -limits and potential costs. - -* **Development Complexity**: Learning the subgraph ecosystem and debugging can be daunting without adequate tooling. -* **Customization Limits**: If your application requires highly specific indexing, a custom solution might be necessary. -* **Cost and Indexing Speed**: Managing costs and ensuring efficient indexing are important factors when deciding to use - subgraphs. ## Subgraph Providers and Tools From ad3771d686c9828693a88f672c7cc86b98c72f73 Mon Sep 17 00:00:00 2001 From: Lucas Tortora Date: Mon, 13 May 2024 09:34:14 -0300 Subject: [PATCH 4/4] added tip on peering --- docs/build/getting-started/subgraphs.md | 26 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/build/getting-started/subgraphs.md b/docs/build/getting-started/subgraphs.md index 5b28a53184a..441fffec814 100644 --- a/docs/build/getting-started/subgraphs.md +++ b/docs/build/getting-started/subgraphs.md @@ -24,8 +24,9 @@ dynamic user interfaces and interactions in your applications. ## Subgraph Components and Operations -Subgraphs are built on [GraphQL](https://graphql.org/) APIs, enabling you to query on-chain transaction data efficiently. -This feature is particularly useful for developers working with complex smart contracts requiring detailed frontend +Subgraphs are built on [GraphQL](https://graphql.org/) APIs, enabling you to query on-chain transaction data +efficiently. +This feature is particularly useful for developers working with complex smart contracts requiring detailed frontend interfaces. For instance, querying transactions within a specific liquidity pool becomes straightforward with subgraphs. By defining a schema and indexing event data, you can utilize the generated GraphQL API for effective data querying. @@ -43,8 +44,8 @@ crucial for structuring your data to support efficient queries. ### Subgraph Mappings Mappings process incoming blockchain events, specified in your [manifest](#subgraph-manifest), and store them -according to your [schema](#subgraph-schema). -These [AssemblyScript](https://www.assemblyscript.org/) codes are essential for translating raw blockchain data into a +according to your [schema](#subgraph-schema). +These [AssemblyScript](https://www.assemblyscript.org/) codes are essential for translating raw blockchain data into a format your application can easily query. ## Popular Use Cases for Subgraphs @@ -54,7 +55,8 @@ ability to index and query data effectively. * **Custom Smart Contract Indexing**: Ideal for developers needing to index data for unique smart contracts, especially those creating frontend interfaces. -* **Decentralized Finance (DeFi)**: Subgraphs provide real-time data on token prices, liquidity, and more, enhancing DeFi +* **Decentralized Finance (DeFi)**: Subgraphs provide real-time data on token prices, liquidity, and more, enhancing + DeFi applications. * **Non-fungible Tokens (NFTs)**: They allow for efficient querying of NFT ownership, transaction history, and off-chain data. @@ -67,14 +69,15 @@ ability to index and query data effectively. Subgraphs offer a developer-friendly approach to blockchain data indexing, compatible with various blockchains and enhancing application security and resilience. -* **Ease of Use**: With familiar tools like AssemblyScript and GraphQL, subgraphs are accessible to developers, simplifying +* **Ease of Use**: With familiar tools like AssemblyScript and GraphQL, subgraphs are accessible to developers, + simplifying the backend data management. -* **Cross-Blockchain Compatibility**: They work across multiple EVM-compatible networks, allowing applications to operate +* **Cross-Blockchain Compatibility**: They work across multiple EVM-compatible networks, allowing applications to + operate seamlessly on different blockchains. * **Security and Decentralization**: Opting for decentralized querying with subgraphs can reduce reliance on single data sources, increasing application robustness. - ## Subgraph Providers and Tools ### The Graph @@ -83,4 +86,9 @@ enhancing application security and resilience. subgraphs. It supports scalable, cost-effective solutions for blockchain data management, catering to diverse developer needs. -## TODO add info about the nakama repo, how to use archive nodes and RPC URL \ No newline at end of file +:::tip Wasp Access Nodes + +You can find more information on how to connect to an access node in the +[#nodesharing channel](https://discordapp.com/channels/397872799483428865/398600007378272256) on the [IOTA Discord](https://discord.iota.org/). + +::: \ No newline at end of file