CompactBlockProcessor
public class CompactBlockProcessor
The compact block processor is in charge of orchestrating the download and caching of compact blocks from a LightWalletEndpoint when started the processor downloads does a download - validate - scan cycle until it reaches latest height on the blockchain.
-
Compact Block Processor configuration
Property: cacheDbPath absolute file path of the DB where raw, unprocessed compact blocks are stored. Property: dataDbPath absolute file path of the DB where all information derived from the cache DB is stored.
See moreDeclaration
Swift
public struct Configuration
-
Represents the possible states of a CompactBlockProcessor
See moreDeclaration
-
Undocumented
Declaration
Swift
public private(set) var state: State { get set }
-
Initializes a CompactBlockProcessor instance
Declaration
Swift
public init(downloader: CompactBlockDownloading, backend: ZcashRustBackendWelding.Type, config: Configuration)
Parameters
downloader
an instance that complies to CompactBlockDownloading protocol
backend
a class that complies to ZcashRustBackendWelding
-
Starts the CompactBlockProcessor instance and starts downloading and processing blocks
triggers the blockProcessorStartedDownloading notification
Important
subscribe to the notifications before calling this methodDeclaration
Swift
public func start(retry: Bool = false) throws
-
Stops the CompactBlockProcessor
Note: retry count is reset
Declaration
Swift
public func stop(cancelTasks: Bool = true)
Parameters
cancelTasks
cancel the pending tasks. Defaults to true