From ebbee38bd8b03be3942be1097be5945c22bfaf71 Mon Sep 17 00:00:00 2001 From: longfeiW Date: Wed, 7 May 2025 11:57:07 +0800 Subject: [PATCH 1/3] add goldsky guide --- smart-contracts/advanced/fevm-indexers.md | 77 +++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/smart-contracts/advanced/fevm-indexers.md b/smart-contracts/advanced/fevm-indexers.md index 91ad7ba86..42e2fbd74 100644 --- a/smart-contracts/advanced/fevm-indexers.md +++ b/smart-contracts/advanced/fevm-indexers.md @@ -19,6 +19,83 @@ Blockchain indexers are used for accessing blockchain data efficiently. They pro Additionally, blockchain indexers provide a better developer experience by leveraging well-known API standards and query languages like GraphQL. +## Goldsky +[Goldsky](https://goldsky.com/) offers high-performance subgraph hosting and realtime data indexing for blockchain data, which are GraphQL-based APIs built on top of smart contracts. With Goldsky, developers can access structured blockchain data quickly and efficiently, without needing to run their own nodes or build custom indexing backends. + +Goldsky officially supports the Filecoin, allowing developers to create subgraphs that index smart contract data from the Filecoin mainnet & testnet. + +**Ways to Deploy a Subgraph with Goldsky** + +**1. Goldsky Web App (No-Code)** +A visual interface that guides you step-by-step to configure and deploy a subgraph. Ideal for quick prototyping or less technical users. + +**2. Goldsky CLI (Developer Tooling)** +A command-line interface for creating, editing, and deploying subgraphs programmatically. +- From Subgraph source code +- Migrating from The Graph or any other subgraph host +- Via instant, no-code subgraphs + +In tutorial, we will use no-code Goldsky’s deploy wizard to create subgragh for wFIl ERC-20 token on Filecoin testnet. + +#### Prerequisites +Make sure you have the following tools and setup ready: +- Node.js +- Create a Goldsky account and generate Goldsky API key +- Goldsky CLI installed + ``` + curl https://goldsky.com | sh + ``` +- Authenticate Goldsky CLI with your API key + ``` + goldsky login + ``` +- wFIl Contract information + - contract address: `0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4` + - [contract ABI](https://beryx.io/fil/calibration/address/0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4?tab=contract): saved it as `wfil_abi.json` locally. + +### Deploy a subgragh +Goldsky’s Deploy Wizard simplifies the creation of subgraphs using a CLI-guided flow. +#### 1. Initialize the Subgragh deployment +Run: +``` +goldsky subgraph init +``` +Follow the prompts from Goldsky subgraph configuration wizard: +- *Subgraph name*: wfil-subgraph +- *Subgraph version*: 1.0.0 +- *Subgraph target path*: Choose default or specify your own +- *Contract ABI source*: path/to/wfil_abi.json +- *Contract Address*: `0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4` +- *Contract network*: filecoin-testnet +- *Start block*: which block is the wfil created, can be 0. +- *Contract name*: wfil +- *Enable subgraph call handlers?*: no + +Once you fill out the above information following the prompt, Goldsky wizard will guide you to build and deploy your subgragh. Goldsky will output a deployment URL (GraphQL endpoint) once the subgraph is successfully deployed. + +Once the subgragh is deployed, it will take time to index all the data for your smart contract. You can also check the indexing status of your subgragh from the [Goldsky dashboard](https://app.goldsky.com/). + +### Query the Subgraph +Use the provided GraphQL endpoint to query the subgraph. + +For example: +``` +{ + transfers( + where: {from: "0xf49d33f54ce41354dcd7e698aa54256781a6dd30"} + orderBy: timestamp_ + orderDirection: desc + first: 10 + ) { + id + from + to + amount + timestamp_ + } +} +``` +Use the Goldsky Playground or integrate it into your app to consume indexed data. ## The Graph [The Graph](https://thegraph.com) is a decentralized protocol for indexing blockchain data. It enables developers to build and publish custom open APIs, known as subgraphs, that applications can query to retrieve blockchain data using GraphQL in a time-efficient manner. From 7a258286108a490d62abcc83c72edaf019f90adf Mon Sep 17 00:00:00 2001 From: longfeiW <34025001+longfeiWan9@users.noreply.github.com> Date: Wed, 7 May 2025 12:12:07 +0800 Subject: [PATCH 2/3] Update fevm-indexers.md --- smart-contracts/advanced/fevm-indexers.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/smart-contracts/advanced/fevm-indexers.md b/smart-contracts/advanced/fevm-indexers.md index 42e2fbd74..a85dff0ac 100644 --- a/smart-contracts/advanced/fevm-indexers.md +++ b/smart-contracts/advanced/fevm-indexers.md @@ -20,7 +20,7 @@ Blockchain indexers are used for accessing blockchain data efficiently. They pro Additionally, blockchain indexers provide a better developer experience by leveraging well-known API standards and query languages like GraphQL. ## Goldsky -[Goldsky](https://goldsky.com/) offers high-performance subgraph hosting and realtime data indexing for blockchain data, which are GraphQL-based APIs built on top of smart contracts. With Goldsky, developers can access structured blockchain data quickly and efficiently, without needing to run their own nodes or build custom indexing backends. +[Goldsky](https://goldsky.com/) offers high-performance subgraph hosting and real-time data indexing for blockchain data. These are GraphQL-based APIs built on top of smart contracts. With Goldsky, developers can access structured blockchain data quickly and efficiently without needing to run their own nodes or build custom indexing backends. Goldsky officially supports the Filecoin, allowing developers to create subgraphs that index smart contract data from the Filecoin mainnet & testnet. @@ -35,12 +35,12 @@ A command-line interface for creating, editing, and deploying subgraphs programm - Migrating from The Graph or any other subgraph host - Via instant, no-code subgraphs -In tutorial, we will use no-code Goldsky’s deploy wizard to create subgragh for wFIl ERC-20 token on Filecoin testnet. +In this tutorial, we will use no-code Goldsky’s deploy wizard to create a subgraph for the wFIl ERC-20 token on the Filecoin testnet. #### Prerequisites Make sure you have the following tools and setup ready: - Node.js -- Create a Goldsky account and generate Goldsky API key +- Create a Goldsky account and generate a Goldsky API key - Goldsky CLI installed ``` curl https://goldsky.com | sh @@ -53,30 +53,30 @@ Make sure you have the following tools and setup ready: - contract address: `0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4` - [contract ABI](https://beryx.io/fil/calibration/address/0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4?tab=contract): saved it as `wfil_abi.json` locally. -### Deploy a subgragh +### Deploy a subgraph Goldsky’s Deploy Wizard simplifies the creation of subgraphs using a CLI-guided flow. -#### 1. Initialize the Subgragh deployment +#### 1. Initialize the Subgraph deployment Run: ``` goldsky subgraph init ``` -Follow the prompts from Goldsky subgraph configuration wizard: +Follow the prompts from the Goldsky subgraph configuration wizard: - *Subgraph name*: wfil-subgraph - *Subgraph version*: 1.0.0 - *Subgraph target path*: Choose default or specify your own - *Contract ABI source*: path/to/wfil_abi.json - *Contract Address*: `0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4` - *Contract network*: filecoin-testnet -- *Start block*: which block is the wfil created, can be 0. +- *Start block*: Which block is the wfil created, can be 0. - *Contract name*: wfil - *Enable subgraph call handlers?*: no -Once you fill out the above information following the prompt, Goldsky wizard will guide you to build and deploy your subgragh. Goldsky will output a deployment URL (GraphQL endpoint) once the subgraph is successfully deployed. +Once you fill out the above information following the prompt, the Goldsky wizard will guide you through building and deploying your subgraph. Once the subgraph is successfully deployed, Goldsky will output a deployment URL (GraphQL endpoint). -Once the subgragh is deployed, it will take time to index all the data for your smart contract. You can also check the indexing status of your subgragh from the [Goldsky dashboard](https://app.goldsky.com/). +Once the subgraph is deployed, indexing all the data for your smart contract will take time. You can also check the indexing status of your subgraph from the [Goldsky dashboard](https://app.goldsky.com/). ### Query the Subgraph -Use the provided GraphQL endpoint to query the subgraph. +You can use the provided GraphQL endpoint to query the subgraph. For example: ``` From 4118d5e5df392b4e6ab86c7c1346039c566ee98e Mon Sep 17 00:00:00 2001 From: longfeiW <34025001+longfeiWan9@users.noreply.github.com> Date: Wed, 7 May 2025 14:09:05 +0800 Subject: [PATCH 3/3] Update fevm-indexers.md --- smart-contracts/advanced/fevm-indexers.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/smart-contracts/advanced/fevm-indexers.md b/smart-contracts/advanced/fevm-indexers.md index a85dff0ac..a613e845a 100644 --- a/smart-contracts/advanced/fevm-indexers.md +++ b/smart-contracts/advanced/fevm-indexers.md @@ -37,7 +37,7 @@ A command-line interface for creating, editing, and deploying subgraphs programm In this tutorial, we will use no-code Goldsky’s deploy wizard to create a subgraph for the wFIl ERC-20 token on the Filecoin testnet. -#### Prerequisites +### Prerequisites Make sure you have the following tools and setup ready: - Node.js - Create a Goldsky account and generate a Goldsky API key @@ -55,7 +55,7 @@ Make sure you have the following tools and setup ready: ### Deploy a subgraph Goldsky’s Deploy Wizard simplifies the creation of subgraphs using a CLI-guided flow. -#### 1. Initialize the Subgraph deployment + Run: ``` goldsky subgraph init @@ -71,9 +71,9 @@ Follow the prompts from the Goldsky subgraph configuration wizard: - *Contract name*: wfil - *Enable subgraph call handlers?*: no -Once you fill out the above information following the prompt, the Goldsky wizard will guide you through building and deploying your subgraph. Once the subgraph is successfully deployed, Goldsky will output a deployment URL (GraphQL endpoint). +Once you complete the above information following the prompt, the Goldsky wizard will guide you through building and deploying your subgraph. Once the subgraph is successfully deployed, Goldsky will output a deployment URL (GraphQL endpoint). -Once the subgraph is deployed, indexing all the data for your smart contract will take time. You can also check the indexing status of your subgraph from the [Goldsky dashboard](https://app.goldsky.com/). +Indexing all the data for your smart contract will take time after the subgraph is deployed. You can also check the indexing status of your subgraph from the [Goldsky dashboard](https://app.goldsky.com/). ### Query the Subgraph You can use the provided GraphQL endpoint to query the subgraph.