write: (required) Async function({ read, logger }) => Promise<void>. Iterate the stream by callingread()and consuming{ data, ctx }batches. The function returns when the stream ends.fork: (optional)(previousBlocks: BlockCursor[]) => Promise<BlockCursor | null>. Called when the source detects a chain reorg. Return the last safe cursor to roll back to, ornullif no common ancestor can be determined (the stream will throw). See Fork handling. You don’t need this callback when the source is configured to read only finalized blocks.
The write context
Per-batch context (ctx)
Each { data, ctx } yielded by read() carries the same BatchContext that transformers receive. Fields: