How long does the history of the event stream last?

What happens in these two scenarios?

Scenario 1:

  1. My event listener is offline
  2. I create and archive a contract
  3. My event listener comes back online

Scenario 2:

  1. My event listener is offline
  2. I create and archive a contract
  3. The ledger is pruned up to the latest offset
  4. My event listener comes back online

I’m assuming that this data is sourced from the create_events table, and thus the event stream is effective replated in scenario (1) but not effectively replayed in scenario (2). Is all of that correct?

Which stream are you referring to? The transaction stream? If so, it’s exactly as long as your pruning window. So you should only prune to the point where your clients have caught up. If you miss that, you have to accept that they lose out on some history and rebootstrap them from the acs. For some apps that’s fine (automation often falls in that), for others it’s not and you really do care about the history.

2 Likes