How to setup Indexer with Node using Fast Catchup

Hi everybody,

I got this error message when I start my Indexer

$ algorand-indexer daemon -P "host=localhost port=5432 user=postgres password=eb@2021 dbname=ledgerdb sslmode=disable" --algod=/home/beobeo/node/datafastcatchup

Error message: 
{"level":"info","msg":"Initializing block import handler.","time":"2021-06-16T08:42:06Z"}
serving on :8980
{"level":"info","msg":"Running 0 migrations.","time":"2021-06-16T08:42:06Z"}
{"level":"info","msg":"Setting status: Migrations Complete","time":"2021-06-16T08:42:06Z"}
{"level":"info","msg":"Migration finished successfully.","time":"2021-06-16T08:42:06Z"}
{"level":"info","msg":"Block importer waiting for database to become available.","time":"2021-06-16T08:42:06Z"}
{"level":"info","msg":"serving on :8980","time":"2021-06-16T08:42:06Z"}
⇨ http server started on [::]:8980
{"level":"info","msg":"Starting block importer.","time":"2021-06-16T08:42:11Z"}
{"error":"HTTP 500: {\"message\":\"ledger does not have entry 1 (latest 14810613, committed 14810613)\"}\n","level":"error","msg":"catchup block 1","time":"2021-06-16T08:42:11Z"}
{"error":"HTTP 500: {\"message\":\"ledger does not have entry 1 (latest 14810613, committed 14810613)\"}\n","level":"error","msg":"r=0 err getting block 1","time":"2021-06-16T08:42:11Z"}
{"error":"HTTP 500: {\"message\":\"ledger does not have entry 1 (latest 14810613, committed 14810613)\"}\n","level":"error","msg":"r=1 err getting block 1","time":"2021-06-16T08:42:11Z"}
{"error":"HTTP 500: {\"message\":\"ledger does not have entry 1 (latest 14810613, committed 14810613)\"}\n","level":"error","msg":"r=2 err getting block 1","time":"2021-06-16T08:42:11Z"}

Please help me to resolve this problem.
Also, I don’t know how data can be sync from Algo Node into Postgres Indexer? Anyone can explain to me, please.
Thanks!

To have all the block data for an indexer, the node must be set up as an archival node, which does not support fast catchup.

This is just a config setting in your config.json for your node:

This will take many days to synch the entire chain, but you should be able to start synching your indexer while your archive node is synching.

Thank u so much! I setup it successfully.

Hi! I am trying to set up my node to where it would be able to read any transaction in the blockchain without having to store the whole ledger in my local database. I was wondering if that what you were trying to do, and if yes, have you been able to find a way to do so?

As I know no way to do it.

so, just for clarification, if I understand correctly:

ledger : the sheet of balances for each account.
blockchain: the historical record of all the transaction ever occurred.

Keep in mind that the size of the blockchain is by several magnitudes greater than the size of the ledger.
Also, the node itself ( even an archival node ), doesn’t maintain any indices on the blocks its storing ( for efficiency reasons ). Instead, uses that needs that functionality are encourages to use the indexer.

I think what I meant was blockchain. My main goal is to be able to read any transaction that I made regardless how old the transaction is. I want to utilize the blockchain by using the note field to fetch an important information along with the transaction (within a private network). Context is using it in a banking network

The short answer is that you’ll need an indexer for that. As a prerequisite for the indexer, you’ll need to have a full archival node along with a ledger, and there are no workaround that.

The node itself would not have the proper data structure that would allow you to read an arbitrary transaction, or even iterate on the transactions themselves. The indexer is what you’re looking for. It index transaction and let you retrieve historical transactions quickly and efficiently.