cardano-rpc
Safe HaskellNone
LanguageHaskell2010

Cardano.Rpc.Server.Internal.UtxoRpc.Type.Genesis

Description

Conversion of the network's per-era genesis configuration to the UTxO RPC Genesis message.

The Genesis message has one field per Byron, Shelley, Alonzo and Conway genesis parameter. Each era is mapped by an updater over one shared accumulator (byronGenesisToProto, shelleyGenesisToProto, alonzoGenesisToProto, conwayGenesisToProto); genesisBundleToProto threads a single defMessage through all four. The shared accumulator lets Alonzo and Conway both contribute to the single cost_models field (PlutusV1 from Alonzo, PlutusV3 from Conway) without any message merge.

Synopsis

Documentation

genesisBundleToProto :: GenesisBundle -> ShelleyGenesis -> Proto Genesis Source #

Convert the network's genesis bundle to the UTxO RPC Genesis message, populating the Byron, Shelley, Alonzo and Conway fields.

The Shelley genesis is passed in separately rather than taken from the bundle, because the copy the bundle holds is the one consensus compacted: its initial funds have to be recovered from the genesis file first, which is a read and so cannot happen in this pure mapping (see readGenesisMethod).

Per-era mappers

Exported for differential fixture testing against real genesis JSON (see Test.Cardano.Rpc.Genesis.Fixture); not part of the public API.