bcc-api-1.99.0
Safe HaskellNone
LanguageHaskell2010

Bcc.Api.Modes

Description

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

Synopsis

Consensus modes

data ColeMode Source #

The Cole-only consensus mode consists of only the Cole era.

This was used on the mainnet before the deployment of the multi-era BccMode. It is now of little practical use, though it illustrates how a single-era consensus mode works. It may be sensible to remove this at some stage.

data SophieMode Source #

The Sophie-only consensus mode consists of only the Sophie era.

This was used for the early Sophie testnets prior to the use of the multi-era BccMode. It is useful for setting up Sophie test networks (e.g. for benchmarking) without having to go through the complication of the hard fork from Cole to Sophie eras. It also shows how a single-era consensus mode works. It may be replaced by other single-era modes in future.

data BccMode Source #

The Bcc consensus mode consists of all the eras currently in use on the Bcc mainnet. This is currently: the ColeEra; SophieEra, EvieEra and JenEra, in that order.

This mode will be extended with new eras as the Bcc mainnet develops.

data ConsensusMode mode where Source #

This GADT provides a value-level representation of all the consensus modes. This enables pattern matching on the era to allow them to be treated in a non-uniform way.

Instances

Instances details
Show (ConsensusMode mode) Source # 
Instance details

Defined in Bcc.Api.Modes

data AnyConsensusMode where Source #

Instances

Instances details
Show AnyConsensusMode Source # 
Instance details

Defined in Bcc.Api.Modes

data ConsensusModeIsMultiEra mode where Source #

The subset of consensus modes that consist of multiple eras. Some features are not supported in single-era modes (for exact compatibility with not using the hard fork combinatior at all).

Instances

Instances details
Show (ConsensusModeIsMultiEra mode) Source # 
Instance details

Defined in Bcc.Api.Modes

The eras supported by each mode

eraInModeToEraEraInMode era mode → BccEra era Source #

data AnyEraInMode mode where Source #

Constructors

AnyEraInModeEraInMode era mode → AnyEraInMode mode 

Instances

Instances details
Show (AnyEraInMode mode) Source # 
Instance details

Defined in Bcc.Api.Modes

Methods

showsPrecIntAnyEraInMode mode → ShowS Source #

showAnyEraInMode mode → String Source #

showList ∷ [AnyEraInMode mode] → ShowS Source #

toEraInModeBccEra era → ConsensusMode mode → Maybe (EraInMode era mode) Source #

Connection paramaters for each mode

data ConsensusModeParams mode 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 Cole era that requires extra parameters, but this is of course inherited by the BccMode that uses the Cole era. The reason this parameter is needed stems from unfortunate design decisions from the legacy Cole era. The slots per epoch are needed to be able to decode epoch boundary blocks from the Cole 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.

Instances

Instances details
Show (ConsensusModeParams mode) Source # 
Instance details

Defined in Bcc.Api.Modes

newtype EpochSlots #

Constructors

EpochSlots 

Fields

Instances

Instances details
Eq EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Data EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → EpochSlots → c EpochSlots Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c EpochSlots Source #

toConstrEpochSlotsConstr Source #

dataTypeOfEpochSlotsDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c EpochSlots) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c EpochSlots) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → EpochSlotsEpochSlots Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → EpochSlots → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → EpochSlots → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → EpochSlots → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → EpochSlots → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → EpochSlots → m EpochSlots Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → EpochSlots → m EpochSlots Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → EpochSlots → m EpochSlots Source #

Ord EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Read EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Show EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Generic EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Associated Types

type Rep EpochSlotsTypeType Source #

Buildable EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Methods

buildEpochSlotsBuilder

NoThunks EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Methods

noThunks ∷ Context → EpochSlotsIO (Maybe ThunkInfo)

wNoThunks ∷ Context → EpochSlotsIO (Maybe ThunkInfo)

showTypeOfProxy EpochSlotsString

FromCBOR EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Methods

fromCBOR ∷ Decoder s EpochSlots #

labelProxy EpochSlotsText #

ToCBOR EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Methods

toCBOREpochSlots → Encoding #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EpochSlots → Size #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [EpochSlots] → Size #

type Rep EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

type Rep EpochSlots = D1 ('MetaData "EpochSlots" "Bcc.Chain.Slotting.EpochSlots" "bcc-ledger-cole-0.1.0.0-6008ffc54c78353d0f5147cdbc5bfdf298d329fad75e5df92e68f459a4ba4121" '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 ConsensusBlockForMode mode 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

ConsensusBlockForMode ColeMode = ColeBlockHFC 
ConsensusBlockForMode SophieMode = SophieBlockHFC StandardSophie 
ConsensusBlockForMode BccMode = BccBlock StandardCrypto 

type family ConsensusBlockForEra era where ... Source #

Equations

ConsensusBlockForEra ColeEra = ColeBlock 
ConsensusBlockForEra SophieEra = SophieBlock StandardSophie 
ConsensusBlockForEra EvieEra = SophieBlock StandardEvie 
ConsensusBlockForEra JenEra = SophieBlock StandardJen 
ConsensusBlockForEra AurumEra = SophieBlock StandardAurum 

toConsensusEraIndexConsensusBlockForMode mode ~ HardForkBlock xs ⇒ EraInMode era mode → EraIndex xs Source #

fromConsensusEraIndexConsensusBlockForMode mode ~ HardForkBlock xs ⇒ ConsensusMode mode → EraIndex xs → AnyEraInMode mode Source #