pub fn create_new_ledger(ledger_path: &str, genesis_block: &GenesisBlock) -> Result<Hash> {
    let ticks_per_slot = genesis_block.ticks_per_slot;
    Blocktree::destroy(ledger_path)?;
    genesis_block.write(&ledger_path)?;

    // Fill slot 0 with ticks that link back to the genesis_block to bootstrap the ledger.
    let blocktree = Blocktree::open(ledger_path)?;
    let entries = crate::entryInfo::create_ticks(ticks_per_slot, genesis_block.hash());
    blocktree.write_entries(0, 0, 0, ticks_per_slot, &entries)?;

    Ok(entries.last().unwrap().hash)
}
// Creates a new ledger with slot 0 full of ticks (and only ticks).
//
// Returns the blockhash that can be used to append entries with.
Creates a new ledger with slot 0 full of ticks (and only ticks).
Returns the blockhash that can be used to append entries with.
Creates a new ledger with slot 0 full of ticks ( and only ticks ) . Returns the blockhash that can be used to append entries with .
pub fn create_new_ledger(ledger_path: &str, genesis_block: &GenesisBlock) -> Result<Hash> {
    let ticks_per_slot = genesis_block.ticks_per_slot;
    Blocktree::destroy(ledger_path)?;
    genesis_block.write(&ledger_path)?;
    // Fill slot 0 with ticks that link back to the genesis_block to bootstrap the ledger.
    let blocktree = Blocktree::open(ledger_path)?;
    let entries = crate::entryInfo::create_ticks(ticks_per_slot, genesis_block.hash());
    blocktree.write_entries(0, 0, 0, ticks_per_slot, &entries)?;
    Ok(entries.last().unwrap().hash)
}
pub fn create_new_ledger ( ledger_path : & str , genesis_block : & GenesisBlock ) -> Result < Hash > { let ticks_per_slot = genesis_block . ticks_per_slot ; Blocktree :: destroy ( ledger_path ) ? ; genesis_block . write ( & ledger_path ) ? ; // Fill slot 0 with ticks that link back to the genesis_block to bootstrap the ledger. let blocktree = Blocktree :: open ( ledger_path ) ? ; let entries = crate :: entryInfo :: create_ticks ( ticks_per_slot , genesis_block . hash ( ) ) ; blocktree . write_entries ( 0 , 0 , 0 , ticks_per_slot , & entries ) ? ; Ok ( entries . last ( ) . unwrap ( ) . hash ) }
Creates a new ledger with slot 0 full of ticks (and only ticks).
Creates a new ledger with slot 0 full of ticks ( and only ticks ) .
ledger_path
&str
genesis_block
&GenesisBlock
ledger_path
&str
genesis_block
&GenesisBlock