Skip to content
Cosmopediaby Unity Nodes
DiscussionsFAQ & GuidesIndexation of the blockchains dataForum ↗

Indexation of the blockchains data

FAQ & Guides6 posts289 views3 likesLast activity Sep 2025
SU
subhan_memonOP
Jun 2025 2

Best Practices for Indexing Chain Data for a Custom Explorer?

Hey everyone,

My friend and I are building our own explorer for a Cosmos-based chain, and we’re debating the best approach to indexing chain data. We’d love your input!

My approach:

I think we should fetch raw transactions from each block, decode them, and then dynamically index the events into our databases using a single script that handles fetching, decoding, and indexing.

My friend’s approach:

He suggests we should index data by querying each module separately (e.g., bank, staking, etc.), then index those results into our databases—essentially having separate scripts or processes for each module.

Our main questions:

  • Which approach is more scalable and maintainable in the long run?

  • What’s considered best practice or industry standard for Cosmos-based explorers?

  • Are there any tools, libraries, or frameworks you’d recommend for either approach?

Would love to hear your experiences, recommendations, or any pitfalls to watch out for!

Thanks in advance :rocket:

NI
Nick_M
Jun 2025

We need more data — where and what you want to store, how to retrieve the data, and so on.
But for now, I can say that it’s better to work with separate modules for data retrieval and export.
You can also use versions of AVL trees to update data in the database.

SU
subhan_memon
Jun 2025

I wanted to store most of the data which is persent on the explorers.

DU
dutouzi
Sep 2025

it’s better to work with separate modules for data retrieval and export

Nick_M:
KE
kelvin
Sep 2025

Cool project! From what I’ve seen, most explorers lean toward your friend’s approach, indexing per module makes it easier to scale and maintain as the chain evolves. A single script can get messy once you start dealing with upgrades or custom modules. You might want to check out CosmJS and some of the existing indexers like Big Dipper or SubQuery for ideas.

SE
serejandmyself
Sep 2025 1

if you need an indexer, let me know. its open source

← Back to Discussions