The Cosmos Indexer is an open-source application designed to index a Cosmos chain to a generalized Transaction/Event DB schema. Its mission is to offer a flexible DB schema compatible with all Cosmos SDK Chains while simplifying the indexing process to allow developers flexible ways to store custom indexed data.
You can use our docker-compose
file for a quick demo of how to run the indexer, DB, web client, and UI.
docker compose up
Keep an eye on the output for the index and access the web server through the provided link.
It's indexing time! Follow the steps below to get started.
Before you can start indexing a chain, you need to set up the application's dependencies:
The application requires a PostgreSQL server with an established database and an owner user/role with password login. Here's a simple example of setting up a containerized database locally here.
The application is written in Go, so you need to build it from source. This requires a system installation of at minimum Go 1.19. Instructions for installing and configuring Go can be found here.
You are now ready to index and query the chain. For detailed steps, check out the Indexing and Querying sections below.
The Cosmos Indexer tool provides several settings and commands which are accessible via a config file or through CLI flags. You can learn about the CLI flags and their function by running go run main.go
to display the application help text.
For more detailed information on the settings, refer to the Config section.
The config file, used to set up the Cosmos Tax CLI tool, is broken into four main
sections:
The Log section covers settings related to logging levels and formats, including log file paths and whether to use ZeroLog's pretty logging.
The Database section defines the settings needed to connect to the database server and to configure the logging level of the ORM.
The Base section contains the core settings for the tool, such as API endpoints, block ranges, indexing behavior, and more.
The probe section configures probe used by the tool to read data from the blockchain. This is built into the application and doesn't need to be installed separately.
For detailed descriptions of each setting in these sections, please refer to the Detailed Config Explanation section below.
This section provides an in-depth description of each setting available in the config file. For further details, refer to the inline documentation within the config file.