ouroboros-consensus-shelley-0.1.0.0: Shelley ledger integration in the Ouroboros consensus layer
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Shelley.Node

Synopsis

Documentation

data ProtocolParamsShelley c f Source #

Parameters needed to run Shelley

Constructors

ProtocolParamsShelley 

Fields

data ProtocolParamsAllegra c f Source #

Parameters needed to run Allegra

data ProtocolParamsMary c f Source #

Parameters needed to run Mary

data ShelleyGenesis era Source #

Shelley genesis information

Note that this is needed only for a pure Shelley network, hence it being defined here rather than in its own module. In mainnet, Shelley will transition naturally from Byron, and thus will never have its own genesis information.

Instances

Instances details
Eq (ShelleyGenesis era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Show (ShelleyGenesis era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Generic (ShelleyGenesis era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Associated Types

type Rep (ShelleyGenesis era) :: Type -> Type #

Methods

from :: ShelleyGenesis era -> Rep (ShelleyGenesis era) x #

to :: Rep (ShelleyGenesis era) x -> ShelleyGenesis era #

Era era => ToJSON (ShelleyGenesis era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Era era => FromJSON (ShelleyGenesis era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Era era => ToCBOR (ShelleyGenesis era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Methods

toCBOR :: ShelleyGenesis era -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (ShelleyGenesis era) -> Size Source #

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

Era era => FromCBOR (ShelleyGenesis era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Era era => NoThunks (ShelleyGenesis era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

type Rep (ShelleyGenesis era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

type Rep (ShelleyGenesis era) = D1 ('MetaData "ShelleyGenesis" "Shelley.Spec.Ledger.Genesis" "shelley-spec-ledger-0.1.0.0-92kyZKZr7Mp7w3ug0LA6KH" 'False) (C1 ('MetaCons "ShelleyGenesis" 'PrefixI 'True) (((S1 ('MetaSel ('Just "sgSystemStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UTCTime) :*: (S1 ('MetaSel ('Just "sgNetworkMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word32) :*: S1 ('MetaSel ('Just "sgNetworkId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network))) :*: ((S1 ('MetaSel ('Just "sgActiveSlotsCoeff") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rational) :*: S1 ('MetaSel ('Just "sgSecurityParam") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64)) :*: (S1 ('MetaSel ('Just "sgEpochLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 EpochSize) :*: S1 ('MetaSel ('Just "sgSlotsPerKESPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64)))) :*: (((S1 ('MetaSel ('Just "sgMaxKESEvolutions") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgSlotLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime)) :*: (S1 ('MetaSel ('Just "sgUpdateQuorum") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgMaxLovelaceSupply") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64))) :*: ((S1 ('MetaSel ('Just "sgProtocolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era)) :*: S1 ('MetaSel ('Just "sgGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'Genesis (Crypto era)) (GenDelegPair (Crypto era))))) :*: (S1 ('MetaSel ('Just "sgInitialFunds") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Addr era) Coin)) :*: S1 ('MetaSel ('Just "sgStaking") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ShelleyGenesisStaking era)))))))

data ShelleyGenesisStaking era Source #

Genesis Shelley staking configuration.

This allows us to configure some initial stake pools and delegation to them, in order to test Praos in a static configuration, without requiring on-chain registration and delegation.

For simplicity, pools defined in the genesis staking do not pay deposits for their registration.

Constructors

ShelleyGenesisStaking 

Fields

  • sgsPools :: !(Map (KeyHash 'StakePool (Crypto era)) (PoolParams era))

    Pools to register

    The key in this map is the hash of the public key of the _pool_. This need not correspond to any payment or staking key, but must correspond to the cold key held by TPraosIsCoreNode.

  • sgsStake :: !(Map (KeyHash 'Staking (Crypto era)) (KeyHash 'StakePool (Crypto era)))

    Stake-holding key hash credentials and the pools to delegate that stake to. We require the raw staking key hash in order to:

    • Avoid pointer addresses, which would be tricky when there's no slot or transaction to point to.
    • Avoid script credentials.

Instances

Instances details
Eq (ShelleyGenesisStaking era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Show (ShelleyGenesisStaking era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Generic (ShelleyGenesisStaking era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Associated Types

type Rep (ShelleyGenesisStaking era) :: Type -> Type #

Era era => ToJSON (ShelleyGenesisStaking era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Era era => FromJSON (ShelleyGenesisStaking era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Era era => ToCBOR (ShelleyGenesisStaking era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

Era era => FromCBOR (ShelleyGenesisStaking era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

NoThunks (ShelleyGenesisStaking era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

type Rep (ShelleyGenesisStaking era) 
Instance details

Defined in Shelley.Spec.Ledger.Genesis

type Rep (ShelleyGenesisStaking era) = D1 ('MetaData "ShelleyGenesisStaking" "Shelley.Spec.Ledger.Genesis" "shelley-spec-ledger-0.1.0.0-92kyZKZr7Mp7w3ug0LA6KH" 'False) (C1 ('MetaCons "ShelleyGenesisStaking" 'PrefixI 'True) (S1 ('MetaSel ('Just "sgsPools") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool (Crypto era)) (PoolParams era))) :*: S1 ('MetaSel ('Just "sgsStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'Staking (Crypto era)) (KeyHash 'StakePool (Crypto era))))))

data TPraosLeaderCredentials c Source #

Constructors

TPraosLeaderCredentials 

Fields

data ProtVer Source #

Constructors

ProtVer 

Fields

Instances

Instances details
Eq ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

Methods

(==) :: ProtVer -> ProtVer -> Bool #

(/=) :: ProtVer -> ProtVer -> Bool #

Ord ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

Show ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

Generic ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

Associated Types

type Rep ProtVer :: Type -> Type #

Methods

from :: ProtVer -> Rep ProtVer x #

to :: Rep ProtVer x -> ProtVer #

NFData ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

Methods

rnf :: ProtVer -> () #

ToJSON ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

FromJSON ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

ToCBOR ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

Methods

toCBOR :: ProtVer -> Encoding Source #

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

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

FromCBOR ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

NoThunks ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

ToCBORGroup ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

FromCBORGroup ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

type Rep ProtVer 
Instance details

Defined in Shelley.Spec.Ledger.PParams

type Rep ProtVer = D1 ('MetaData "ProtVer" "Shelley.Spec.Ledger.PParams" "shelley-spec-ledger-0.1.0.0-92kyZKZr7Mp7w3ug0LA6KH" 'False) (C1 ('MetaCons "ProtVer" 'PrefixI 'True) (S1 ('MetaSel ('Just "pvMajor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "pvMinor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural)))

data Nonce Source #

Evolving nonce type.

Constructors

Nonce !(Hash Blake2b_256 Nonce) 
NeutralNonce

Identity element

Instances

Instances details
Eq Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

Methods

(==) :: Nonce -> Nonce -> Bool #

(/=) :: Nonce -> Nonce -> Bool #

Ord Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

Methods

compare :: Nonce -> Nonce -> Ordering #

(<) :: Nonce -> Nonce -> Bool #

(<=) :: Nonce -> Nonce -> Bool #

(>) :: Nonce -> Nonce -> Bool #

(>=) :: Nonce -> Nonce -> Bool #

max :: Nonce -> Nonce -> Nonce #

min :: Nonce -> Nonce -> Nonce #

Show Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

Methods

showsPrec :: Int -> Nonce -> ShowS #

show :: Nonce -> String #

showList :: [Nonce] -> ShowS #

Generic Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

Associated Types

type Rep Nonce :: Type -> Type #

Methods

from :: Nonce -> Rep Nonce x #

to :: Rep Nonce x -> Nonce #

NFData Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

Methods

rnf :: Nonce -> () #

ToJSON Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

FromJSON Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

ToCBOR Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

Methods

toCBOR :: Nonce -> Encoding Source #

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

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

FromCBOR Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

NoThunks Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

type Rep Nonce 
Instance details

Defined in Shelley.Spec.Ledger.BaseTypes

type Rep Nonce = D1 ('MetaData "Nonce" "Shelley.Spec.Ledger.BaseTypes" "shelley-spec-ledger-0.1.0.0-92kyZKZr7Mp7w3ug0LA6KH" 'False) (C1 ('MetaCons "Nonce" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 (Hash Blake2b_256 Nonce))) :+: C1 ('MetaCons "NeutralNonce" 'PrefixI 'False) (U1 :: Type -> Type))

newtype MaxMajorProtVer Source #

The maximum major protocol version.

Must be at least the current major protocol version. For Cardano mainnet, the Shelley era has major protocol verison 2.

Instances

Instances details
Eq MaxMajorProtVer Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

Show MaxMajorProtVer Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

Generic MaxMajorProtVer Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

Associated Types

type Rep MaxMajorProtVer :: Type -> Type #

NoThunks MaxMajorProtVer Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

type Rep MaxMajorProtVer Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol

type Rep MaxMajorProtVer = D1 ('MetaData "MaxMajorProtVer" "Ouroboros.Consensus.Shelley.Protocol" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'True) (C1 ('MetaCons "MaxMajorProtVer" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMaxMajorProtVer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)))

validateGenesis :: ShelleyBasedEra era => ShelleyGenesis era -> Either String () Source #

Check the validity of the genesis config. To be used in conjunction with assertWithMsg.

Orphan instances