Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data GenesisSpec = UnsafeGenesisSpec {}
- mkGenesisSpec ∷ GenesisAvvmBalances → GenesisDelegation → ProtocolParameters → BlockCount → ProtocolMagic → GenesisInitializer → Either Text GenesisSpec
- newtype GenesisNonAvvmBalances = GenesisNonAvvmBalances {}
- convertNonAvvmDataToBalances ∷ ∀ m. MonadError NonAvvmBalancesError m ⇒ Map Text Integer → m GenesisNonAvvmBalances
- newtype GenesisKeyHashes = GenesisKeyHashes {}
- data GenesisInitializer = GenesisInitializer {}
- data TestnetBalanceOptions = TestnetBalanceOptions {}
- data FakeAvvmOptions = FakeAvvmOptions {}
- newtype GenesisHash = GenesisHash {}
- data GeneratedSecrets = GeneratedSecrets {}
- gsSigningKeys ∷ GeneratedSecrets → [SigningKey]
- gsSigningKeysPoor ∷ GeneratedSecrets → [SigningKey]
- newtype PoorSecret = PoorSecret {}
- generateGenesisData ∷ UTCTime → GenesisSpec → ExceptT GenesisDataGenerationError IO (GenesisData, GeneratedSecrets)
- generateGenesisDataWithEntropy ∷ MonadRandom m ⇒ UTCTime → GenesisSpec → ExceptT GenesisDataGenerationError m (GenesisData, GeneratedSecrets)
- generateGenesisConfig ∷ UTCTime → GenesisSpec → ExceptT GenesisDataGenerationError IO (Config, GeneratedSecrets)
- generateGenesisConfigWithEntropy ∷ MonadRandom m ⇒ UTCTime → GenesisSpec → ExceptT GenesisDataGenerationError m (Config, GeneratedSecrets)
- data GenesisDataGenerationError
- newtype GenesisDelegation = UnsafeGenesisDelegation {}
- data GenesisDelegationError
- mkGenesisDelegation ∷ MonadError GenesisDelegationError m ⇒ [Certificate] → m GenesisDelegation
- data GenesisData = GenesisData {}
- data GenesisDataError
- mainnetProtocolMagicId ∷ ProtocolMagicId
- readGenesisData ∷ (MonadError GenesisDataError m, MonadIO m) ⇒ FilePath → m (GenesisData, GenesisHash)
- data Config = Config {}
- data ConfigurationError
- configGenesisHeaderHash ∷ Config → HeaderHash
- configK ∷ Config → BlockCount
- configSlotSecurityParam ∷ Config → SlotCount
- configChainQualityThreshold ∷ Fractional f ⇒ Config → f
- configEpochSlots ∷ Config → EpochSlots
- configProtocolMagic ∷ Config → ProtocolMagic
- configProtocolMagicId ∷ Config → ProtocolMagicId
- configGenesisKeyHashes ∷ Config → GenesisKeyHashes
- configHeavyDelegation ∷ Config → GenesisDelegation
- configStartTime ∷ Config → UTCTime
- configNonAvvmBalances ∷ Config → GenesisNonAvvmBalances
- configProtocolParameters ∷ Config → ProtocolParameters
- configAvvmDistr ∷ Config → GenesisAvvmBalances
- mkConfigFromFile ∷ (MonadError ConfigurationError m, MonadIO m) ⇒ RequiresNetworkMagic → FilePath → Hash Raw → m Config
- newtype GenesisAvvmBalances = GenesisAvvmBalances {}
Documentation
data GenesisSpec Source #
Specification how to generate full GenesisData
UnsafeGenesisSpec | |
|
Instances
mkGenesisSpec ∷ GenesisAvvmBalances → GenesisDelegation → ProtocolParameters → BlockCount → ProtocolMagic → GenesisInitializer → Either Text GenesisSpec Source #
Safe constructor for GenesisSpec
. Throws error if something
goes wrong.
newtype GenesisNonAvvmBalances Source #
Predefined balances of non avvm entries.
Instances
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
data GenesisInitializer Source #
Options determining generated genesis stakes, balances, and delegation
GenesisInitializer | |
|
Instances
Show GenesisInitializer Source # | |
Defined in Cardano.Chain.Genesis.Initializer | |
Eq GenesisInitializer Source # | |
Defined in Cardano.Chain.Genesis.Initializer |
data TestnetBalanceOptions Source #
These options determine balances of nodes specific for testnet
TestnetBalanceOptions | |
|
Instances
data FakeAvvmOptions Source #
These options determines balances of fake AVVM nodes which didn't really go through vending, but pretend they did
Instances
Generic FakeAvvmOptions Source # | |
Defined in Cardano.Chain.Genesis.Initializer from ∷ FakeAvvmOptions → Rep FakeAvvmOptions x Source # to ∷ Rep FakeAvvmOptions x → FakeAvvmOptions Source # | |
Show FakeAvvmOptions Source # | |
Defined in Cardano.Chain.Genesis.Initializer | |
Eq FakeAvvmOptions Source # | |
Defined in Cardano.Chain.Genesis.Initializer | |
type Rep FakeAvvmOptions Source # | |
Defined in Cardano.Chain.Genesis.Initializer type Rep FakeAvvmOptions = D1 ('MetaData "FakeAvvmOptions" "Cardano.Chain.Genesis.Initializer" "cardano-ledger-byron-1.0.2.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 #
Instances
data GeneratedSecrets Source #
Valuable secrets which can unlock genesis data.
GeneratedSecrets | |
|
Instances
Generic GeneratedSecrets Source # | |
Defined in Cardano.Chain.Genesis.Generate | |
NoThunks GeneratedSecrets Source # | |
Defined in Cardano.Chain.Genesis.Generate | |
type Rep GeneratedSecrets Source # | |
Defined in Cardano.Chain.Genesis.Generate type Rep GeneratedSecrets = D1 ('MetaData "GeneratedSecrets" "Cardano.Chain.Genesis.Generate" "cardano-ledger-byron-1.0.2.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
Instances
Generic PoorSecret Source # | |
Defined in Cardano.Chain.Genesis.Generate from ∷ PoorSecret → Rep PoorSecret x Source # to ∷ Rep PoorSecret x → PoorSecret Source # | |
NoThunks PoorSecret Source # | |
Defined in Cardano.Chain.Genesis.Generate | |
type Rep PoorSecret Source # | |
Defined in Cardano.Chain.Genesis.Generate type Rep PoorSecret = D1 ('MetaData "PoorSecret" "Cardano.Chain.Genesis.Generate" "cardano-ledger-byron-1.0.2.0-inplace" 'True) (C1 ('MetaCons "PoorSecret" 'PrefixI 'True) (S1 ('MetaSel ('Just "poorSecretToKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SigningKey))) |
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.
data GenesisDataGenerationError 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:
- In each pair delegate must differ from issuer, i. e. no revocations.
- PSKs must be consistent with keys in the map, i. e. issuer's ID must be equal to the key in the map.
- Delegates can't be issuers, i. e. transitive delegation is not supported. It's not needed in genesis, it can always be reduced.
Instances
data GenesisDelegationError Source #
Instances
mkGenesisDelegation ∷ MonadError GenesisDelegationError m ⇒ [Certificate] → m GenesisDelegation Source #
Safe constructor of GenesisDelegation
from a list of Certificate
s
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
data GenesisDataError Source #
Instances
Show GenesisDataError Source # | |
Defined in Cardano.Chain.Genesis.Data | |
Buildable GenesisDataError Source # | |
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
Config | |
|
Instances
Generic Config Source # | |
Show Config Source # | |
FromCBOR Config Source # | |
ToCBOR Config Source # | |
DecCBOR Config Source # | |
EncCBOR Config Source # | |
Eq Config Source # | |
NoThunks Config Source # | |
type Rep Config Source # | |
Defined in Cardano.Chain.Genesis.Config type Rep Config = D1 ('MetaData "Config" "Cardano.Chain.Genesis.Config" "cardano-ledger-byron-1.0.2.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 #
ConfigurationGenesisDataError GenesisDataError | An error in constructing |
GenesisHashMismatch GenesisHash (Hash Raw) | The GenesisData canonical JSON hash is different than expected |
GenesisHashDecodeError Text | An error occured while decoding the genesis hash. |
Instances
Show ConfigurationError Source # | |
Defined in Cardano.Chain.Genesis.Config |
configK ∷ Config → BlockCount Source #
configChainQualityThreshold ∷ Fractional f ⇒ Config → f Source #
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
.
∷ (MonadError ConfigurationError m, MonadIO m) | |
⇒ RequiresNetworkMagic | |
→ FilePath | |
→ Hash Raw | The expected hash of the file |
→ m 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.