Documentation / @etherfold/browser / HostGeneration
Type Alias: HostGeneration ​
HostGeneration =
object
Defined in: packages/browser/src/host/envelope.ts:293
ONE GENERATION THIS HOST HOLDS, and how far its fold has got.
The FOUR FIELDS GenerationProgress already carries (@etherfold/browser's own vocabulary for this, published on SyncingState.nonCanonicalGenerations) under their existing names and rules, plus the one thing a LIST of every generation needs that a list of the OTHERS did not: which of them is answering reads. A main-thread app moving to a port therefore binds the same words to the same meanings.
It REPORTS and it does not decide, exactly as that type does: whether a second generation existing means the answers on screen should be rendered, dimmed or hidden is something only the app knows, because only the app knows whether its reconfigure made the old answers WRONG or merely INCOMPLETE.
Properties ​
blocksBehind? ​
readonlyoptionalblocksBehind?:number
Defined in: packages/browser/src/host/envelope.ts:331
How far BEHIND the generation that answers reads, in blocks: 0 means level (or ahead, which manual allows).
Absent when either cursor is unknown. Behind the CANONICAL generation and not behind the chain tip -- which is the distance HostProgress.blocksBehindTip carries, under a name that says which tip it measures against precisely so these two cannot be confused.
canonical ​
readonlycanonical:boolean
Defined in: packages/browser/src/host/envelope.ts:303
Whether this is the one ANSWERING READS -- the canonical pointer, as this host's container resolves it.
A flag per entry rather than a separate id beside the list, so a tab cannot hold a pointer that names nothing in the list it came with.
follows ​
readonlyfollows:boolean
Defined in: packages/browser/src/host/envelope.ts:313
Whether it FOLLOWS a stream another generation writes rather than fetching its own.
REPORTED and never chosen (ADR-0044): it is a consequence of sharing a stream. It is also what a reconfigure COSTS, said in one field -- a generation that follows re-folds logs that are already on disk, and one that does not has to ask the node for them again.
lastToBlock? ​
readonlyoptionallastToBlock?:number
Defined in: packages/browser/src/host/envelope.ts:321
How far its fold has got, or absent before it has loaded.
Absent rather than 0, because "it has folded nothing yet" and "it is level at block 0" are different claims and an app that dims on progress has to tell them apart.
record ​
readonlyrecord:GenerationRecord
Defined in: packages/browser/src/host/envelope.ts:295
WHICH generation: the stream it folds, the processor that folds it, and when it was registered.