diff --git a/docs/build/manifest/algorand.md b/docs/build/manifest/algorand.md index 56255664100..21955001266 100644 --- a/docs/build/manifest/algorand.md +++ b/docs/build/manifest/algorand.md @@ -222,7 +222,8 @@ Defines the data that will be filtered and extracted and the location of the map | Field | Type | Description | --------------- |-------------|-------------| | **kind** | String | [algorand/Runtime](#data-sources-and-mapping) | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data| +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | | **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/arbitrum.md b/docs/build/manifest/arbitrum.md index 4063a5370ba..089f255f597 100644 --- a/docs/build/manifest/arbitrum.md +++ b/docs/build/manifest/arbitrum.md @@ -254,11 +254,12 @@ There is only a dictionary for Arbitrum One `https://gx.api.subquery.network/sq/ Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------- | -| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for Arbitrum since it is compatible with the Ethereum framework_ | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for Arbitrum since it is compatible with the Ethereum framework_ | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/avalanche.md b/docs/build/manifest/avalanche.md index d7314842bc2..64800219d9d 100644 --- a/docs/build/manifest/avalanche.md +++ b/docs/build/manifest/avalanche.md @@ -261,11 +261,12 @@ Public nodes may be rate limited which can affect indexing speed, when developin Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | -| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for Avalanche since it is compatible with the Ethereum framework_ | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for Avalanche since it is compatible with the Ethereum framework_ | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/bsc.md b/docs/build/manifest/bsc.md index c071a4cb11b..84a705e10b3 100644 --- a/docs/build/manifest/bsc.md +++ b/docs/build/manifest/bsc.md @@ -252,11 +252,12 @@ Public nodes may be rate limited which can affect indexing speed, when developin Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------- | -| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for BSC since it is compatible with the Ethereum framework_ | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for BSC since it is compatible with the Ethereum framework_ | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/cosmos.md b/docs/build/manifest/cosmos.md index 495116d64e6..358bf70efeb 100644 --- a/docs/build/manifest/cosmos.md +++ b/docs/build/manifest/cosmos.md @@ -248,11 +248,12 @@ Public nodes may be rate limited which can affect indexing speed, when developin Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | --------------------------------------------------------------------------------------------- | -| **kind** | String | [cosmos/Runtime](#data-sources-and-mapping) | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | String | [cosmos/Runtime](#data-sources-and-mapping) | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/ethereum.md b/docs/build/manifest/ethereum.md index a2b2cbedb5b..8c8e9631fc1 100644 --- a/docs/build/manifest/ethereum.md +++ b/docs/build/manifest/ethereum.md @@ -248,11 +248,12 @@ Public nodes may be rate limited which can affect indexing speed, when developin Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | --------------------------------------------------------------------------------------------- | -| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/flare.md b/docs/build/manifest/flare.md index f5f03611dab..3280f96025d 100644 --- a/docs/build/manifest/flare.md +++ b/docs/build/manifest/flare.md @@ -157,11 +157,12 @@ Public nodes may be rate limited which can affect indexing speed, when developin Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | --------------------------------------------------------------------------------------------- | -| **kind** | string | [flare/Runtime](#data-sources-and-mapping) | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | string | [flare/Runtime](#data-sources-and-mapping) | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/gnosis.md b/docs/build/manifest/gnosis.md index aa5b534e04d..d47365f48f0 100644 --- a/docs/build/manifest/gnosis.md +++ b/docs/build/manifest/gnosis.md @@ -263,11 +263,12 @@ There is a dictionary for Gnosis which is `https://api.subquery.network/sq/subqu Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | -| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for Gnosis since it is compatible with the Ethereum framework_ | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for Gnosis since it is compatible with the Ethereum framework_ | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/near.md b/docs/build/manifest/near.md index a14f7a831ce..62216998c08 100644 --- a/docs/build/manifest/near.md +++ b/docs/build/manifest/near.md @@ -262,11 +262,12 @@ Public nodes may be rate limited which can affect indexing speed, when developin Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | --------------------------------------------------------------------------------------------- | -| **kind** | String | [near/Runtime](#data-sources-and-mapping) | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | String | [near/Runtime](#data-sources-and-mapping) | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/optimism.md b/docs/build/manifest/optimism.md index cf2b639584c..acd9e5cf17e 100644 --- a/docs/build/manifest/optimism.md +++ b/docs/build/manifest/optimism.md @@ -260,11 +260,12 @@ There is a dictionary for Optimism which is `https://api.subquery.network/sq/sub Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------- | -| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for Optimism since it is compatible with the Ethereum framework_ | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for Optimism since it is compatible with the Ethereum framework_ | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/polkadot.md b/docs/build/manifest/polkadot.md index b69574f4fc4..da625413087 100644 --- a/docs/build/manifest/polkadot.md +++ b/docs/build/manifest/polkadot.md @@ -222,11 +222,12 @@ Public nodes may be rate limited which can affect indexing speed, when developin Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | --------------------------------------------------------------------------------------------- | -| **kind** | String | [substrate/Runtime](#data-sources-and-mapping) | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | String | [substrate/Runtime](#data-sources-and-mapping) | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/polygon.md b/docs/build/manifest/polygon.md index 9ded814d12e..dc77b059350 100644 --- a/docs/build/manifest/polygon.md +++ b/docs/build/manifest/polygon.md @@ -253,11 +253,12 @@ Public nodes may be rate limited which can affect indexing speed, when developin Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for Polygon since it is compatible with the Ethereum framework_ | -| **startBlock** | Integer | This changes your indexing start block, set this higher to skip initial blocks with less data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | string | [ethereum/Runtime](#data-sources-and-mapping) _We use the Ethereum runtime for Polygon since it is compatible with the Ethereum framework_ | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/build/manifest/stellar.md b/docs/build/manifest/stellar.md index a421a8ba63c..e3daf3d3b5d 100644 --- a/docs/build/manifest/stellar.md +++ b/docs/build/manifest/stellar.md @@ -249,11 +249,12 @@ Public nodes may be rate limited which can affect indexing speed, when developin Defines the data that will be filtered and extracted and the location of the mapping function handler for the data transformation to be applied. -| Field | Type | Description | -| -------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | -| **kind** | string | [stellar/Runtime](#data-sources-and-mapping) | -| **startBlock** | Integer | This changes your indexing start block (called a Ledger on Stellar), set this higher to skip initial blocks/ledgers with no relevant data | -| **mapping** | Mapping Spec | | +| Field | Type | Description | +| -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **kind** | string | [stellar/Runtime](#data-sources-and-mapping) | +| **startBlock** | Integer | This changes your indexing start block for this datasource, set this as high as possible to skip initial blocks with no relevant data | +| **endBlock** | Integer | This sets a end block for processing on the datasource. After this block is processed, this datasource will no longer index your data.

Useful when your contracts change at a certain block height, or when you want to insert data at genesis. For example, setting both the `startBlock` and `endBlock` to 320, will mean this datasource only operates on block 320 | +| **mapping** | Mapping Spec | | ### Mapping Spec diff --git a/docs/faqs/faqs.md b/docs/faqs/faqs.md index dce0243ee97..23b03a864aa 100644 --- a/docs/faqs/faqs.md +++ b/docs/faqs/faqs.md @@ -25,6 +25,38 @@ You can see examples of the new manifest in the Build > Manifest section of this For Cosmos projects, in the new Typescript manifest, `chainTypes` have been renamed to `chaintypes`. +## Inserting Seed Data at Project Initiation + +Some customers would like to insert specific data into the store, or initiate the database state correctly, when they start their project and begin indexing for the first time. + +The best way to do this is use a combination of `startBlock`, `endBlock`, and a block handler like as follows in your project manifest. In the below example, the `initiateStoreAndDatabase` mapping function will be run once and once only on block 320 (this could be the block that your contract was deployed on): + +```ts +{ + dataSources: [ + { + // Project initiation/genesis datasource + kind: EthereumDatasourceKind.Runtime, + startBlock: 320, // Set this and the endBlock to whatever block you want it to be run on + endBlock: 320, + mapping: { + file: "./dist/index.js", + handlers: [ + { + kind: EthereumHandlerKind.Block, + handler: "initiateStoreAndDatabase", + } + ], + }, + }, + // Add other handlers for regular indexing after this + { + ... + } + ], +} +``` + ## What is SubQuery? SubQuery is an open source blockchain data indexer for developers that provides fast, flexible, reliable, and decentralised APIs to power leading multi-chain apps.