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:

  1. use a stream and when the operation type equals to inflation, dump the account information somewhere that we can parse later
  2. 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
  3. 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).


stellar-core has few under documented (not mentioned in the documentation but mentioned in the help page of the binary) command line parameters. One of them called --cathup-at which does exactly what we wanted: From a new database (use --newdb first), it "jumps" to a given ledger number without "joining to SCP" and then exits. After this, one can query the accounts and accountdata tables in the core DB.


During our tests, the catchup to 18989527 took us 20 minutes with the --cathup-at 18989527 parameter (4 core Xeon with 32GB memory and SSD).


Run you own stellar-core node, and run queries before and after the event you're looking for, and do diffs. Double check accounts that have changed to find out if they changed before or after the actual event you're looking for.


It's probably easier to change Horizon to record values of accounts over time: most likely, the resolution of a ledger is not enough as an account can be modified by any transaction.

The "ingestion" code basically does what you're looking for: it parses transaction meta, per operation, where the meta contains old/new values of any ledger entry (accounts and also trust lines, etc).

If you're trying to see what happened to an account at the time of inflation you just need to parse the "inflation" operation meta.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.