cardano-api
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.Genesis

Synopsis

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

Instances details
FromJSON ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

parseJSON :: Value -> Parser ShelleyGenesis #

parseJSONList :: Value -> Parser [ShelleyGenesis] #

omittedField :: Maybe ShelleyGenesis #

ToJSON ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

FromCBOR ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

ToCBOR ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

DecCBOR ShelleyGenesis

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

Instance details

Defined in Cardano.Ledger.Shelley.Genesis

EncCBOR ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

ToKeyValuePairs ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

toKeyValuePairs :: KeyValue e kv => ShelleyGenesis -> [kv] Source #

NFData ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

rnf :: ShelleyGenesis -> () Source #

Generic ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Associated Types

type Rep ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep ShelleyGenesis = D1 ('MetaData "ShelleyGenesis" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.17.0.0-52a1c12294aa294e7f10247cc7840c8ba11786444096bf1250f4c002200eb98d" '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 PositiveUnitInterval) :*: S1 ('MetaSel ('Just "sgSecurityParam") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 (NonZero 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 NominalDiffTimeMicro)) :*: (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 ShelleyEra)) :*: S1 ('MetaSel ('Just "sgGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'Genesis) GenDelegPair))) :*: (S1 ('MetaSel ('Just "sgInitialFunds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap Addr Coin)) :*: S1 ('MetaSel ('Just "sgStaking") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShelleyGenesisStaking))))))
Show ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Eq ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

NoThunks ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

noThunks :: Context -> ShelleyGenesis -> IO (Maybe ThunkInfo) #

wNoThunks :: Context -> ShelleyGenesis -> IO (Maybe ThunkInfo) #

showTypeOf :: Proxy ShelleyGenesis -> String #

type Rep ShelleyGenesis 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep ShelleyGenesis = D1 ('MetaData "ShelleyGenesis" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.17.0.0-52a1c12294aa294e7f10247cc7840c8ba11786444096bf1250f4c002200eb98d" '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 PositiveUnitInterval) :*: S1 ('MetaSel ('Just "sgSecurityParam") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 (NonZero 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 NominalDiffTimeMicro)) :*: (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 ShelleyEra)) :*: S1 ('MetaSel ('Just "sgGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'Genesis) GenDelegPair))) :*: (S1 ('MetaSel ('Just "sgInitialFunds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap Addr Coin)) :*: S1 ('MetaSel ('Just "sgStaking") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShelleyGenesisStaking))))))

shelleyGenesisDefaults :: ShelleyGenesis Source #

Some reasonable starting defaults for constructing a ShelleyGenesis.

You must override at least the following fields for this to be useful:

Configuration

Files

Protocol parameters fixed in the genesis file

data GenesisParameters era Source #

Constructors

GenesisParameters 

Fields

newtype EpochSize Source #

Constructors

EpochSize 

Fields

Instances

Instances details
FromJSON EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

Methods

parseJSON :: Value -> Parser EpochSize #

parseJSONList :: Value -> Parser [EpochSize] #

omittedField :: Maybe EpochSize #

ToJSON EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toJSON :: EpochSize -> Value #

toEncoding :: EpochSize -> Encoding #

toJSONList :: [EpochSize] -> Value #

toEncodingList :: [EpochSize] -> Encoding #

omitField :: EpochSize -> Bool #

FromCBOR EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

ToCBOR EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBOR :: EpochSize -> Encoding Source #

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

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

DecCBOR EpochSize 
Instance details

Defined in Cardano.Ledger.Binary.Decoding.DecCBOR

EncCBOR EpochSize 
Instance details

Defined in Cardano.Ledger.Binary.Encoding.EncCBOR

NFData EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

Methods

rnf :: EpochSize -> () Source #

Enum EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

Generic EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

Associated Types

type Rep EpochSize 
Instance details

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)))
Show EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

Eq EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

Ord EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

NoThunks EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

Methods

noThunks :: Context -> EpochSize -> IO (Maybe ThunkInfo) #

wNoThunks :: Context -> EpochSize -> IO (Maybe ThunkInfo) #

showTypeOf :: Proxy EpochSize -> String #

type Rep EpochSize 
Instance details

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.