Skip to content

Commit 3309a8f

Browse files
stwinameCopilotianhe8x
authored
Restructure SDK build section (#667)
* WIP restructure build part of SDK * Update manifest docs and further clean up * Fix broken links * Update docs/indexer/build/mapping-functions/introduction.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update docs/indexer/build/mapping-functions/introduction.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update docs/indexer/build/mapping-functions/introduction.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update docs/indexer/build/mapping-functions/mapping/stellar.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update docs/indexer/build/mapping-functions/mapping/algorand.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix link * Fix broken links * Use variable for CloudFront distribution ID * add redirects - fix per comment * fix broken links * fix per comment * fix per comment * fix per comment --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ian He <39037239+ianhe8x@users.noreply.github.com>
1 parent d65baf6 commit 3309a8f

File tree

128 files changed

+3739
-7342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+3739
-7342
lines changed

.github/workflows/deploy-staging.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ jobs:
3838
- name: Invalidate CloudFront
3939
uses: chetan/invalidate-cloudfront-action@v2
4040
env:
41-
DISTRIBUTION: GNUAPE6SUDC4
41+
DISTRIBUTION: ${{ vars.CF_DISTRIBUTION_DEV }}
4242
PATHS: "/*"
4343
AWS_REGION: "us-east-1"
4444
AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID_V2 }}
45-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_V2 }}
45+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_V2 }}

docs/.vuepress/config.ts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,66 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
203203
"/subquery_network/governance/foundation.html",
204204
"/indexer/run_publish/publish.html":
205205
"/indexer/run_publish/introduction.html",
206+
207+
// Restructured SDK build redirects
208+
"/indexer/build/cosmos-evm.html":
209+
"/indexer/build/datasource-processors/cosmos-evm.html",
210+
"/indexer/build/substrate-evm.html":
211+
"/indexer/build/datasource-processors/substrate-evm.html",
212+
"/indexer/build/substrate-wasm.html":
213+
"/indexer/build/datasource-processors/substrate-wasm.html",
214+
"/indexer/build/dynamicdatasources.html":
215+
"/indexer/build/dynamic-datasources.html",
216+
"/indexer/build/graphql.html":
217+
"/indexer/build/graphql/reference.html",
218+
219+
// Manifest redirects to introduction
220+
"/indexer/build/manifest/algorand.html":
221+
"/indexer/build/manifest/chain-specific/algorand.html",
222+
"/indexer/build/manifest/arbitrum.html":
223+
"/indexer/build/manifest/chain-specific/ethereum.html",
224+
"/indexer/build/manifest/avalanche.html":
225+
"/indexer/build/manifest/chain-specific/ethereum.html",
226+
"/indexer/build/manifest/bsc.html":
227+
"/indexer/build/manifest/chain-specific/ethereum.html",
228+
"/indexer/build/manifest/concordium.html":
229+
"/indexer/build/manifest/chain-specific/concordium.html",
230+
"/indexer/build/manifest/cosmos.html":
231+
"/indexer/build/manifest/chain-specific/cosmos.html",
232+
"/indexer/build/manifest/flare.html":
233+
"/indexer/build/manifest/chain-specific/ethereum.html",
234+
"/indexer/build/manifest/gnosis.html":
235+
"/indexer/build/manifest/chain-specific/ethereum.html",
236+
"/indexer/build/manifest/near.html":
237+
"/indexer/build/manifest/chain-specific/near.html",
238+
"/indexer/build/manifest/optimism.html":
239+
"/indexer/build/manifest/chain-specific/ethereum.html",
240+
"/indexer/build/manifest/polkadot.html":
241+
"/indexer/build/manifest/chain-specific/polkadot.html",
242+
"/indexer/build/manifest/polygon.html":
243+
"/indexer/build/manifest/chain-specific/ethereum.html",
244+
"/indexer/build/manifest/solana.html":
245+
"/indexer/build/manifest/chain-specific/solana.html",
246+
"/indexer/build/manifest/starknet.html":
247+
"/indexer/build/manifest/chain-specific/starknet.html",
248+
"/indexer/build/manifest/stellar.html":
249+
"/indexer/build/manifest/chain-specific/stellar.html",
250+
251+
// Mapping redirects to new structure
252+
"/indexer/build/mapping/arbitrum.html":
253+
"/indexer/build/mapping-functions/mapping/ethereum.html",
254+
"/indexer/build/mapping/avalanche.html":
255+
"/indexer/build/mapping-functions/mapping/ethereum.html",
256+
"/indexer/build/mapping/bsc.html":
257+
"/indexer/build/mapping-functions/mapping/ethereum.html",
258+
"/indexer/build/mapping/flare.html":
259+
"/indexer/build/mapping-functions/mapping/ethereum.html",
260+
"/indexer/build/mapping/gnosis.html":
261+
"/indexer/build/mapping-functions/mapping/ethereum.html",
262+
"/indexer/build/mapping/optimism.html":
263+
"/indexer/build/mapping-functions/mapping/ethereum.html",
264+
"/indexer/build/mapping/polygon.html":
265+
"/indexer/build/mapping-functions/mapping/ethereum.html",
206266
};
207267
return {
208268
...redirects,

docs/.vuepress/sidebar.ts

Lines changed: 68 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -446,61 +446,87 @@ export const getSidebar = (locale: string) =>
446446
`${locale}/indexer/build/introduction.md`,
447447
`${locale}/indexer/build/install.md`,
448448
{
449-
text: "Manifest File",
449+
text: "Project Manifest",
450450
collapsible: true,
451+
link: `${locale}/indexer/build/manifest/introduction`,
451452
children: [
452-
`${locale}/indexer/build/manifest/avalanche.md`,
453-
`${locale}/indexer/build/manifest/algorand.md`,
454-
`${locale}/indexer/build/manifest/arbitrum.md`,
455-
`${locale}/indexer/build/manifest/bsc.md`,
456-
`${locale}/indexer/build/manifest/concordium.md`,
457-
`${locale}/indexer/build/manifest/cosmos.md`,
458-
`${locale}/indexer/build/manifest/ethereum.md`,
459-
`${locale}/indexer/build/manifest/flare.md`,
460-
`${locale}/indexer/build/manifest/gnosis.md`,
461-
`${locale}/indexer/build/manifest/near.md`,
462-
`${locale}/indexer/build/manifest/optimism.md`,
463-
`${locale}/indexer/build/manifest/polkadot.md`,
464-
`${locale}/indexer/build/manifest/polygon.md`,
465-
`${locale}/indexer/build/manifest/solana.md`,
466-
`${locale}/indexer/build/manifest/starknet.md`,
467-
`${locale}/indexer/build/manifest/stellar.md`,
453+
`${locale}/indexer/build/manifest/introduction.md`,
454+
{
455+
text: "Chain Specific Manifests",
456+
collapsible: true,
457+
children: [
458+
`${locale}/indexer/build/manifest/chain-specific/ethereum.md`,
459+
`${locale}/indexer/build/manifest/chain-specific/algorand.md`,
460+
`${locale}/indexer/build/manifest/chain-specific/concordium.md`,
461+
`${locale}/indexer/build/manifest/chain-specific/cosmos.md`,
462+
`${locale}/indexer/build/manifest/chain-specific/near.md`,
463+
`${locale}/indexer/build/manifest/chain-specific/polkadot.md`,
464+
`${locale}/indexer/build/manifest/chain-specific/solana.md`,
465+
`${locale}/indexer/build/manifest/chain-specific/starknet.md`,
466+
`${locale}/indexer/build/manifest/chain-specific/stellar.md`,
467+
],
468+
},
469+
],
470+
},
471+
{
472+
text: "GraphQL Schema",
473+
collapsible: true,
474+
link: `${locale}/indexer/build/graphql/reference`,
475+
children: [
476+
`${locale}/indexer/build/graphql/reference.md`,
477+
`${locale}/indexer/build/graphql/codegen.md`,
478+
],
479+
},
480+
{
481+
text: "Mapping Functions",
482+
collapsible: true,
483+
link: `${locale}/indexer/build/mapping-functions/introduction`,
484+
children: [
485+
`${locale}/indexer/build/mapping-functions/introduction.md`,
486+
{
487+
text: "Chain Specific Mapping",
488+
collapsible: true,
489+
children: [
490+
`${locale}/indexer/build/mapping-functions/mapping/ethereum.md`,
491+
`${locale}/indexer/build/mapping-functions/mapping/algorand.md`,
492+
`${locale}/indexer/build/mapping-functions/mapping/concordium.md`,
493+
`${locale}/indexer/build/mapping-functions/mapping/cosmos.md`,
494+
`${locale}/indexer/build/mapping-functions/mapping/near.md`,
495+
`${locale}/indexer/build/mapping-functions/mapping/polkadot.md`,
496+
`${locale}/indexer/build/mapping-functions/mapping/solana.md`,
497+
`${locale}/indexer/build/mapping-functions/mapping/starknet.md`,
498+
`${locale}/indexer/build/mapping-functions/mapping/stellar.md`,
499+
],
500+
},
501+
{
502+
text: "Sandbox",
503+
collapsible: true,
504+
link: `${locale}/indexer/build/mapping-functions/sandbox/sandbox`,
505+
children: [
506+
`${locale}/indexer/build/mapping-functions/sandbox/sandbox.md`,
507+
`${locale}/indexer/build/mapping-functions/sandbox/cache.md`,
508+
`${locale}/indexer/build/mapping-functions/sandbox/querying-chain-state.md`,
509+
`${locale}/indexer/build/mapping-functions/sandbox/store.md`,
510+
],
511+
},
468512
],
469513
},
470-
`${locale}/indexer/build/graphql.md`,
471514
{
472-
text: "Mapping",
515+
text: "Data Source Processors",
473516
collapsible: true,
517+
link: `${locale}/indexer/build/datasource-processors/introduction`,
474518
children: [
475-
`${locale}/indexer/build/mapping/avalanche.md`,
476-
`${locale}/indexer/build/mapping/algorand.md`,
477-
`${locale}/indexer/build/mapping/arbitrum.md`,
478-
`${locale}/indexer/build/mapping/bsc.md`,
479-
`${locale}/indexer/build/mapping/concordium.md`,
480-
`${locale}/indexer/build/mapping/cosmos.md`,
481-
`${locale}/indexer/build/mapping/ethereum.md`,
482-
`${locale}/indexer/build/mapping/flare.md`,
483-
`${locale}/indexer/build/mapping/gnosis.md`,
484-
`${locale}/indexer/build/mapping/near.md`,
485-
`${locale}/indexer/build/mapping/optimism.md`,
486-
`${locale}/indexer/build/mapping/polkadot.md`,
487-
`${locale}/indexer/build/mapping/polygon.md`,
488-
`${locale}/indexer/build/mapping/solana.md`,
489-
`${locale}/indexer/build/mapping/starknet.md`,
490-
`${locale}/indexer/build/mapping/stellar.md`,
491-
`${locale}/indexer/build/mapping/cache.md`,
492-
`${locale}/indexer/build/mapping/store.md`,
493-
`${locale}/indexer/build/mapping/sandbox.md`,
519+
`${locale}/indexer/build/datasource-processors/introduction.md`,
520+
`${locale}/indexer/build/datasource-processors/substrate-evm.md`,
521+
`${locale}/indexer/build/datasource-processors/substrate-wasm.md`,
522+
`${locale}/indexer/build/datasource-processors/cosmos-evm.md`,
494523
],
495524
},
496525
`${locale}/indexer/build/testing.md`,
497526
`${locale}/indexer/build/graph-migration.md`,
498527
`${locale}/indexer/build/project-upgrades.md`,
499528
`${locale}/indexer/build/multi-chain.md`,
500-
`${locale}/indexer/build/dynamicdatasources.md`,
501-
`${locale}/indexer/build/substrate-evm.md`,
502-
`${locale}/indexer/build/substrate-wasm.md`,
503-
`${locale}/indexer/build/cosmos-evm.md`,
529+
`${locale}/indexer/build/dynamic-datasources.md`,
504530
`${locale}/indexer/build/optimisation.md`,
505531
],
506532
},
@@ -571,7 +597,6 @@ export const getSidebar = (locale: string) =>
571597
`${locale}/indexer/miscellaneous/faq.md`,
572598
`${locale}/indexer/miscellaneous/ai.md`,
573599
`${locale}/indexer/miscellaneous/ipfs.md`,
574-
`${locale}/indexer/miscellaneous/avalanche-eth-migration.md`,
575600
`${locale}/indexer/miscellaneous/env-support.md`,
576601
],
577602
},

docs/indexer/academy/tutorials_examples/dictionary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ This means that using a dictionary can reduce the amount of data that the indexe
4040

4141
## When is a dictionary NOT useful?
4242

43-
When [block handlers](../../build/mapping/polkadot.md#block-handler) are used to grab data from a chain, every block needs to be processed. Therefore, using a dictionary in this case does not provide any advantage and the indexer will automatically switch to the default non-dictionary approach.
43+
When [block handlers](../../build/mapping-functions/mapping/polkadot.md#block-handler) are used to grab data from a chain, every block needs to be processed. Therefore, using a dictionary in this case does not provide any advantage and the indexer will automatically switch to the default non-dictionary approach.
4444

4545
Also, when dealing with events or extrinsic that occur or exist in every block such as `timestamp.set`, using a dictionary will not offer any additional advantage.

docs/indexer/build/cosmos-evm.md renamed to docs/indexer/build/datasource-processors/cosmos-evm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
We provide a custom data source processor for [Cosmos's Ethermint EVM](https://github.com/cosmos/ethermint). This offers a simple way to filter and index both EVM and Cosmos activity on many Cosmos networks within a single SubQuery project.
44

55
::: tip Note
6-
Ethermint chains (e.g. Cronos) are usually fully EVM compatible, which means that you can use two options for indexing Ethermint data. You can index Ethermint contract data via the standard Cosmos RPC interface, or via Ethereum APIs. For Cronos, we provide a [starter project for each](https://github.com/subquery/cosmos-subql-starter/tree/main/Cronos) and you can compare the two different options in the [Cronos quick start guide](../quickstart/quickstart_chains/cosmos-cronos.md).
6+
Ethermint chains (e.g. Cronos) are usually fully EVM compatible, which means that you can use two options for indexing Ethermint data. You can index Ethermint contract data via the standard Cosmos RPC interface, or via Ethereum APIs. For Cronos, we provide a [starter project for each](https://github.com/subquery/cosmos-subql-starter/tree/main/Cronos) and you can compare the two different options in the [Cronos quick start guide](../../quickstart/quickstart_chains/cosmos-cronos.md).
77

88
This document goes into detail about how to use the Ethermint Cosmos RPCs (rather than the Ethereum API)
99
:::
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Introduction
2+
3+
Many blockchains have different VMs or runtimes that allow execution of smart contracts. Some of these are wide spread such as EVM, while others are more niche such as WASM. To make it easier to index these runtimes we have created a number of datasource processors that can be used in your SubQuery project.
4+
These processors make it easier to filter and extract the data from these runtimes.
5+
6+
We have a number of processors available in the [datasource-processors repository](https://github.com/subquery/datasource-processors). There is specific documentation for the following processors:
7+
* [Substrate EVM](./substrate-evm.md) - Also known as Frontier EVM
8+
* [Substrate Wasm](./substrate-wasm.md)
9+
* [Cosmos EVM](./cosmos-evm.md)
10+
11+
::: note
12+
These processors are good when you need data from within the runtime as well as data from the base chain. If you just need EVM data you can use the Ethereum SDK for more features, better performance and easier development.
13+
:::

docs/indexer/build/substrate-evm.md renamed to docs/indexer/build/datasource-processors/substrate-evm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const project: SubstrateProject<FrontierEvmDatasource> = {
9999

100100
## Call Handlers
101101

102-
Works in the same way as [substrate/CallHandler](../build/mapping/polkadot.md#call-handler) except with a different handler argument and minor filtering changes.
102+
Works in the same way as [substrate/CallHandler](../mapping-functions/mapping/polkadot.md#call-handler) except with a different handler argument and minor filtering changes.
103103

104104
| Field | Type | Required | Description |
105105
| ------ | ------------------------------------------------------- | -------- | ------------------------------------------ |
@@ -125,7 +125,7 @@ Changes from the `TransactionResponse` type:
125125

126126
## Event Handlers
127127

128-
Works in the same way as [substrate/EventHandler](../build/mapping/polkadot.md#event-handler) except with a different handler argument and minor filtering changes.
128+
Works in the same way as [substrate/EventHandler](../mapping-functions/mapping/polkadot.md#event-handler) except with a different handler argument and minor filtering changes.
129129

130130
| Field | Type | Required | Description |
131131
| ------ | --------------------------------------------------------- | -------- | -------------------------------------------- |

docs/indexer/build/substrate-wasm.md renamed to docs/indexer/build/datasource-processors/substrate-wasm.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
We provide a custom data source processor for [Substrate WASM contract](https://ink.substrate.io/why-webassembly-for-smart-contracts). This offers a simple way to filter and index both WASM and Substrate activity on many Polkadot networks within a single SubQuery project.
44

55
:::warning Check out the Quick Start Guide
6-
There is a [friendly quick start guide that introduces SubQuery's Substrate WASM support by using an example project in Astar Network](../quickstart/quickstart_chains/polkadot-astar.md). This guide covers most of the topics shown in the following guide in a format more easy to understand. You can return here when you need specific technical support for the Substrate WASM data source processor.
6+
There is a [friendly quick start guide that introduces SubQuery's Substrate WASM support by using an example project in Astar Network](../../quickstart/quickstart_chains/polkadot-astar.md). This guide covers most of the topics shown in the following guide in a format more easy to understand. You can return here when you need specific technical support for the Substrate WASM data source processor.
77
:::
88

9-
**You can also refer to the basic [Substrate WASM](../quickstart/quickstart_chains/polkadot-astar.md) example projects with an event and call handler.** This project is also hosted live in the SubQuery Explorer [here](https://explorer.subquery.network/subquery/subquery/tutorial-substrate-wasm-starter).
9+
**You can also refer to the basic [Substrate WASM](../../quickstart/quickstart_chains/polkadot-astar.md) example projects with an event and call handler.** This project is also hosted live in the SubQuery Explorer [here](https://explorer.subquery.network/subquery/subquery/tutorial-substrate-wasm-starter).
1010

1111
## Getting started
1212

@@ -58,7 +58,7 @@ const project: SubstrateProject<WasmDatasource> = {
5858

5959
## Call Handlers
6060

61-
Works in the same way as [substrate/CallHandler](../build/mapping/polkadot.md#call-handler) except with a different handler argument and minor filtering changes.
61+
Works in the same way as [substrate/CallHandler](../mapping-functions/mapping/polkadot.md#call-handler) except with a different handler argument and minor filtering changes.
6262

6363
| Field | Type | Required | Description |
6464
| ------ | --------------------------------------------- | -------- | ------------------------------------------- |
@@ -119,7 +119,7 @@ export async function handleWasmCall(
119119

120120
## Event Handlers
121121

122-
Works in the same way as [substrate/EventHandler](../build/mapping/polkadot.md#event-handler) except with a different handler argument and minor filtering changes.
122+
Works in the same way as [substrate/EventHandler](../mapping-functions/mapping/polkadot.md#event-handler) except with a different handler argument and minor filtering changes.
123123

124124
| Field | Type | Required | Description |
125125
| ------ | ------------------------------ | -------- | -------------------------------------------- |
@@ -228,4 +228,4 @@ This is an extract from the `project.ts` manifest file.
228228

229229
## Known Limitations
230230

231-
- Does not support [dynamic datasources](../build/dynamicdatasources.md) at the moment, which means we are unable to import and handle contracts dynamically.
231+
- Does not support [dynamic datasources](../dynamic-datasources.md) at the moment, which means we are unable to import and handle contracts dynamically.

0 commit comments

Comments
 (0)