pub async fn process_new_blocks<S: BlockStorage, C: BlockChainClient + Send + Clone + 'static, H: Fn(BlockType, Network) -> BoxFuture<'static, ProcessedBlock> + Send + Sync + 'static, T: Fn(&ProcessedBlock) -> JoinHandle<()> + Send + Sync + 'static, TR: BlockTrackerTrait<S>>(
network: &Network,
rpc_client: &C,
block_storage: Arc<S>,
block_handler: Arc<H>,
trigger_handler: Arc<T>,
block_tracker: Arc<TR>,
) -> Result<(), BlockWatcherError>
Expand description
Processes new blocks for a network
§Arguments
network
- Network configurationrpc_client
- RPC client for the networkblock_storage
- Storage implementation for blocksblock_handler
- Handler function for processed blockstrigger_handler
- Handler function for processed blocksblock_tracker
- Tracker implementation for block processing
§Returns
Result<(), BlockWatcherError>
- Success or error