0

With a private network running for several months, I accidentally called the command horizon db clear, and then Horizon now shows:

"history_latest_ledger": 2576535,
"history_elder_ledger": 1830026,

i.e. the Horizon DB now holds only transactions between ledger #1830026 ~ #2576535, in the table <history_transactions>.


At stellar-core.cfg, I have CATCHUP_COMPLETE=true since the beginning.


Is there any way to get back the transaction prior to #1830026 to <history_transactions>? (other than re-building Stellar-Core from new DB)

1 Answer 1

1

In the most recent release of horizon; v0.15.* you can do: horizon db backfill N

where N is the number of missing ledgers you want added to your horizon history.

So in your case it will be horizon db backfill 1830025

Note that even if you have CATCHUP_COMPLETE=true, you might not have all the ledgers in the core database unless you have disabled maintenance mode in stellar core; which I believe is enabled by default.

You can check the oldest ledger you have in stellar core by querying the database.

SELECT MIN(ledgerseq) FROM ledgerheaders; The value will be 1 if you have the complete history

If stellar core does not have the history any longer, then you might have to run catchup again to get the data from the history archives(assuming you configured these).

In the future, you might want to have a backup of your horizon DB.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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