ouroboros-consensus:unstable-cardano-tools
Safe HaskellNone
LanguageHaskell2010

Cardano.Tools.DBSynthesizer.Run

Synopsis

Documentation

type CardanoProtocol = (ProtocolInfo (CardanoBlock StandardCrypto), Tracer IO KESAgentClientTrace → IO [MkBlockForging IO (CardanoBlock StandardCrypto)]) Source #

A Cardano protocol ready to forge with: the ProtocolInfo and the block forgers that protocolInfoCardano produces alongside it.

initialize Source #

Arguments

∷ FilePath

The node configuration file.

→ Credentials

The credential files, as named on the command line.

→ IO (ShelleyGenesis, CardanoProtocol) 

Build the protocol to forge with from a node configuration file and the forging credentials named on the command line.

The reading is done elsewhere: cardano-config resolves the configuration and loads every era's genesis, and Cardano.Tools.Credentials decodes the credentials. What is left here is the mapping onto the consensus types.

A problem with either is thrown as a ConfigError, as in the other tools, so the user gets a message rather than a backtrace.

The Shelley genesis comes back too because synthesize needs its epoch length.

synthesize Source #

Arguments

∷ (TopLevelConfig (CardanoBlock StandardCrypto) → GenTxs (CardanoBlock StandardCrypto)) 
→ DBSynthesizerOptions 
→ ShelleyGenesis

The same Shelley genesis the ProtocolInfo was built from; only its epoch length is used, to interpret a ForgeLimitEpoch.

→ FilePath

The directory of the ChainDB to forge into.

→ CardanoProtocol 
→ IO ForgeResult 

Forge a ChainDB from a ready-made Cardano ProtocolInfo and its block forgers (as produced by initialize). Constructing the protocol from a node configuration is the caller's responsibility, keeping this function free of any configuration machinery. In particular, the caller is also responsible for having validated the genesis (see validateGenesis).