process

Function process 

Source
pub fn process<Era, P, B, BB, BH>(
    meta: &Era,
    writer: &mut StaticFileProviderRWRefMut<'_, <P as NodePrimitivesProvider>::Primitives>,
    provider: &P,
    hash_collector: &mut Collector<BlockHash, BlockNumber>,
    total_difficulty: &mut U256,
    block_numbers: impl RangeBounds<BlockNumber>,
) -> Result<BlockNumber>
where B: Block<Header = BH, Body = BB>, BH: FullBlockHeader + Value, BB: FullBlockBody<Transaction = <<P as NodePrimitivesProvider>::Primitives as NodePrimitives>::SignedTx, OmmerHeader = BH>, Era: EraMeta + ?Sized, P: DBProvider<Tx: DbTxMut> + NodePrimitivesProvider + BlockWriter<Block = B>, <P as NodePrimitivesProvider>::Primitives: NodePrimitives<BlockHeader = BH, BlockBody = BB>,
Expand description

Imports history from ERA files. Extracts block headers and bodies from meta and appends them using writer and provider.

Adds on to total_difficulty and collects hash to height using hash_collector.

Skips all blocks below the start_bound of block_numbers and stops when reaching past the end_bound or the end of the file.

Returns last block height.