ouroboros-consensus-cardano-0.20.0.0: The instantation of the Ouroboros consensus layer used by Cardano
Safe HaskellSafe-Inferred
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
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) #

Functor DBDirs Source # 
Instance details

Defined in Cardano.Tools.DBImmutaliser.Run

Methods

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

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

Immutalise

data TraceImmutalisationEvent blk Source #

Constructors

TraceStartImmutalisation 

Fields

TraceNoVolatileCandidate

No blocks in the VolatileDB extend the immutable tip.

TraceFoundCandidate

Found a volatile candidate extending the immutable tip.

Fields

TraceCopiedtoImmutableDB 

Fields

immutalise ∷ ∀ m blk. (IOLike m, BlockSupportsProtocol blk) ⇒ BlockConfig blk → Tracer m (TraceImmutalisationEvent blk) → ImmutableDB m blk → VolatileDB m blk → m () Source #

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)