cardano-ledger-byron-0.1.0.0: The blockchain layer of Cardano during the Byron era
Safe Haskell None
Language Haskell2010

Cardano.Chain.Genesis

Synopsis

Documentation

data GenesisSpec Source #

Specification how to generate full GenesisData

Constructors

UnsafeGenesisSpec

Fields

Instances

Instances details
Eq GenesisSpec Source #
Instance details

Defined in Cardano.Chain.Genesis.Spec

Show GenesisSpec Source #
Instance details

Defined in Cardano.Chain.Genesis.Spec

Generic GenesisSpec Source #
Instance details

Defined in Cardano.Chain.Genesis.Spec

type Rep GenesisSpec Source #
Instance details

Defined in Cardano.Chain.Genesis.Spec

newtype GenesisNonAvvmBalances Source #

Predefined balances of non avvm entries.

Instances

Instances details
Eq GenesisNonAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

Show GenesisNonAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

Semigroup GenesisNonAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

Monoid GenesisNonAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

ToCBOR GenesisNonAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

FromCBOR GenesisNonAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

Buildable GenesisNonAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

NoThunks GenesisNonAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.NonAvvmBalances

Monad m => ToJSON m 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

convertNonAvvmDataToBalances :: forall 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
Eq GenesisKeyHashes Source #
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

Show GenesisKeyHashes Source #
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

Semigroup GenesisKeyHashes Source #
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

Monoid GenesisKeyHashes Source #
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

ToCBOR GenesisKeyHashes Source #
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

FromCBOR GenesisKeyHashes Source #
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

Buildable GenesisKeyHashes Source #
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

NoThunks GenesisKeyHashes Source #
Instance details

Defined in Cardano.Chain.Genesis.KeyHashes

Monad m => ToJSON m 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

data FakeAvvmOptions Source #

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

newtype GenesisHash Source #

Instances

Instances details
Eq GenesisHash Source #
Instance details

Defined in Cardano.Chain.Genesis.Hash

Show GenesisHash Source #
Instance details

Defined in Cardano.Chain.Genesis.Hash

Generic GenesisHash Source #
Instance details

Defined in Cardano.Chain.Genesis.Hash

NFData GenesisHash Source #
Instance details

Defined in Cardano.Chain.Genesis.Hash

ToJSON GenesisHash Source #
Instance details

Defined in Cardano.Chain.Genesis.Hash

ToCBOR GenesisHash Source #
Instance details

Defined in Cardano.Chain.Genesis.Hash

FromCBOR 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-0.1.0.0-1U5kXR8zMRrE7QjCz70XVD" ' 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

generateGenesisData :: UTCTime -> GenesisSpec -> ExceptT 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.

generateGenesisDataWithEntropy :: MonadRandom m => UTCTime -> GenesisSpec -> ExceptT 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.

generateGenesisConfig :: UTCTime -> GenesisSpec -> ExceptT 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.

generateGenesisConfigWithEntropy :: MonadRandom m => UTCTime -> GenesisSpec -> ExceptT 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
Eq GenesisDelegation Source #
Instance details

Defined in Cardano.Chain.Genesis.Delegation

Show GenesisDelegation Source #
Instance details

Defined in Cardano.Chain.Genesis.Delegation

ToCBOR GenesisDelegation Source #
Instance details

Defined in Cardano.Chain.Genesis.Delegation

FromCBOR GenesisDelegation Source #
Instance details

Defined in Cardano.Chain.Genesis.Delegation

NoThunks GenesisDelegation Source #
Instance details

Defined in Cardano.Chain.Genesis.Delegation

Monad m => ToJSON m 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

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

Defined in Cardano.Chain.Genesis.Data

Show GenesisData Source #
Instance details

Defined in Cardano.Chain.Genesis.Data

Generic GenesisData Source #
Instance details

Defined in Cardano.Chain.Genesis.Data

ToCBOR GenesisData Source #
Instance details

Defined in Cardano.Chain.Genesis.Data

FromCBOR GenesisData Source #
Instance details

Defined in Cardano.Chain.Genesis.Data

NoThunks GenesisData Source #
Instance details

Defined in Cardano.Chain.Genesis.Data

Monad m => ToJSON m 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

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

Defined in Cardano.Chain.Genesis.Config

Show Config Source #
Instance details

Defined in Cardano.Chain.Genesis.Config

Generic Config Source #
Instance details

Defined in Cardano.Chain.Genesis.Config

ToCBOR Config Source #
Instance details

Defined in Cardano.Chain.Genesis.Config

FromCBOR Config Source #
Instance details

Defined in Cardano.Chain.Genesis.Config

NoThunks Config Source #
Instance details

Defined in Cardano.Chain.Genesis.Config

type Rep Config Source #
Instance details

Defined in Cardano.Chain.Genesis.Config

configProtocolMagic :: Config -> ProtocolMagic 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 #

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

Defined in Cardano.Chain.Genesis.AvvmBalances

Show GenesisAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

Semigroup GenesisAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

ToCBOR GenesisAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

FromCBOR GenesisAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

NoThunks GenesisAvvmBalances Source #
Instance details

Defined in Cardano.Chain.Genesis.AvvmBalances

Monad m => ToJSON m 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