Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- data HardForkSpec = HardForkSpec {}
- hardForkInto ∷ Era → HardForkSpec
- stayInByron ∷ HardForkSpec
- mkSimpleTestProtocolInfo ∷ ∀ c. (CardanoHardForkConstraints c, c ~ StandardCrypto) ⇒ DecentralizationParam → SecurityParam → ByronSlotLengthInSeconds → ShelleySlotLengthInSeconds → ProtVer → HardForkSpec → ProtocolInfo (CardanoBlock c)
- mkTestProtocolInfo ∷ ∀ m c. (CardanoHardForkConstraints c, IOLike m, c ~ StandardCrypto) ⇒ (CoreNodeId, CoreNode c) → ShelleyGenesis c → ProtocolVersion → Nonce → Config → GeneratedSecrets → Maybe PBftSignatureThreshold → ProtVer → HardForkSpec → (ProtocolInfo (CardanoBlock c), m [BlockForging m (CardanoBlock c)])
- protocolVersionZero ∷ ProtVer
ProtocolInfo elaboration parameter types
newtype NumCoreNodes Source #
Instances
Show NumCoreNodes | |
Defined in Ouroboros.Consensus.Node.ProtocolInfo showsPrec ∷ Int → NumCoreNodes → ShowS # show ∷ NumCoreNodes → String # showList ∷ [NumCoreNodes] → ShowS # | |
NoThunks NumCoreNodes | |
Defined in Ouroboros.Consensus.Node.ProtocolInfo |
Hard-fork specification
data HardForkSpec Source #
This data structure is used to specify if and when hardforks should take
place, and the version used at each era. See stayInByron
and hardForkInto
for examples.
ProtocolInfo elaboration
mkSimpleTestProtocolInfo Source #
∷ ∀ c. (CardanoHardForkConstraints c, c ~ StandardCrypto) | |
⇒ DecentralizationParam | Network decentralization parameter. |
→ SecurityParam | |
→ ByronSlotLengthInSeconds | |
→ ShelleySlotLengthInSeconds | |
→ ProtVer | |
→ HardForkSpec | |
→ 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 HardForkSpec
parameter will determine to which era this ledger state belongs. See
HardForkSpec
for more details on how to specify a value of this type.
∷ ∀ m c. (CardanoHardForkConstraints c, IOLike m, c ~ StandardCrypto) | |
⇒ (CoreNodeId, CoreNode c) | Id of the node for which the protocol info will be elaborated. |
→ ShelleyGenesis c | 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 |
→ HardForkSpec | Specification of the era to which the initial state should hard-fork to. |
→ (ProtocolInfo (CardanoBlock c), m [BlockForging m (CardanoBlock c)]) |
A more generalized version of mkSimpleTestProtocolInfo
.