Substreams Support for MANTRA Chain

Now devs building on MANTRA can use Substreams and Substreams-powered Subgraphs on The Graph!
Published on
December 6, 2024

Substreams, developed for The Graph, has added another non-EVM blockchain: MANTRA!  Now devs building on MANTRA can use Substreams and Substreams-powered Subgraphs on The Graph!

Introducing MANTRA Chain

MANTRA Chain is a purpose-built layer 1 blockchain for tokenized Real-World Assets. Fully interoperable with the other Cosmos blockchains through the IBC module, MANTRA is both Cosmos- and Ethereum-compatible, providing developers from across the blockchain stack with ease of use, great speed, full transparency, and now the most performant data indexing stack available. 

MANTRA Chain’s mission is to provide a permissionless blockchain for permissioned applications. With a focus on the Real World Asset market, MANTRA offers users a compliant and frictionless method to transfer full or fractional ownership of diverse assets across various jurisdictions and blockchain ecosystems. 

Why Substreams

Built by StreamingFast, a core developer of The Graph, Substreams are a programmable data stream offering high-throughput and sink-agnostic features.

  • Stream Reliably in Real-Time: Low-latency gRPC stream (backed by the Firehose) that is cursor managed to handle reorgs and eliminate the unreliability of RPCs. 
  • Parallelized Back-Process: Significantly reduces indexing times, enabling the processing of entire blockchains within just a few hours.
  • Extract Complex Insights: With native filtering, aggregation, and composability both historical and in real-time, easily extract insights at scale. 
  • Sink Anywhere: Substreams enable seamless integration of data with any storage or interface environment, including subgraphs, SQL databases, or direct gRPC streaming.
  • DevEx: Codegen tools, all dependencies installed, integrated decodings, a GUI, and Studio or local Graph Node deployments.

Substreams and its sinks can be easily developed and tested within the Dev Container. To get started with Substreams, follow the MANTRA events path. It will walk you through using code-generation tools to initialize a Substreams project within the Dev Container.


Getting Started Using MANTRA Subgraphs On The Graph

The Graph provides a decentralized protocol for indexing and querying blockchain data, making it an ideal choice for developers who want to build scalable applications without managing their own data infrastructure. Here’s how to get started building your first MANTRA Subgraph:

  1. Codegen your first Substreams using substreams init.
  2. Run substreams codegen subgraph within the Dev Container.
  3. Use AssemblyScript to create the data transformations (as any other subgraph).
  4. Define the API schema through GraphQL.
  5. Once complete, follow the on-screen steps to deploy to The Graph.

Conclusion

Adding support for MANTRA Chain is another important step toward decentralizing access to indexed web3 data. By combining the interoperability of MANTRA with the power of Substreams and Subgraphs, developers can now leverage The Graph to build performant and reliable dapps.

If you have any questions, feel free to reach out to us on our Discord server or The Graph Discord