ouroboros-consensus-cardano-0.1.0.0: The instantation of the Ouroboros consensus layer used by Cardano
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Cardano

Synopsis

The block type of the Cardano block chain

type CardanoBlock c = HardForkBlock (CardanoEras c) Source #

The Cardano block.

Thanks to the pattern synonyms, you can treat this as a sum type with constructors BlockByron and BlockShelley.

f :: CardanoBlock c -> _
f (BlockByron   b) = _
f (BlockShelley s) = _
f (BlockAllegra a) = _
f (BlockMary    m) = _

Supported protocols

Abstract over the various protocols

data ProtocolParamsShelley c (f :: Type -> Type) Source #

Parameters needed to run Shelley

Constructors

ProtocolParamsShelley 

Fields

data ProtocolParamsAllegra c (f :: Type -> Type) Source #

Parameters needed to run Allegra

data ProtocolParamsMary c (f :: Type -> Type) Source #

Parameters needed to run Mary

data ProtocolParamsTransition eraFrom eraTo Source #

Parameters needed to transition between two eras.

The two eras are phantom type parameters of this type to avoid mixing up multiple ProtocolParamsTransitions

Constructors

ProtocolParamsTransition 

Fields

  • transitionLowerBound :: Maybe EpochNo

    Lower bound on first epoch of eraTo

    Setting this to Just when a true lower bound is known may particularly improve performance of bulk syncing. For example, for the transition from Byron to Shelley, Just 208 would be sound for the Cardano mainnet, since we know now that the Shelley era began in epoch 208.

    The Nothing case is useful for test and possible alternative nets.

  • transitionTrigger :: TriggerHardFork
     

Data required to run a protocol

protocolInfo :: forall m blk p. IOLike m => Protocol m blk p -> ProtocolInfo m blk Source #

Data required to run the selected protocol

Evidence that we can run all the supported protocols

runProtocol :: Protocol m blk p -> Dict (RunNode blk) Source #

Client support for nodes running a protocol

data ProtocolClient blk p where Source #

Node client support for each consensus protocol.

This is like Protocol but for clients of the node, so with less onerous requirements than to run a node.

protocolClientInfo :: ProtocolClient blk p -> ProtocolClientInfo blk Source #

Data required by clients of a node running the specified protocol.

runProtocolClient :: ProtocolClient blk p -> Dict (RunNode blk) Source #

Sanity check that we have the right class instances available

verifyProtocolClient :: ProtocolClient blk p -> p :~: BlockProtocol blk Source #

Sanity check that we have the right type combinations