ouroboros-consensus-diffusion-0.18.0.0: Integration for the Ouroboros Network layer
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.ThreadNet.Network

Description

Setup network

Synopsis

Documentation

newtype CalcMessageDelay blk Source #

Compute the chain diffusion delay

This is the number of slots a MsgRollForward should arrive after the forge slot of the header it is carrying.

It may depend on the (sender, recipient), the current slot, and header.

Constructors

CalcMessageDelay ((CoreNodeId, CoreNodeId) → SlotNoHeader blk → NumSlots) 

Instances

Instances details
Show (CalcMessageDelay blk) Source #

This type occurs in records where most of the fields are data

Instance details

Defined in Test.ThreadNet.Network

data ForgeEbbEnv blk Source #

How to forge an EBB

Constructors

ForgeEbbEnv 

Fields

Instances

Instances details
Show (ForgeEbbEnv blk) Source # 
Instance details

Defined in Test.ThreadNet.Network

Methods

showsPrecIntForgeEbbEnv blk → ShowS #

showForgeEbbEnv blk → String #

showList ∷ [ForgeEbbEnv blk] → ShowS #

type RekeyM m blk Source #

Arguments

 = CoreNodeId 
ProtocolInfo blk 
→ m [BlockForging m blk] 
SlotNo

The slot in which the node is rekeying

→ (SlotNo → m EpochNo)

Which epoch the slot is in

→ m (TestNodeInitialization m blk)

tniProtocolInfo should include new delegation cert/operational key, and tniCrucialTxs should include the new delegation certificate transaction

How to rekey a node with a fresh operational key

When there is a NodeRekey scheduled in the NodeRestarts, the test node will restart and use tnaRekeyM to compute its new ProtocolInfo.

data TestNodeInitialization m blk Source #

Data used when starting/restarting a node

Constructors

TestNodeInitialization 

Fields

  • tniCrucialTxs ∷ [GenTx blk]

    these transactions are added immediately and repeatedly (whenever the ledgerTipSlot changes)

    In particular, a leading node's crucial transactions must (if valid) enter its mempool each slot before the node takes the mempool snapshot that determines which transactions will be included in the block it's about to forge.

  • tniProtocolInfoProtocolInfo blk
     
  • tniBlockForging ∷ m [BlockForging m blk]
     

runThreadNetwork ∷ ∀ m blk. (IOLike m, MonadTime m, MonadTimer m, RunNode blk, TxGen blk, TracingConstraints blk, HasCallStack) ⇒ SystemTime m → ThreadNetworkArgs m blk → m (TestOutput blk) Source #

Setup a network of core nodes, where each joins according to the node join plan and is interconnected according to the node topology

We run for the specified number of blocks, then return the final state of each node.

Tracers

Test Output

data NodeDBs db Source #

A vector with an element for each database of a node

The db type parameter is instantiated by this module at types for mock filesystems; either the MockFS type or reference cells thereof.

Constructors

NodeDBs 

Fields

Instances

Instances details
Foldable NodeDBs 
Instance details

Defined in Test.Util.ChainDB

Methods

foldMonoid m ⇒ NodeDBs m → m #

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

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

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

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

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

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

foldr1 ∷ (a → a → a) → NodeDBs a → a #

foldl1 ∷ (a → a → a) → NodeDBs a → a #

toListNodeDBs a → [a] #

nullNodeDBs a → Bool #

lengthNodeDBs a → Int #

elemEq a ⇒ a → NodeDBs a → Bool #

maximumOrd a ⇒ NodeDBs a → a #

minimumOrd a ⇒ NodeDBs a → a #

sumNum a ⇒ NodeDBs a → a #

productNum a ⇒ NodeDBs a → a #

Traversable NodeDBs 
Instance details

Defined in Test.Util.ChainDB

Methods

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

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

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

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

Functor NodeDBs 
Instance details

Defined in Test.Util.ChainDB

Methods

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

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