Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ShelleyGenesis c = ShelleyGenesis {
- sgSystemStart :: !UTCTime
- sgNetworkMagic :: !Word32
- sgNetworkId :: !Network
- sgActiveSlotsCoeff :: !PositiveUnitInterval
- sgSecurityParam :: !Word64
- sgEpochLength :: !EpochSize
- sgSlotsPerKESPeriod :: !Word64
- sgMaxKESEvolutions :: !Word64
- sgSlotLength :: !NominalDiffTimeMicro
- sgUpdateQuorum :: !Word64
- sgMaxLovelaceSupply :: !Word64
- sgProtocolParams :: !(PParams (ShelleyEra c))
- sgGenDelegs :: !(Map (KeyHash 'Genesis c) (GenDelegPair c))
- sgInitialFunds :: ListMap (Addr c) Coin
- sgStaking :: ShelleyGenesisStaking c
- shelleyGenesisDefaults :: ShelleyGenesis StandardCrypto
- alonzoGenesisDefaults :: CardanoEra era -> AlonzoGenesis
- decodeAlonzoGenesis :: forall era t (m :: Type -> Type). MonadTransError String t m => Maybe (CardanoEra era) -> ByteString -> t m AlonzoGenesis
- conwayGenesisDefaults :: ConwayGenesis StandardCrypto
- type ByronGenesisConfig = Config
- type ShelleyGenesisConfig = ShelleyConfig
- type AlonzoGenesisConfig = AlonzoGenesis
- type ConwayGenesisConfig = ConwayGenesis StandardCrypto
- data ShelleyConfig = ShelleyConfig {}
- newtype GenesisHashByron = GenesisHashByron {}
- newtype GenesisHashShelley = GenesisHashShelley {}
- newtype GenesisHashAlonzo = GenesisHashAlonzo {}
- newtype GenesisHashConway = GenesisHashConway {}
- type ByronGenesisFile = File ByronGenesisConfig
- type ShelleyGenesisFile = File ShelleyGenesisConfig
- type AlonzoGenesisFile = File AlonzoGenesisConfig
- type ConwayGenesisFile = File ConwayGenesisConfig
Documentation
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.
ShelleyGenesis | |
|
Instances
shelleyGenesisDefaults :: ShelleyGenesis StandardCrypto Source #
Some reasonable starting defaults for constructing a ShelleyGenesis
.
You must override at least the following fields for this to be useful:
sgSystemStart
the time of the first blocksgNetworkMagic
to a suitable testnet or mainnet network magic number.sgGenDelegs
to have some initial nodessgInitialFunds
to have any money in the systemsgMaxLovelaceSupply
must be at least the sum of thesgInitialFunds
but more if you want to allow for rewards.
alonzoGenesisDefaults :: CardanoEra era -> AlonzoGenesis Source #
Some reasonable starting defaults for constructing a AlonzoGenesis
.
Based on https://github.com/IntersectMBO/cardano-node/blob/master/cardano-testnet/src/Testnet/Defaults.hs
The era determines Plutus V2 cost model parameters:
* Conway: 185
* <= Babbage: 175
:: forall era t (m :: Type -> Type). MonadTransError String t m | |
=> Maybe (CardanoEra era) | An optional era witness in which we're reading the genesis |
-> ByteString | Genesis JSON |
-> t m AlonzoGenesis |
Decode Alonzo genesis in an optionally era sensitive way.
Because the Plutus V2 cost model has changed between Babbage and Conway era, we need to know the era if we want to decde Alonzo Genesis with a cost model baked in. If the V2 cost model is present in genesis, you need to provide an era witness.
When an era witness is provided, for Plutus V2 model the function additionally: 1. Does extra cost model parameters name validation: Checks for mandatory 175 parameters if provided in a map form. 2. If >= Conway: adds defaults for new 10 parameters, if they were not provided (maxBound) 3. Removes extra parameters above the max count: Babbage - 175, Conway - 185.
conwayGenesisDefaults :: ConwayGenesis StandardCrypto Source #
Some reasonable starting defaults for constructing a ConwayGenesis
.
Based on https://github.com/IntersectMBO/cardano-node/blob/master/cardano-testnet/src/Testnet/Defaults.hs
Configuration
type ByronGenesisConfig = Config Source #
type ShelleyGenesisConfig = ShelleyConfig Source #
type AlonzoGenesisConfig = AlonzoGenesis Source #
data ShelleyConfig Source #
newtype GenesisHashByron Source #
Instances
Show GenesisHashByron Source # | |
Defined in Cardano.Api.Genesis | |
Eq GenesisHashByron Source # | |
Defined in Cardano.Api.Genesis (==) :: GenesisHashByron -> GenesisHashByron -> Bool Source # (/=) :: GenesisHashByron -> GenesisHashByron -> Bool Source # |
newtype GenesisHashShelley Source #
Instances
Show GenesisHashShelley Source # | |
Defined in Cardano.Api.Genesis | |
Eq GenesisHashShelley Source # | |
Defined in Cardano.Api.Genesis (==) :: GenesisHashShelley -> GenesisHashShelley -> Bool Source # (/=) :: GenesisHashShelley -> GenesisHashShelley -> Bool Source # |
newtype GenesisHashAlonzo Source #
Instances
Show GenesisHashAlonzo Source # | |
Defined in Cardano.Api.Genesis | |
Eq GenesisHashAlonzo Source # | |
Defined in Cardano.Api.Genesis (==) :: GenesisHashAlonzo -> GenesisHashAlonzo -> Bool Source # (/=) :: GenesisHashAlonzo -> GenesisHashAlonzo -> Bool Source # |
newtype GenesisHashConway Source #
Instances
Show GenesisHashConway Source # | |
Defined in Cardano.Api.Genesis | |
Eq GenesisHashConway Source # | |
Defined in Cardano.Api.Genesis (==) :: GenesisHashConway -> GenesisHashConway -> Bool Source # (/=) :: GenesisHashConway -> GenesisHashConway -> Bool Source # |