Skip to content

Commit ebbee38

Browse files
committed
add goldsky guide
1 parent fe5857c commit ebbee38

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

smart-contracts/advanced/fevm-indexers.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,83 @@ Blockchain indexers are used for accessing blockchain data efficiently. They pro
1919

2020
Additionally, blockchain indexers provide a better developer experience by leveraging well-known API standards and query languages like GraphQL.
2121

22+
## Goldsky
23+
[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.
24+
25+
Goldsky officially supports the Filecoin, allowing developers to create subgraphs that index smart contract data from the Filecoin mainnet & testnet.
26+
27+
**Ways to Deploy a Subgraph with Goldsky**
28+
29+
**1. Goldsky Web App (No-Code)**
30+
A visual interface that guides you step-by-step to configure and deploy a subgraph. Ideal for quick prototyping or less technical users.
31+
32+
**2. Goldsky CLI (Developer Tooling)**
33+
A command-line interface for creating, editing, and deploying subgraphs programmatically.
34+
- From Subgraph source code
35+
- Migrating from The Graph or any other subgraph host
36+
- Via instant, no-code subgraphs
37+
38+
In tutorial, we will use no-code Goldsky’s deploy wizard to create subgragh for wFIl ERC-20 token on Filecoin testnet.
39+
40+
#### Prerequisites
41+
Make sure you have the following tools and setup ready:
42+
- Node.js
43+
- Create a Goldsky account and generate Goldsky API key
44+
- Goldsky CLI installed
45+
```
46+
curl https://goldsky.com | sh
47+
```
48+
- Authenticate Goldsky CLI with your API key
49+
```
50+
goldsky login
51+
```
52+
- wFIl Contract information
53+
- contract address: `0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4`
54+
- [contract ABI](https://beryx.io/fil/calibration/address/0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4?tab=contract): saved it as `wfil_abi.json` locally.
55+
56+
### Deploy a subgragh
57+
Goldsky’s Deploy Wizard simplifies the creation of subgraphs using a CLI-guided flow.
58+
#### 1. Initialize the Subgragh deployment
59+
Run:
60+
```
61+
goldsky subgraph init
62+
```
63+
Follow the prompts from Goldsky subgraph configuration wizard:
64+
- *Subgraph name*: wfil-subgraph
65+
- *Subgraph version*: 1.0.0
66+
- *Subgraph target path*: Choose default or specify your own
67+
- *Contract ABI source*: path/to/wfil_abi.json
68+
- *Contract Address*: `0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4`
69+
- *Contract network*: filecoin-testnet
70+
- *Start block*: which block is the wfil created, can be 0.
71+
- *Contract name*: wfil
72+
- *Enable subgraph call handlers?*: no
73+
74+
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.
75+
76+
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/).
77+
78+
### Query the Subgraph
79+
Use the provided GraphQL endpoint to query the subgraph.
80+
81+
For example:
82+
```
83+
{
84+
transfers(
85+
where: {from: "0xf49d33f54ce41354dcd7e698aa54256781a6dd30"}
86+
orderBy: timestamp_
87+
orderDirection: desc
88+
first: 10
89+
) {
90+
id
91+
from
92+
to
93+
amount
94+
timestamp_
95+
}
96+
}
97+
```
98+
Use the Goldsky Playground or integrate it into your app to consume indexed data.
2299
## The Graph
23100

24101
[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.

0 commit comments

Comments
 (0)