| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Consensus.Cardano.ProtocolInfo
Description
Utility functions to elaborate a Cardano ProtocolInfo from certain parameters.
Synopsis
- newtype ByronSlotLengthInSeconds = ByronSlotLengthInSeconds Word64
- newtype NumCoreNodes = NumCoreNodes Word64
- newtype ShelleySlotLengthInSeconds = ShelleySlotLengthInSeconds Word64
- data Era
- hardForkInto ∷ Era → CardanoHardForkTriggers
- hardForkOnDefaultProtocolVersions ∷ CardanoHardForkTriggers
- mkSimpleTestProtocolInfo ∷ (CardanoHardForkConstraints c, KESAgentContext c IO) ⇒ DecentralizationParam → SecurityParam → ByronSlotLengthInSeconds → ShelleySlotLengthInSeconds → ProtVer → CardanoHardForkTriggers → ProtocolInfo (CardanoBlock c)
- mkTestProtocolInfo ∷ ∀ m c. (CardanoHardForkConstraints c, KESAgentContext c m) ⇒ (CoreNodeId, CoreNode c) → ShelleyGenesis → ProtocolVersion → Nonce → Config → GeneratedSecrets → Maybe PBftSignatureThreshold → ProtVer → CardanoHardForkTriggers → (ProtocolInfo (CardanoBlock c), Tracer m KESAgentClientTrace → m [MkBlockForging m (CardanoBlock c)])
- protocolVersionZero ∷ ProtVer
ProtocolInfo elaboration parameter types
newtype ByronSlotLengthInSeconds Source #
Constructors
| ByronSlotLengthInSeconds Word64 |
newtype NumCoreNodes Source #
Constructors
| NumCoreNodes Word64 |
Instances
| Show NumCoreNodes | |
Defined in Ouroboros.Consensus.Node.ProtocolInfo Methods showsPrec ∷ Int → NumCoreNodes → ShowS # show ∷ NumCoreNodes → String # showList ∷ [NumCoreNodes] → ShowS # | |
| NoThunks NumCoreNodes | |
Defined in Ouroboros.Consensus.Node.ProtocolInfo | |
newtype ShelleySlotLengthInSeconds Source #
Constructors
| ShelleySlotLengthInSeconds Word64 |
Hard-fork specification
ProtocolInfo elaboration
mkSimpleTestProtocolInfo Source #
Arguments
| ∷ (CardanoHardForkConstraints c, KESAgentContext c IO) | |
| ⇒ DecentralizationParam | Network decentralization parameter. |
| → SecurityParam | |
| → ByronSlotLengthInSeconds | |
| → ShelleySlotLengthInSeconds | |
| → ProtVer | |
| → CardanoHardForkTriggers | |
| → ProtocolInfo (CardanoBlock c) |
Create a Cardano protocol info for testing purposes, using some predifined
settings (see below). For a more general version see mkTestProtocolInfo.
The resulting ProtocolInfo will use a randomly generated core node. This
generation will use a fixed seed. See mkTestProtocolInfo for a function
that takes a core node as parameter.
The resulting ProtocolInfo will:
- Use a
NeutralNonce. - Use a fixed number of slots per KES evolution.
- Have version 0 0 0 as Byron protocol version.
- Use 1 as
PbftSignatureThreshold
If you want to tweak the resulting protocol info further see
mkTestProtocolInfo.
The resulting ProtocolInfo contains a ledger state. The
CardanoHardForkTriggers parameter will determine to which era this ledger
state belongs. See hardForkInto and hardForkOnDefaultProtocolVersions for
more details on how to specify a value of this type.
Arguments
| ∷ ∀ m c. (CardanoHardForkConstraints c, KESAgentContext c m) | |
| ⇒ (CoreNodeId, CoreNode c) | Id of the node for which the protocol info will be elaborated. |
| → ShelleyGenesis | These nodes will be part of the initial delegation mapping, and funds will be allocated to these nodes. |
| → ProtocolVersion | Protocol version of the Byron era proposal. |
| → Nonce | |
| → Config | |
| → GeneratedSecrets | |
| → Maybe PBftSignatureThreshold | |
| → ProtVer | See |
| → CardanoHardForkTriggers | Specification of the era to which the initial state should hard-fork to. |
| → (ProtocolInfo (CardanoBlock c), Tracer m KESAgentClientTrace → m [MkBlockForging m (CardanoBlock c)]) |
A more generalized version of mkSimpleTestProtocolInfo.