cardano-api-8.36.1.1: The cardano api
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.Modes

Description

Consensus modes. The node supports several different modes with different combinations of consensus protocols and ledger eras.

Synopsis

The protocols supported in each era

Connection parameters for each mode

data ConsensusModeParams where Source #

The consensus-mode-specific parameters needed to connect to a local node that is using each consensus mode.

It is in fact only the Byron era that requires extra parameters, but this is of course inherited by the CardanoMode that uses the Byron era. The reason this parameter is needed stems from unfortunate design decisions from the legacy Byron era. The slots per epoch are needed to be able to decode epoch boundary blocks from the Byron era.

It is possible in future that we may be able to eliminate this parameter by discovering it from the node during the initial handshake.

newtype EpochSlots #

Constructors

EpochSlots 

Fields

Instances

Instances details
Eq EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Data EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EpochSlots -> c EpochSlots Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EpochSlots Source #

toConstr :: EpochSlots -> Constr Source #

dataTypeOf :: EpochSlots -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EpochSlots) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EpochSlots) Source #

gmapT :: (forall b. Data b => b -> b) -> EpochSlots -> EpochSlots Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EpochSlots -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EpochSlots -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> EpochSlots -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> EpochSlots -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> EpochSlots -> m EpochSlots Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EpochSlots -> m EpochSlots Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EpochSlots -> m EpochSlots Source #

Ord EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Read EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Show EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Generic EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Associated Types

type Rep EpochSlots :: Type -> Type Source #

DecCBOR EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

decCBOR :: Decoder s EpochSlots

dropCBOR :: Proxy EpochSlots -> Decoder s ()

label :: Proxy EpochSlots -> Text

EncCBOR EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

encCBOR :: EpochSlots -> Encoding

encodedSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy EpochSlots -> Size

encodedListSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy [EpochSlots] -> Size

FromCBOR EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

fromCBOR :: Decoder s EpochSlots #

label :: Proxy EpochSlots -> Text #

NoThunks EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

noThunks :: Context -> EpochSlots -> IO (Maybe ThunkInfo)

wNoThunks :: Context -> EpochSlots -> IO (Maybe ThunkInfo)

showTypeOf :: Proxy EpochSlots -> String

ToCBOR EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

toCBOR :: EpochSlots -> Encoding #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy EpochSlots -> Size #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [EpochSlots] -> Size #

Buildable EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

build :: EpochSlots -> Builder

type Rep EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

type Rep EpochSlots = D1 ('MetaData "EpochSlots" "Cardano.Chain.Slotting.EpochSlots" "cardano-ledger-byron-1.0.0.3-7XPhaeqCEJ61p5A3PpSRBs" 'True) (C1 ('MetaCons "EpochSlots" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochSlots") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

Conversions to and from types in the consensus library

type family ConsensusCryptoForBlock block where ... Source #

Equations

ConsensusCryptoForBlock ByronBlockHFC = StandardCrypto 
ConsensusCryptoForBlock (ShelleyBlockHFC (TPraos StandardCrypto) StandardShelley) = StandardShelley 
ConsensusCryptoForBlock (CardanoBlock StandardCrypto) = StandardCrypto 

type family ConsensusBlockForEra era where ... Source #

A closed type family that maps between the consensus mode (from this API) and the block type used by the consensus libraries.

Equations

ConsensusBlockForEra ByronEra = ByronBlock 
ConsensusBlockForEra ShelleyEra = StandardShelleyBlock 
ConsensusBlockForEra AllegraEra = StandardAllegraBlock 
ConsensusBlockForEra MaryEra = StandardMaryBlock 
ConsensusBlockForEra AlonzoEra = StandardAlonzoBlock 
ConsensusBlockForEra BabbageEra = StandardBabbageBlock 
ConsensusBlockForEra ConwayEra = StandardConwayBlock 

toConsensusEraIndex :: CardanoBlock StandardCrypto ~ HardForkBlock xs => CardanoEra era -> EraIndex xs Source #