| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Api.Genesis
Synopsis
- data ShelleyGenesis = ShelleyGenesis {
- sgSystemStart :: !UTCTime
- sgNetworkMagic :: !Word32
- sgNetworkId :: !Network
- sgActiveSlotsCoeff :: !PositiveUnitInterval
- sgSecurityParam :: !(NonZero Word64)
- sgEpochLength :: !EpochSize
- sgSlotsPerKESPeriod :: !Word64
- sgMaxKESEvolutions :: !Word64
- sgSlotLength :: !NominalDiffTimeMicro
- sgUpdateQuorum :: !Word64
- sgMaxLovelaceSupply :: !Word64
- sgProtocolParams :: !(PParams ShelleyEra)
- sgGenDelegs :: !(Map (KeyHash 'Genesis) GenDelegPair)
- sgInitialFunds :: ListMap Addr Coin
- sgStaking :: ShelleyGenesisStaking
- shelleyGenesisDefaults :: ShelleyGenesis
- alonzoGenesisDefaults :: AlonzoGenesis
- conwayGenesisDefaults :: ConwayGenesis
- dijkstraGenesisDefaults :: DijkstraGenesis
- type ByronGenesisConfig = Config
- type ShelleyGenesisConfig = ShelleyConfig
- type AlonzoGenesisConfig = AlonzoGenesis
- type ConwayGenesisConfig = ConwayGenesis
- 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
- data GenesisParameters era = GenesisParameters {
- protocolParamSystemStart :: UTCTime
- protocolParamNetworkId :: NetworkId
- protocolParamActiveSlotsCoefficient :: Rational
- protocolParamSecurity :: NonZero Word64
- protocolParamEpochLength :: EpochSize
- protocolParamSlotLength :: NominalDiffTime
- protocolParamSlotsPerKESPeriod :: Int
- protocolParamMaxKESEvolutions :: Int
- protocolParamUpdateQuorum :: Int
- protocolParamMaxLovelaceSupply :: Coin
- protocolInitialUpdateableProtocolParameters :: PParams (ShelleyLedgerEra era)
- newtype EpochSize = EpochSize {}
- unsafeBoundedRational :: (HasCallStack, Typeable r, BoundedRational r) => Rational -> r
- fromShelleyGenesis :: ShelleyGenesis -> GenesisParameters ShelleyEra
Documentation
data ShelleyGenesis 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
shelleyGenesisDefaults :: ShelleyGenesis Source #
Some reasonable starting defaults for constructing a ShelleyGenesis.
You must override at least the following fields for this to be useful:
sgSystemStartthe time of the first blocksgNetworkMagicto a suitable testnet or mainnet network magic number.sgGenDelegsto have some initial nodessgInitialFundsto have any money in the systemsgMaxLovelaceSupplymust be at least the sum of thesgInitialFundsbut more if you want to allow for rewards.
alonzoGenesisDefaults :: 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
conwayGenesisDefaults :: ConwayGenesis 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 #
type ConwayGenesisConfig = ConwayGenesis Source #
data ShelleyConfig Source #
Constructors
| ShelleyConfig | |
Fields | |
newtype GenesisHashByron Source #
Constructors
| GenesisHashByron | |
Fields | |
Instances
| Show GenesisHashByron Source # | |
Defined in Cardano.Api.Genesis.Internal | |
| Eq GenesisHashByron Source # | |
Defined in Cardano.Api.Genesis.Internal Methods (==) :: GenesisHashByron -> GenesisHashByron -> Bool Source # (/=) :: GenesisHashByron -> GenesisHashByron -> Bool Source # | |
newtype GenesisHashShelley Source #
Constructors
| GenesisHashShelley | |
Fields | |
Instances
| Show GenesisHashShelley Source # | |
Defined in Cardano.Api.Genesis.Internal | |
| Eq GenesisHashShelley Source # | |
Defined in Cardano.Api.Genesis.Internal Methods (==) :: GenesisHashShelley -> GenesisHashShelley -> Bool Source # (/=) :: GenesisHashShelley -> GenesisHashShelley -> Bool Source # | |
newtype GenesisHashAlonzo Source #
Constructors
| GenesisHashAlonzo | |
Fields | |
Instances
| Show GenesisHashAlonzo Source # | |
Defined in Cardano.Api.Genesis.Internal | |
| Eq GenesisHashAlonzo Source # | |
Defined in Cardano.Api.Genesis.Internal Methods (==) :: GenesisHashAlonzo -> GenesisHashAlonzo -> Bool Source # (/=) :: GenesisHashAlonzo -> GenesisHashAlonzo -> Bool Source # | |
newtype GenesisHashConway Source #
Constructors
| GenesisHashConway | |
Fields | |
Instances
| Show GenesisHashConway Source # | |
Defined in Cardano.Api.Genesis.Internal | |
| Eq GenesisHashConway Source # | |
Defined in Cardano.Api.Genesis.Internal Methods (==) :: GenesisHashConway -> GenesisHashConway -> Bool Source # (/=) :: GenesisHashConway -> GenesisHashConway -> Bool Source # | |
Files
Protocol parameters fixed in the genesis file
data GenesisParameters era Source #
Constructors
| GenesisParameters | |
Fields
| |
Constructors
| EpochSize | |
Fields | |
Instances
| FromJSON EpochSize | |||||
Defined in Cardano.Slotting.Slot | |||||
| ToJSON EpochSize | |||||
Defined in Cardano.Slotting.Slot | |||||
| FromCBOR EpochSize | |||||
| ToCBOR EpochSize | |||||
| DecCBOR EpochSize | |||||
| EncCBOR EpochSize | |||||
| NFData EpochSize | |||||
Defined in Cardano.Slotting.Slot | |||||
| Enum EpochSize | |||||
Defined in Cardano.Slotting.Slot Methods succ :: EpochSize -> EpochSize Source # pred :: EpochSize -> EpochSize Source # toEnum :: Int -> EpochSize Source # fromEnum :: EpochSize -> Int Source # enumFrom :: EpochSize -> [EpochSize] Source # enumFromThen :: EpochSize -> EpochSize -> [EpochSize] Source # enumFromTo :: EpochSize -> EpochSize -> [EpochSize] Source # enumFromThenTo :: EpochSize -> EpochSize -> EpochSize -> [EpochSize] Source # | |||||
| Generic EpochSize | |||||
Defined in Cardano.Slotting.Slot Associated Types
| |||||
| Show EpochSize | |||||
| Eq EpochSize | |||||
| Ord EpochSize | |||||
Defined in Cardano.Slotting.Slot | |||||
| NoThunks EpochSize | |||||
| type Rep EpochSize | |||||
Defined in Cardano.Slotting.Slot type Rep EpochSize = D1 ('MetaData "EpochSize" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.1-847b3e1a144348197b73a3ae3bad4c6845e0a661324efbab5afbcef84a9cead6" 'True) (C1 ('MetaCons "EpochSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) | |||||
Utilities
unsafeBoundedRational :: (HasCallStack, Typeable r, BoundedRational r) => Rational -> r Source #
Convert Rational to a bounded rational. Throw an exception when the rational is out of bounds.