ouroboros-consensus-cardano-0.25.1.0: The instantation of the Ouroboros consensus layer used by Cardano
Safe HaskellNone
LanguageHaskell2010

Cardano.Tools.DBImmutaliser.Run

Synopsis

Documentation

data Opts Source #

Constructors

Opts 

runOptsIO () Source #

Setup

data DBDirs a Source #

Constructors

DBDirs 

Fields

Instances

Instances details
Functor DBDirs Source # 
Instance details

Defined in Cardano.Tools.DBImmutaliser.Run

Methods

fmap ∷ (a → b) → DBDirs a → DBDirs b #

(<$) ∷ a → DBDirs b → DBDirs a #

Foldable DBDirs Source # 
Instance details

Defined in Cardano.Tools.DBImmutaliser.Run

Methods

foldMonoid m ⇒ DBDirs m → m #

foldMapMonoid m ⇒ (a → m) → DBDirs a → m #

foldMap'Monoid m ⇒ (a → m) → DBDirs a → m #

foldr ∷ (a → b → b) → b → DBDirs a → b #

foldr' ∷ (a → b → b) → b → DBDirs a → b #

foldl ∷ (b → a → b) → b → DBDirs a → b #

foldl' ∷ (b → a → b) → b → DBDirs a → b #

foldr1 ∷ (a → a → a) → DBDirs a → a #

foldl1 ∷ (a → a → a) → DBDirs a → a #

toListDBDirs a → [a] #

nullDBDirs a → Bool #

lengthDBDirs a → Int #

elemEq a ⇒ a → DBDirs a → Bool #

maximumOrd a ⇒ DBDirs a → a #

minimumOrd a ⇒ DBDirs a → a #

sumNum a ⇒ DBDirs a → a #

productNum a ⇒ DBDirs a → a #

Traversable DBDirs Source # 
Instance details

Defined in Cardano.Tools.DBImmutaliser.Run

Methods

traverseApplicative f ⇒ (a → f b) → DBDirs a → f (DBDirs b) #

sequenceAApplicative f ⇒ DBDirs (f a) → f (DBDirs a) #

mapMMonad m ⇒ (a → m b) → DBDirs a → m (DBDirs b) #

sequenceMonad m ⇒ DBDirs (m a) → m (DBDirs a) #

Immutalise

data TraceImmutalisationEvent blk Source #

Constructors

TraceStartImmutalisation 

Fields

TraceReachableBlocks 

Fields

  • [BlockInfo blk]

    The set of volatile blocks reachable from the immutable tip.

TraceNoVolatileCandidate

No blocks in the VolatileDB extend the immutable tip.

TraceAllCandidates

Found these volatile candidates extending the immutable tip.

Fields

TraceCandidateToImmutalise

The volatile candidate to immutalise.

Fields

TraceCopiedtoImmutableDB 

Fields

immutalise Source #

Arguments

∷ (IOLike m, BlockSupportsProtocol blk) 
BlockConfig blk 
Tracer m (TraceImmutalisationEvent blk) 
Bool

Dry run?

ImmutableDB m blk 
VolatileDB m blk 
→ m () 

Copy a specific chain from the given VolatileDB to the ImmutableDB, such that other tools that only work with an ImmutableDB can process the corresponding blocks.

This function requires exclusive access to the databases.

Currently, this will pick the best (according to the SelectView) chain extending the immutable tip, and it will _not_ do any kind of validation.

Future work might include customizing this behavior, like:

  • picking the best _valid_ chain (requires reading a ledger snapshot and/or replaying)
  • picking a chain that contains particular points (user input)