cardano-ledger-byron-1.0.3.0: The blockchain layer of Cardano during the Byron era
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Chain.Genesis

Synopsis

Documentation

data GenesisSpec Source #

Specification how to generate full GenesisData

Constructors

UnsafeGenesisSpec 

Fields

Instances

Instances details
Generic GenesisSpec Source # 
Instance details

Defined in Cardano.Chain.Genesis.Spec

Associated Types

type Rep GenesisSpecTypeType Source #

Show GenesisSpec Source # 
Instance details

Defined in Cardano.Chain.Genesis.Spec

Eq GenesisSpec Source # 
Instance details

Defined in Cardano.Chain.Genesis.Spec

type Rep GenesisSpec Source # 
Instance details

Defined in Cardano.Chain.Genesis.Spec

mkGenesisSpecGenesisAvvmBalancesGenesisDelegationProtocolParametersBlockCountProtocolMagicGenesisInitializerEither Text GenesisSpec Source #

Safe constructor for GenesisSpec. Throws error if something goes wrong.

newtype GenesisNonAvvmBalances Source #

Predefined balances of non avvm entries.

Instances

Instances details
Monoid GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

Semigroup GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

Show GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

FromCBOR GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

ToCBOR GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

DecCBOR GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

EncCBOR GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

Buildable GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

Eq GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

NoThunks GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

MonadError SchemaError m ⇒ FromJSON m GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

Monad m ⇒ ToJSON m GenesisNonAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

convertNonAvvmDataToBalances ∷ ∀ m. MonadError NonAvvmBalancesError m ⇒ Map Text Integer → m GenesisNonAvvmBalances Source #

Generate genesis address distribution out of avvm parameters. Txdistr of the utxo is all empty. Redelegate it in calling function.

newtype GenesisKeyHashes Source #

The set of genesis keys, who are able to produce blocks and submit votes and proposals in the Byron era

Instances

Instances details
Monoid GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

Semigroup GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

Show GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

FromCBOR GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

ToCBOR GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

DecCBOR GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

EncCBOR GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

Buildable GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

Eq GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

NoThunks GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

MonadError SchemaError m ⇒ FromJSON m GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

Monad m ⇒ ToJSON m GenesisKeyHashes Source # 
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

data GenesisInitializer Source #

Options determining generated genesis stakes, balances, and delegation

Constructors

GenesisInitializer 

Fields

data TestnetBalanceOptions Source #

These options determine balances of nodes specific for testnet

Constructors

TestnetBalanceOptions 

Fields

data FakeAvvmOptions Source #

These options determines balances of fake AVVM nodes which didn't really go through vending, but pretend they did

Constructors

FakeAvvmOptions 

Fields

Instances

Instances details
Generic FakeAvvmOptions Source # 
Instance details

Defined in Cardano.Chain.Genesis.Initializer

Associated Types

type Rep FakeAvvmOptionsTypeType Source #

Show FakeAvvmOptions Source # 
Instance details

Defined in Cardano.Chain.Genesis.Initializer

Eq FakeAvvmOptions Source # 
Instance details

Defined in Cardano.Chain.Genesis.Initializer

type Rep FakeAvvmOptions Source # 
Instance details

Defined in Cardano.Chain.Genesis.Initializer

type Rep FakeAvvmOptions = D1 ('MetaData "FakeAvvmOptions" "Cardano.Chain.Genesis.Initializer" "cardano-ledger-byron-1.0.3.0-inplace" 'False) (C1 ('MetaCons "FakeAvvmOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "faoCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word) :*: S1 ('MetaSel ('Just "faoOneBalance") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Lovelace)))

newtype GenesisHash Source #

Constructors

GenesisHash 

Fields

Instances

Instances details
ToJSON GenesisHash Source # 
Instance details

Defined in Cardano.Chain.Genesis.Hash

Generic GenesisHash Source # 
Instance details

Defined in Cardano.Chain.Genesis.Hash

Associated Types

type Rep GenesisHashTypeType Source #

Show GenesisHash Source # 
Instance details

Defined in Cardano.Chain.Genesis.Hash

DecCBOR GenesisHash Source # 
Instance details

Defined in Cardano.Chain.Genesis.Hash

EncCBOR GenesisHash Source # 
Instance details

Defined in Cardano.Chain.Genesis.Hash

Methods

encCBORGenesisHashEncoding Source #

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

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

NFData GenesisHash Source # 
Instance details

Defined in Cardano.Chain.Genesis.Hash

Methods

rnfGenesisHash → () Source #

Eq GenesisHash Source # 
Instance details

Defined in Cardano.Chain.Genesis.Hash

NoThunks GenesisHash Source # 
Instance details

Defined in Cardano.Chain.Genesis.Hash

type Rep GenesisHash Source # 
Instance details

Defined in Cardano.Chain.Genesis.Hash

type Rep GenesisHash = D1 ('MetaData "GenesisHash" "Cardano.Chain.Genesis.Hash" "cardano-ledger-byron-1.0.3.0-inplace" 'True) (C1 ('MetaCons "GenesisHash" 'PrefixI 'True) (S1 ('MetaSel ('Just "unGenesisHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Hash Raw))))

data GeneratedSecrets Source #

Valuable secrets which can unlock genesis data.

Constructors

GeneratedSecrets 

Fields

Instances

Instances details
Generic GeneratedSecrets Source # 
Instance details

Defined in Cardano.Chain.Genesis.Generate

Associated Types

type Rep GeneratedSecretsTypeType Source #

NoThunks GeneratedSecrets Source # 
Instance details

Defined in Cardano.Chain.Genesis.Generate

type Rep GeneratedSecrets Source # 
Instance details

Defined in Cardano.Chain.Genesis.Generate

type Rep GeneratedSecrets = D1 ('MetaData "GeneratedSecrets" "Cardano.Chain.Genesis.Generate" "cardano-ledger-byron-1.0.3.0-inplace" 'False) (C1 ('MetaCons "GeneratedSecrets" 'PrefixI 'True) ((S1 ('MetaSel ('Just "gsDlgIssuersSecrets") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [SigningKey]) :*: S1 ('MetaSel ('Just "gsRichSecrets") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [SigningKey])) :*: (S1 ('MetaSel ('Just "gsPoorSecrets") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [PoorSecret]) :*: S1 ('MetaSel ('Just "gsFakeAvvmSecrets") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [RedeemSigningKey]))))

newtype PoorSecret Source #

Poor node secret

Constructors

PoorSecret 

Instances

Instances details
Generic PoorSecret Source # 
Instance details

Defined in Cardano.Chain.Genesis.Generate

Associated Types

type Rep PoorSecretTypeType Source #

NoThunks PoorSecret Source # 
Instance details

Defined in Cardano.Chain.Genesis.Generate

type Rep PoorSecret Source # 
Instance details

Defined in Cardano.Chain.Genesis.Generate

type Rep PoorSecret = D1 ('MetaData "PoorSecret" "Cardano.Chain.Genesis.Generate" "cardano-ledger-byron-1.0.3.0-inplace" 'True) (C1 ('MetaCons "PoorSecret" 'PrefixI 'True) (S1 ('MetaSel ('Just "poorSecretToKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SigningKey)))

generateGenesisDataUTCTimeGenesisSpecExceptT GenesisDataGenerationError IO (GenesisData, GeneratedSecrets) Source #

Generate a genesis GenesisData and GeneratedSecrets from a GenesisSpec. This is used only for tests blockhains. For a real blockcain you must use the external key generation tool so that each stakeholder can generate their keys privately.

generateGenesisDataWithEntropyMonadRandom m ⇒ UTCTimeGenesisSpecExceptT GenesisDataGenerationError m (GenesisData, GeneratedSecrets) Source #

A version of generateGenesisData parametrised over MonadRandom. For testing purposes this allows using a completely pure deterministic entropy source, rather than a cryptographically secure entropy source.

generateGenesisConfigUTCTimeGenesisSpecExceptT GenesisDataGenerationError IO (Config, GeneratedSecrets) Source #

Generate a genesis Config from a GenesisSpec. This is used only for tests. For the real node we always generate an external JSON genesis file.

generateGenesisConfigWithEntropyMonadRandom m ⇒ UTCTimeGenesisSpecExceptT GenesisDataGenerationError m (Config, GeneratedSecrets) Source #

A version of generateGenesisConfig parametrised over MonadRandom. For testing purposes this allows using a completely pure deterministic entropy source, rather than a cryptographically secure entropy source.

newtype GenesisDelegation Source #

This type contains genesis state of heavyweight delegation. It wraps a map where keys are issuers and values are delegation certificates. There are some invariants:

  1. In each pair delegate must differ from issuer, i. e. no revocations.
  2. PSKs must be consistent with keys in the map, i. e. issuer's ID must be equal to the key in the map.
  3. Delegates can't be issuers, i. e. transitive delegation is not supported. It's not needed in genesis, it can always be reduced.

Instances

Instances details
Show GenesisDelegation Source # 
Instance details

Defined in Cardano.Chain.Genesis.Delegation

FromCBOR GenesisDelegation Source # 
Instance details

Defined in Cardano.Chain.Genesis.Delegation

ToCBOR GenesisDelegation Source # 
Instance details

Defined in Cardano.Chain.Genesis.Delegation

DecCBOR GenesisDelegation Source # 
Instance details

Defined in Cardano.Chain.Genesis.Delegation

EncCBOR GenesisDelegation Source # 
Instance details

Defined in Cardano.Chain.Genesis.Delegation

Eq GenesisDelegation Source # 
Instance details

Defined in Cardano.Chain.Genesis.Delegation

NoThunks GenesisDelegation Source # 
Instance details

Defined in Cardano.Chain.Genesis.Delegation

MonadError SchemaError m ⇒ FromJSON m GenesisDelegation Source # 
Instance details

Defined in Cardano.Chain.Genesis.Delegation

Monad m ⇒ ToJSON m GenesisDelegation Source # 
Instance details

Defined in Cardano.Chain.Genesis.Delegation

data GenesisData Source #

Genesis data contains all data which determines consensus rules. It must be same for all nodes. It's used to initialize global state, slotting, etc.

Instances

Instances details
Generic GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

Associated Types

type Rep GenesisDataTypeType Source #

Show GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

FromCBOR GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

ToCBOR GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

Methods

toCBORGenesisDataEncoding Source #

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

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

DecCBOR GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

EncCBOR GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

Methods

encCBORGenesisDataEncoding Source #

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

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

Eq GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

NoThunks GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

MonadError SchemaError m ⇒ FromJSON m GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

Monad m ⇒ ToJSON m GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

Methods

toJSONGenesisData → m JSValue Source #

type Rep GenesisData Source # 
Instance details

Defined in Cardano.Chain.Genesis.Data

readGenesisData ∷ (MonadError GenesisDataError m, MonadIO m) ⇒ FilePath → m (GenesisData, GenesisHash) Source #

Parse GenesisData from a JSON file and annotate with Canonical JSON hash

data Config Source #

Constructors

Config 

Fields

Instances

Instances details
Generic Config Source # 
Instance details

Defined in Cardano.Chain.Genesis.Config

Associated Types

type Rep ConfigTypeType Source #

Methods

fromConfigRep Config x Source #

toRep Config x → Config Source #

Show Config Source # 
Instance details

Defined in Cardano.Chain.Genesis.Config

FromCBOR Config Source # 
Instance details

Defined in Cardano.Chain.Genesis.Config

ToCBOR Config Source # 
Instance details

Defined in Cardano.Chain.Genesis.Config

Methods

toCBORConfigEncoding Source #

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

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

DecCBOR Config Source # 
Instance details

Defined in Cardano.Chain.Genesis.Config

EncCBOR Config Source # 
Instance details

Defined in Cardano.Chain.Genesis.Config

Methods

encCBORConfigEncoding Source #

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

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

Eq Config Source # 
Instance details

Defined in Cardano.Chain.Genesis.Config

Methods

(==)ConfigConfigBool Source #

(/=)ConfigConfigBool Source #

NoThunks Config Source # 
Instance details

Defined in Cardano.Chain.Genesis.Config

type Rep Config Source # 
Instance details

Defined in Cardano.Chain.Genesis.Config

type Rep Config = D1 ('MetaData "Config" "Cardano.Chain.Genesis.Config" "cardano-ledger-byron-1.0.3.0-inplace" 'False) (C1 ('MetaCons "Config" 'PrefixI 'True) ((S1 ('MetaSel ('Just "configGenesisData") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GenesisData) :*: S1 ('MetaSel ('Just "configGenesisHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GenesisHash)) :*: (S1 ('MetaSel ('Just "configReqNetMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RequiresNetworkMagic) :*: S1 ('MetaSel ('Just "configUTxOConfiguration") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UTxOConfiguration))))

data ConfigurationError Source #

Constructors

ConfigurationGenesisDataError GenesisDataError

An error in constructing GenesisData

GenesisHashMismatch GenesisHash (Hash Raw)

The GenesisData canonical JSON hash is different than expected

GenesisHashDecodeError Text

An error occured while decoding the genesis hash.

configProtocolMagicConfigProtocolMagic Source #

There isn't a full ProtocolMagic in Config, but the requisite ProtocolMagicId and RequiresNetworkMagic are stored separately. We use them to construct and return a ProtocolMagic.

mkConfigFromFile Source #

Arguments

∷ (MonadError ConfigurationError m, MonadIO m) 
RequiresNetworkMagic 
FilePath 
Hash Raw

The expected hash of the file

→ m Config 

Construct a Config from an external genesis file.

The FilePath refers to a canonical JSON file. It will be hashed and checked against the expected hash, which should be known from config.

newtype GenesisAvvmBalances Source #

Predefined balances of AVVM (Ada Voucher Vending Machine) entries. People who purchased Ada at a pre-sale were issued a certificate during the pre-sale period. These certificates allow customers to redeem ADA.

Instances

Instances details
Semigroup GenesisAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

Show GenesisAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

FromCBOR GenesisAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

ToCBOR GenesisAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

DecCBOR GenesisAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

EncCBOR GenesisAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

Eq GenesisAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

NoThunks GenesisAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

MonadError SchemaError m ⇒ FromJSON m GenesisAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

Monad m ⇒ ToJSON m GenesisAvvmBalances Source # 
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances