consensus-test
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Consensus.PeerSimulator.NodeLifecycle

Synopsis

Documentation

data LiveInterval blk m Source #

Constructors

LiveInterval 

Fields

data LiveIntervalResult blk Source #

Result of a node shutdown at the end of a live interval.

Constructors

LiveIntervalResult 

Fields

data LiveNode blk m Source #

Resources used for a single live interval of the node, constructed when the node is started. When the node is shut down, lnCopyToImmDb is used to persist the current chain.

Constructors

LiveNode 

Fields

data LiveResources blk m Source #

Resources used by the handlers lifecycleStart and lifecycleStop to shut down running components, construct tracers used for single intervals, and reset and persist state.

Constructors

LiveResources 

Fields

data NodeLifecycle blk m Source #

Handlers for starting the node and shutting it down for each live interval, using the state of the previous run.

Constructors

NodeLifecycle 

Fields

lifecycleStart ∷ ∀ m. IOLike m ⇒ (LiveInterval TestBlock m → m ()) → LiveResources TestBlock m → LiveIntervalResult TestBlock → m (LiveNode TestBlock m) Source #

Allocate resources with restoreNode and pass them to the callback that starts the node's threads.

lifecycleStop ∷ (IOLike m, GetHeader blk) ⇒ LiveResources blk m → LiveNode blk m → m (LiveIntervalResult blk) Source #

Shut down the node by killing all its threads after extracting the persistent state used to restart the node later.

restoreNodeIOLike m ⇒ LiveResources TestBlock m → LiveIntervalResult TestBlock → m (LiveNode TestBlock m) Source #

Allocate all the resources that depend on the results of previous live intervals, the ChainDB and its persisted state.