From 67818008671548192272afe83d43f47320070b9f Mon Sep 17 00:00:00 2001 From: Scott Twiname Date: Thu, 6 Mar 2025 11:43:15 +1300 Subject: [PATCH] Document skip transactions feature --- docs/indexer/build/optimisation.md | 1 + docs/indexer/run_publish/references.md | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/indexer/build/optimisation.md b/docs/indexer/build/optimisation.md index 06f01ec2dd1..f7c298e20e3 100644 --- a/docs/indexer/build/optimisation.md +++ b/docs/indexer/build/optimisation.md @@ -17,6 +17,7 @@ If you're looking for advice on how to run high performance SubQuery infrastruct - Use a convenient `modulo` filter to run a handler only once to a specific block. This filter allows handling any given number of blocks, which is extremely useful for grouping and calculating data at a set interval. For instance, if modulo is set to 50, the block handler will run on every 50 blocks. It provides even more control over indexing data to developers. - For all major chains we already [provide valid SubQuery dictionaries](https://github.com/subquery/templates/blob/main/dist/dictionary.json), but if you’re indexing a custom chain, you may want to implement your own [dictionary](../academy/tutorials_examples/dictionary.html#how-does-a-subquery-dictionary-work) project to speed up your indexer (we can help create one for your new network). You can see examples of how to create a dictionary in the [dictionary repository](https://github.com/subquery/subql-dictionary). - Use the strictest possible filter conditions in your mapping handlers (within the project manifest) to reduce the number of events/transactions that need to be processed. Create filters as specific as possible to avoid querying unnecessary data. +- If your project contains only event/log handlers and you don't need the transactions data, you can use the `skipTransactions` flag which will skip fetching the transactions. (Only supported with Ethereum and Substrate SDKs). - Set the start block in your project manifest to when the contract was initialised or, better yet, when the first event/transaction occurs. - Use `node worker threads` to move block fetching and block processing into its own worker thread. It could speed up indexing by up to 4 times (depending on the particular project). You can easily enable it using the `-workers=` flag. Note that the number of available CPU cores strictly limits the usage of worker threads. [Read more here](../run_publish/references.html#w-workers). diff --git a/docs/indexer/run_publish/references.md b/docs/indexer/run_publish/references.md index 566d8f74096..2435aca43ad 100644 --- a/docs/indexer/run_publish/references.md +++ b/docs/indexer/run_publish/references.md @@ -140,11 +140,12 @@ subql-node -f . --db-schema=test2 ### -f, --subquery -**Boolean** - Use this flag to start the SubQuery project. +**String (default: current working directory)** - The path to the subquery project directory or project manifest. ```shell subql-node -f . // OR subql-node --subquery . +subql-node -f ~/Path/To/Your/Project ``` ### force-clean @@ -300,6 +301,10 @@ subql-node reindex -f /example/subql-project --targetHeight=30 Once the command is executed and the state has been rolled back to the specified height, the application will exit. You can then start up the indexer to proceed again from this height. ::: +### --skip-transactions + +**Boolean** - This flag allows you to skip fetching transactions when indexing in order to increase speed. This is useful when you only need to index events/logs. Only supported with Ethereum and Substrate SDKs. + ### --scale-batch-size **Boolean** - Scale the block fetch batch size with memory usage. @@ -320,6 +325,10 @@ Once the command is executed and the state has been rolled back to the specified **Positive Integer (default: `5`)** - The interval, in seconds, at which data is flushed from the cache. This ensures that data is persisted regularly when there is either not much data or the project is up to date. +### --store-cache-target + +**Positive Integer (default: `10`)** - When the indexer is within this many blocks of the chain head, then data is flushed after indexing every block. This makes data available to be queried quicker. + ### --subscription **Boolean** - This will create a notification trigger on entity, this also is the prerequisite to enable subscription feature in query service. You should also enable [--subscription for the query service](#subscription-1).