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

Cardano.Tools.DBImmutaliser.Run

Synopsis

Documentation

data Opts Source #

Constructors

Opts 

run ∷ Opts → IO () 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

fold ∷ Monoid m ⇒ DBDirs m → m #

foldMap ∷ Monoid 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 #

toList ∷ DBDirs a → [a] #

null ∷ DBDirs a → Bool #

length ∷ DBDirs a → Int #

elem ∷ Eq a ⇒ a → DBDirs a → Bool #

maximum ∷ Ord a ⇒ DBDirs a → a #

minimum ∷ Ord a ⇒ DBDirs a → a #

sum ∷ Num a ⇒ DBDirs a → a #

product ∷ Num a ⇒ DBDirs a → a #

Traversable DBDirs Source # 
Instance details

Defined in Cardano.Tools.DBImmutaliser.Run

Methods

traverse ∷ Applicative f ⇒ (a → f b) → DBDirs a → f (DBDirs b) #

sequenceA ∷ Applicative f ⇒ DBDirs (f a) → f (DBDirs a) #

mapM ∷ Monad m ⇒ (a → m b) → DBDirs a → m (DBDirs b) #

sequence ∷ Monad m ⇒ DBDirs (m a) → m (DBDirs a) #

Immutalise

data TraceImmutalisationEvent blk Source #

Constructors

TraceStartImmutalisation 

Fields

  • (WithOrigin (Tip blk))

    Tip of the ImmutableDB.

  • MaxSlotNo

    MaxSlotNo of the VolatileDB.

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)