SubQuery Developer Update: October

SubQuery is a fast & flexible blockchain indexing toolkit that powers hundreds of teams on Polkadot, Avalanche, Algorand, and Cosmos. We help developers focus on their core product, rather than waste time and money building their own indexing solution.

In our latest Developer Update we highlight new technical improvements to make your indexing even smoother & faster!

  • Timestamp Handler to index on a scheduled basis
  • Faster indexing with support for Indexing Unfinalized Blocks
  • Reindexing from specific blockheight
  • Improvements to our CLI tool to allow customers to automate deployments
  • Plus many other minor improvements

Timestamp Handler Update

The timestamp filter is very useful when indexing block data with specific time intervals between them, e.g. when you are aggregating data on an hourly/daily basis. It can be also used to set a delay between calls to blockHandler functions to reduce the computational costs of this handler. You can also use the modulo filter to run a handler only once to a specific block. This filter allows handling any given number of blocks.

Note that this feature works only for Polkadot right now. We will be adding support for other chains depending on demand. If you'd like us to add support on another chain, let us know!

Documentationopen in new window and GitHubopen in new window

Indexing Blocks Before They're Finalised! [Beta]

On some networks like Substrate, blocks go through a process before they are finalised and become considered immutable or final. During this time, the chain will compare candidate blocks and agree on what block to finalise and save immutably with the chain.

Most indexing solutions wait till blocks are finalised to start indexing data. Now that SubQuery automatically keeps the historical state, we also have the ability to index blocks that are unfinalised and roll changes back when forks occur.

This means that SubQuery is the fastest indexer out there (in terms of time between something happening on-chain and it being ready to be indexed). In the case of Polkadot, it means that instead of waiting 18-24 seconds for blocks to be finalised, data will appear in SubQuery nearly instantaneously as the candidate blocks are added.

In order to achieve this, we have added a new parameter; - unfinalized, that enables users to show indexed data from blocks that have not even been finalised! This is a beta release and we are still optimising the codebase, at the moment it is only available on Substrate/Polkadot chains.

Documentationopen in new window and GitHubopen in new window

Reindex from Blockheight

The reindex command allows you to rewind your project back to a specific block height by leveraging our automated historical indexingopen in new window. A perfect example of this would be to go back in time to when a change occurs to your smart contracts, and then update your project to reflect that change, and then to continue to index using the correct data from that point in time.

Documentationopen in new window and GitHubopen in new window

Improvements to our CLI tool to allow customers to automate deployments

Most customers use the @subql/cliopen in new window to just initialize, build, and run their project locally, however the CLI can be used to do a whole lot more! You can now use the CLI to do the following:

  • Create a new project on the SubQuery Managed Service
  • Deploy a new version of your SubQuery project to the Managed Service
  • Promote a staging deployment to the production slot in the SubQuery Managed Service
  • and more!

Even better, we've added a Default GitHub Action Workflow to the starter project in GitHubopen in new window that will allow you to publish and deploy your changes automatically.

Documentationopen in new window and GitHubopen in new window

Support for new Cosmos Chains

We now have starter projectsopen in new window running for:

  • Cosmos Hub
  • Cronos EVM (ethermint)
  • Juno
  • Osmosis
  • Stargaze

Other Improvements

You can take advantage of SubQuery's enterprise-level Managed Serviceopen in new window to see all these UI updates plus options for dedicated databases, automated deployments, and geographic routing to multiple clusters around the world for performance and uptime. Head to SubQuery Projectsopen in new window to get started or reach out to if you'd like a demo first.

Key Resources

About SubQuery

SubQueryopen in new window is the universal data indexing toolkit facilitating the construction of Web3 applications of the future. A SubQuery project is a complete API to organise and query data from Layer-1 chains. Currently servicing Polkadot, Avalanche, Algorand, and Cosmos projects, this data-as-a-service allows developers to focus on their core use case and front-end without wasting time building a custom backend for data processing activities. In the future, the SubQuery Network intends to replicate this scalable and reliable solution in a completely decentralised manner.

​​Linktreeopen in new window | Websiteopen in new window | Discordopen in new window | Telegramopen in new window | Twitteropen in new window | Matrixopen in new window | LinkedInopen in new window | YouTubeopen in new window

Last Updated:
Contributors: James Bayly