3

https://horizon.stellar.org/ returns history_latest_ledger and core_latest_ledger.

Which field should be used to get the current block number? Which one is more reliable? Diffs?

I assume history_latest_ledger is the last ledger saved in horizon DB, isn't? Wouldn't it be better to use this field?

4

There are two components involved in running a stellar backend. The one is stellar-core which manages peer to peer data propagation, the other one is stellar-horizon which gets and prepares that data from core for convenient access.

  • core_latest_ledger is the latest existing ledger that stellar-core is aware of (it's p2p, it might as well lag behind the network)
  • history_latest_ledger is the latest ledger that horizon has already ingested from stellar-core

So it's safe to say that:

real current ledger >= core_latest_ledger >= history_latest_ledger.

If you want to query more details then rely on history_latest_ledger, because that's the latest ledger you will get processed details for from horizon anyways.

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.