Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.Modes
Description
Consensus modes. The node supports several different modes with different combinations of consensus protocols and ledger eras.
Synopsis
- type family ConsensusProtocol era where ...
- type family ChainDepStateProtocol era where ...
- data ConsensusModeParams where
- newtype EpochSlots = EpochSlots {}
- type family ConsensusCryptoForBlock block where ...
- type family ConsensusBlockForEra era where ...
- toConsensusEraIndex :: CardanoBlock StandardCrypto ~ HardForkBlock xs => CardanoEra era -> EraIndex xs
- fromConsensusEraIndex :: EraIndex (CardanoEras StandardCrypto) -> AnyCardanoEra
The protocols supported in each era
type family ConsensusProtocol era where ... Source #
Equations
ConsensusProtocol ShelleyEra = TPraos StandardCrypto | |
ConsensusProtocol AllegraEra = TPraos StandardCrypto | |
ConsensusProtocol MaryEra = TPraos StandardCrypto | |
ConsensusProtocol AlonzoEra = TPraos StandardCrypto | |
ConsensusProtocol BabbageEra = Praos StandardCrypto | |
ConsensusProtocol ConwayEra = Praos StandardCrypto |
type family ChainDepStateProtocol era where ... Source #
Equations
ChainDepStateProtocol ShelleyEra = TPraosState StandardCrypto | |
ChainDepStateProtocol AllegraEra = TPraosState StandardCrypto | |
ChainDepStateProtocol MaryEra = TPraosState StandardCrypto | |
ChainDepStateProtocol AlonzoEra = TPraosState StandardCrypto | |
ChainDepStateProtocol BabbageEra = PraosState StandardCrypto | |
ChainDepStateProtocol ConwayEra = PraosState StandardCrypto |
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.
Constructors
CardanoModeParams :: EpochSlots -> ConsensusModeParams |
Instances
Show ConsensusModeParams Source # | |
Defined in Cardano.Api.Modes |
newtype EpochSlots #
Constructors
EpochSlots | |
Fields |
Instances
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 #
fromConsensusEraIndex :: EraIndex (CardanoEras StandardCrypto) -> AnyCardanoEra Source #