We are working on a project which would require to know some account information at a given ledger number (data fields, balance and inflation destination).
The ledger number is coming from a specific operation (the inflation operation which runs once a week and could run at "random" time).
Solutions that we could think of till now:
- use a stream and when the operation type equals to inflation, dump the account information somewhere that we can parse later
- use stellar-archivist to fetch the archive (we do not need to act immediately when the operation comes) up until the specific ledger number replay all the relevant transactions starting from ledger 1 so
- modify stellar-core to either fetch up until a given ledger number or use it's "cathup" code to utilize the directory structure from stellar-archivist (so we would have the ledger in the DB that we can query with SQL)
The problem with the first one is that if either the horizon server (that we are using for the stream) is down or our server is down (which runs the our stream software) when the given operation happens, you simply miss it.
The problem with the 2nd one is to understand the directory structure and properly replay everything is pretty difficult. You need to keep in mind the procotol versions changes etc.
For us the 3rd option seems to be the most reliable one but I would not say that it is a simple one :)
Is there any other solutions out there that we did not think of?
EDIT: based on the answers, it seems I was not clear enough what did I want to achieve so let me try to explain it with different words: I would like to fetch the account information (inflation destination, data fields, balance etc.) on a given ledger sequence number (let say 18989527).