ouroboros-consensus-0.18.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.MiniProtocol.BlockFetch.ClientInterface

Description

Initialization of the BlockFetchConsensusInterface

Synopsis

Documentation

data ChainDbView m blk Source #

Abstract over the ChainDB

type SlotForgeTimeOracle m blk = RealPoint blk → STM m UTCTime Source #

How to get the wall-clock time of a slot. Note that this is a very non-trivial operation in the context of the HFC, cf. headerForgeUTCTime.

initSlotForgeTimeOracle ∷ ∀ m blk. (IOLike m, BlockSupportsProtocol blk, HasHardForkHistory blk, ConfigSupportsNode blk, IsLedger (LedgerState blk)) ⇒ TopLevelConfig blk → ChainDB m blk → m (SlotForgeTimeOracle m blk) Source #

Create a HFC-enabled SlotForgeTimeOracle. Note that its semantics are rather tricky, cf. headerForgeUTCTime.

mkBlockFetchConsensusInterface Source #

Arguments

∷ ∀ m peer blk. (IOLike m, BlockSupportsDiffusionPipelining blk, BlockSupportsProtocol blk) 
BlockConfig blk 
ChainDbView m blk 
STM m (Map peer (AnchoredFragment (Header blk))) 
→ (Header blk → SizeInBytes) 
SlotForgeTimeOracle m blk

Slot forge time, see headerForgeUTCTime and blockForgeUTCTime.

STM m FetchMode

See readFetchMode.

BlockFetchConsensusInterface peer (Header blk) blk m