cardano-ledger-shelley-0.1.0.0
Safe Haskell None
Language Haskell2010

Cardano.Ledger.Shelley.Genesis

Synopsis

Documentation

data ShelleyGenesisStaking crypto 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) ( PoolParams crypto))

    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) ( KeyHash ' StakePool crypto))

    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 crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Show ( ShelleyGenesisStaking crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Generic ( ShelleyGenesisStaking crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto crypto => ToJSON ( ShelleyGenesisStaking crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto crypto => FromJSON ( ShelleyGenesisStaking crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto crypto => ToCBOR ( ShelleyGenesisStaking crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto crypto => FromCBOR ( ShelleyGenesisStaking crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

NoThunks ( ShelleyGenesisStaking crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep ( ShelleyGenesisStaking crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep ( ShelleyGenesisStaking crypto) = D1 (' MetaData "ShelleyGenesisStaking" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" ' False ) ( C1 (' MetaCons "ShelleyGenesisStaking" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "sgsPools") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Map ( KeyHash ' StakePool crypto) ( PoolParams crypto))) :*: S1 (' MetaSel (' Just "sgsStake") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Map ( KeyHash ' Staking crypto) ( KeyHash ' StakePool crypto)))))

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) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Show ( ShelleyGenesis era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Generic ( ShelleyGenesis era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Associated Types

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

Era era => ToJSON ( ShelleyGenesis era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Era era => FromJSON ( ShelleyGenesis era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Era era => ToCBOR ( ShelleyGenesis era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Era era => FromCBOR ( ShelleyGenesis era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Era era => NoThunks ( ShelleyGenesis era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep ( ShelleyGenesis era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep ( ShelleyGenesis era) = D1 (' MetaData "ShelleyGenesis" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" ' 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 NominalDiffTime )) :*: ( 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 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 ( Crypto era)) Coin )) :*: S1 (' MetaSel (' Just "sgStaking") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( ShelleyGenesisStaking ( Crypto era))))))))

initialFundsPseudoTxIn :: forall crypto. Crypto crypto => Addr crypto -> TxIn crypto 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 :: forall era. Era era => ShelleyGenesis era -> Either [ ValidationErr ] () Source #

Do some basic sanity checking on the Shelley genesis file.