cardano-ledger-shelley-1.11.0.0: Shelley Ledger Executable Model
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Shelley.Genesis

Synopsis

Documentation

data ShelleyGenesisStaking c 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

  • sgsPoolsListMap (KeyHash 'StakePool c) (PoolParams c)

    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.

  • sgsStakeListMap (KeyHash 'Staking c) (KeyHash 'StakePool c)

    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
Crypto c ⇒ FromJSON (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto c ⇒ ToJSON (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Monoid (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Semigroup (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Generic (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Associated Types

type Rep (ShelleyGenesisStaking c) ∷ TypeType Source #

Show (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto c ⇒ DecCBOR (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto c ⇒ EncCBOR (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Eq (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

NoThunks (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep (ShelleyGenesisStaking c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep (ShelleyGenesisStaking c) = D1 ('MetaData "ShelleyGenesisStaking" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.11.0.0-inplace" 'False) (C1 ('MetaCons "ShelleyGenesisStaking" 'PrefixI 'True) (S1 ('MetaSel ('Just "sgsPools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (KeyHash 'StakePool c) (PoolParams c))) :*: S1 ('MetaSel ('Just "sgsStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (KeyHash 'Staking c) (KeyHash 'StakePool c)))))

data ShelleyGenesis c 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.

Constructors

ShelleyGenesis 

Fields

Instances

Instances details
Crypto c ⇒ FromJSON (ShelleyGenesis c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto c ⇒ ToJSON (ShelleyGenesis c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Generic (ShelleyGenesis c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Associated Types

type Rep (ShelleyGenesis c) ∷ TypeType Source #

Crypto c ⇒ Show (ShelleyGenesis c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto c ⇒ FromCBOR (ShelleyGenesis c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto c ⇒ ToCBOR (ShelleyGenesis c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

toCBORShelleyGenesis c → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (ShelleyGenesis c) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyGenesis c] → Size Source #

Crypto c ⇒ DecCBOR (ShelleyGenesis c) Source #

Genesis are always encoded with the version of era they are defined in.

Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto c ⇒ EncCBOR (ShelleyGenesis c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

encCBORShelleyGenesis c → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (ShelleyGenesis c) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyGenesis c] → Size Source #

Crypto c ⇒ Eq (ShelleyGenesis c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto c ⇒ NoThunks (ShelleyGenesis c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep (ShelleyGenesis c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep (ShelleyGenesis c) = D1 ('MetaData "ShelleyGenesis" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.11.0.0-inplace" 'False) (C1 ('MetaCons "ShelleyGenesis" 'PrefixI 'True) (((S1 ('MetaSel ('Just "sgSystemStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UTCTime) :*: (S1 ('MetaSel ('Just "sgNetworkMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "sgNetworkId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network))) :*: ((S1 ('MetaSel ('Just "sgActiveSlotsCoeff") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PositiveUnitInterval) :*: S1 ('MetaSel ('Just "sgSecurityParam") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :*: (S1 ('MetaSel ('Just "sgEpochLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochSize) :*: S1 ('MetaSel ('Just "sgSlotsPerKESPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)))) :*: (((S1 ('MetaSel ('Just "sgMaxKESEvolutions") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgSlotLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTimeMicro)) :*: (S1 ('MetaSel ('Just "sgUpdateQuorum") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgMaxLovelaceSupply") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64))) :*: ((S1 ('MetaSel ('Just "sgProtocolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams (ShelleyEra c))) :*: S1 ('MetaSel ('Just "sgGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'Genesis c) (GenDelegPair c)))) :*: (S1 ('MetaSel ('Just "sgInitialFunds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (Addr c) Coin)) :*: S1 ('MetaSel ('Just "sgStaking") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ShelleyGenesisStaking c)))))))

newtype NominalDiffTimeMicro Source #

Unlike NominalDiffTime that supports Pico precision, this type only supports Micro precision.

Instances

Instances details
FromJSON NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

ToJSON NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Generic NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Associated Types

type Rep NominalDiffTimeMicroTypeType Source #

Num NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Fractional NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Real NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Show NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

DecCBOR NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

EncCBOR NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Eq NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Ord NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

NoThunks NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep NominalDiffTimeMicro Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep NominalDiffTimeMicro = D1 ('MetaData "NominalDiffTimeMicro" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.11.0.0-inplace" 'True) (C1 ('MetaCons "NominalDiffTimeMicro" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Micro)))

genesisUTxO ∷ ∀ era. EraTxOut era ⇒ ShelleyGenesis (EraCrypto era) → UTxO era Source #

initialFundsPseudoTxIn ∷ ∀ c. Crypto c ⇒ Addr c → TxIn c Source #

Compute the TxIn of the initial UTxO pseudo-transaction corresponding to the given address in the genesis initial funds.

The Shelley initial UTxO is constructed from the sgInitialFunds which is not a full UTxO but just a map from addresses to coin values.

This gets turned into a UTxO by making a pseudo-transaction for each address, with the 0th output being the coin value. So to spend from the initial UTxO we need this same TxIn to use as an input to the spending transaction.

validateGenesis ∷ ∀ c. Crypto c ⇒ ShelleyGenesis c → Either [ValidationErr] () Source #

Do some basic sanity checking on the Shelley genesis file.