Indexers

The Tezos RPC API exposes all the information you could possibly need to build applications using blockchain data, however, the RPC API alone might not be efficient for your particular use-case, this is where indexers come into play, here we are going to look at two different indexers for tezos.

Why

Generally all information about the blockchain is exposed in the RPC API, however the tezos node itself does not keep indexes ( used for fast lookup of data ) on some information you might need, for queries like “Get all transaction of this Contract” you need a different data structure than the node alone stores, here is what the RPC API looks like:

Ec2 Storage

If you were to draw a picture of the relationships of data exposed in the RPC API it might look something like this:

Ec2 Storage

In this Data Model you can go from left to right, so for example “Get all Contracts that have changed in this Block”, however you can’t easily go from right to left, as in “Get all Blocks that include transactions to this Contract” - you could do that by fetching the information of every single Block and see if it contains the information relevant, but this would be very inefficient.

Tezos Indexers take all of that information and save it to a database so that you can do much faster and complicated queries, hence the Data Model of these indexers will look a bit more interesting than this.

Indexers

Conseil

Source: https://github.com/Cryptonomic/Conseil

The most advanced query API for the Tezos blockchain, developed by Cryptonomics, requires a Postgres database.

Conseil`s API is described here:

https://github.com/Cryptonomic/Conseil/tree/master/doc

Tezos Indexer

Source: https://gitlab.com/nomadic-labs/tezos/tree/pw@indexer-mainnet-snapshots/src/bin_indexer

Tezos Indexer is a Project by Nomadic Labs and is written in OCaml.