Initializer
init(manager:source:context:)
Create a new sync engine.
init(manager: ChainstateManager, source: any BlockSource, context: Context)
Parameters
-
manager
-
The kernel chainstate that will be advanced. Must be configured with the same ChainType the source is reporting on — validating signet blocks against a mainnet chainstate will surface as rejections in BlockchainSync.Update.State.failed(_:).
-
source
-
The block source providing remote chain data. Any BlockSource conformer — HTTP (EsploraBlockSource), a test mock, or a future P2P conformer — works identically.
-
context
-
The kernel context used to interrupt long-running processBlock(_:) calls on cancel.
Discussion
The engine is a value-type configuration: constructing one does no work. The sync loop starts on the first call to updates().