essential_node

Function ensure_big_bang_block

Source
pub async fn ensure_big_bang_block(
    conn_pool: &ConnectionPool,
    big_bang: &BigBang,
) -> Result<ContentAddress, BigBangError>
Expand description

Ensures that a big bang block exists in the DB for the given BigBang configuration.

If no block exists with block_number 0, this inserts the big bang block.

If a block already exists with block_number 0, this validates that its ContentAddress matches the ContentAddress of the Block returned from BigBang::block.

If validation has not yet begun, this initializes progress to begin from the big bang Block.

Returns the ContentAddress of the big bang Block.