Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data LiveInterval blk m = LiveInterval {
- liResources ∷ LiveResources blk m
- liResult ∷ LiveIntervalResult blk
- liNode ∷ LiveNode blk m
- data LiveIntervalResult blk = LiveIntervalResult {
- lirPeerResults ∷ [PeerSimulatorResult blk]
- lirActive ∷ Set PeerId
- data LiveNode blk m = LiveNode {
- lnChainDb ∷ ChainDB m blk
- lnStateViewTracers ∷ StateViewTracers blk m
- lnStateTracer ∷ Tracer m ()
- lnCopyToImmDb ∷ m (WithOrigin SlotNo)
- lnPeers ∷ Set PeerId
- data LiveResources blk m = LiveResources {
- lrRegistry ∷ ResourceRegistry m
- lrPeerSim ∷ PeerSimulatorResources m blk
- lrTracer ∷ Tracer m (TraceEvent blk)
- lrSTracer ∷ ChainDB m blk → m (Tracer m ())
- lrConfig ∷ TopLevelConfig blk
- lrCdb ∷ NodeDBs (StrictTMVar m MockFS)
- lrLoEVar ∷ LoE (StrictTVar m (AnchoredFragment (Header blk)))
- data NodeLifecycle blk m = NodeLifecycle {
- nlMinDuration ∷ Maybe DiffTime
- nlStart ∷ LiveIntervalResult blk → m (LiveNode blk m)
- nlShutdown ∷ LiveNode blk m → m (LiveIntervalResult blk)
- lifecycleStart ∷ ∀ m. IOLike m ⇒ (LiveInterval TestBlock m → m ()) → LiveResources TestBlock m → LiveIntervalResult TestBlock → m (LiveNode TestBlock m)
- lifecycleStop ∷ (IOLike m, GetHeader blk) ⇒ LiveResources blk m → LiveNode blk m → m (LiveIntervalResult blk)
- restoreNode ∷ IOLike m ⇒ LiveResources TestBlock m → LiveIntervalResult TestBlock → m (LiveNode TestBlock m)
Documentation
data LiveInterval blk m Source #
LiveInterval | |
|
data LiveIntervalResult blk Source #
Result of a node shutdown at the end of a live interval.
LiveIntervalResult | |
|
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.
LiveNode | |
|
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.
LiveResources | |
|
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.
NodeLifecycle | |
|
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.
restoreNode ∷ IOLike 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.