Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Setup network
Synopsis
- newtype CalcMessageDelay blk = CalcMessageDelay ((CoreNodeId, CoreNodeId) → SlotNo → Header blk → NumSlots)
- data ForgeEbbEnv blk = ForgeEbbEnv {
- forgeEBB ∷ TopLevelConfig blk → SlotNo → BlockNo → ChainHash blk → blk
- type RekeyM m blk = CoreNodeId → ProtocolInfo blk → m [BlockForging m blk] → SlotNo → (SlotNo → m EpochNo) → m (TestNodeInitialization m blk)
- data TestNodeInitialization m blk = TestNodeInitialization {
- tniCrucialTxs ∷ [GenTx blk]
- tniProtocolInfo ∷ ProtocolInfo blk
- tniBlockForging ∷ m [BlockForging m blk]
- data ThreadNetworkArgs m blk = ThreadNetworkArgs {
- tnaForgeEbbEnv ∷ Maybe (ForgeEbbEnv blk)
- tnaFuture ∷ Future
- tnaJoinPlan ∷ NodeJoinPlan
- tnaNodeInfo ∷ CoreNodeId → TestNodeInitialization m blk
- tnaNumCoreNodes ∷ NumCoreNodes
- tnaNumSlots ∷ NumSlots
- tnaMessageDelay ∷ CalcMessageDelay blk
- tnaSeed ∷ Seed
- tnaMkRekeyM ∷ Maybe (m (RekeyM m blk))
- tnaRestarts ∷ NodeRestarts
- tnaTopology ∷ NodeTopology
- tnaTxGenExtra ∷ TxGenExtra blk
- tnaVersion ∷ NodeToNodeVersion
- tnaBlockVersion ∷ BlockNodeToNodeVersion blk
- type TracingConstraints blk = (Show blk, Show (ApplyTxErr blk), Show (Header blk), Show (GenTx blk), Show (Validated (GenTx blk)), Show (GenTxId blk), Show (ForgeStateInfo blk), Show (ForgeStateUpdateError blk), Show (CannotForge blk), HasNestedContent Header blk)
- noCalcMessageDelay ∷ CalcMessageDelay blk
- plainTestNodeInitialization ∷ ProtocolInfo blk → m [BlockForging m blk] → TestNodeInitialization 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)
- data MiniProtocolFatalException = MiniProtocolFatalException {}
- data MiniProtocolState
- data NodeDBs db = NodeDBs {
- nodeDBsImm ∷ db
- nodeDBsVol ∷ db
- nodeDBsLgr ∷ db
- nodeDBsGsm ∷ db
- data NodeOutput blk = NodeOutput {
- nodeOutputAdds ∷ Map SlotNo (Set (RealPoint blk, BlockNo))
- nodeOutputCannotForges ∷ Map SlotNo [CannotForge blk]
- nodeOutputFinalChain ∷ Chain blk
- nodeOutputFinalLedger ∷ LedgerState blk
- nodeOutputForges ∷ Map SlotNo blk
- nodeOutputHeaderAdds ∷ Map SlotNo [(RealPoint blk, BlockNo)]
- nodeOutputInvalids ∷ Map (RealPoint blk) [ExtValidationError blk]
- nodeOutputNodeDBs ∷ NodeDBs MockFS
- nodeOutputSelects ∷ Map SlotNo [(RealPoint blk, BlockNo)]
- nodeOutputUpdates ∷ [LedgerUpdate blk]
- nodePipeliningEvents ∷ [TracePipeliningEvent blk]
- data TestOutput blk = TestOutput {
- testOutputNodes ∷ Map NodeId (NodeOutput blk)
- testOutputTipBlockNos ∷ Map SlotNo (Map NodeId (WithOrigin BlockNo))
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.
CalcMessageDelay ((CoreNodeId, CoreNodeId) → SlotNo → Header blk → NumSlots) |
Instances
Show (CalcMessageDelay blk) Source # | This type occurs in records where most of the fields are data |
Defined in Test.ThreadNet.Network showsPrec ∷ Int → CalcMessageDelay blk → ShowS # show ∷ CalcMessageDelay blk → String # showList ∷ [CalcMessageDelay blk] → ShowS # |
data ForgeEbbEnv blk Source #
How to forge an EBB
ForgeEbbEnv | |
|
Instances
Show (ForgeEbbEnv blk) Source # | |
Defined in Test.ThreadNet.Network showsPrec ∷ Int → ForgeEbbEnv blk → ShowS # show ∷ ForgeEbbEnv blk → String # showList ∷ [ForgeEbbEnv blk] → ShowS # |
= 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) |
|
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
TestNodeInitialization | |
|
data ThreadNetworkArgs m blk Source #
Parameters for the test node net
ThreadNetworkArgs | |
|
type TracingConstraints blk = (Show blk, Show (ApplyTxErr blk), Show (Header blk), Show (GenTx blk), Show (Validated (GenTx blk)), Show (GenTxId blk), Show (ForgeStateInfo blk), Show (ForgeStateUpdateError blk), Show (CannotForge blk), HasNestedContent Header blk) Source #
plainTestNodeInitialization ∷ ProtocolInfo blk → m [BlockForging m blk] → TestNodeInitialization m blk Source #
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
data MiniProtocolFatalException Source #
Any synchronous exception from a directedEdge
MiniProtocolFatalException | |
|
Instances
data MiniProtocolState Source #
Instances
Show MiniProtocolState Source # | |
Defined in Test.ThreadNet.Network showsPrec ∷ Int → MiniProtocolState → ShowS # show ∷ MiniProtocolState → String # showList ∷ [MiniProtocolState] → ShowS # |
Test Output
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.
NodeDBs | |
|
Instances
Foldable NodeDBs | |
Defined in Test.Util.ChainDB fold ∷ Monoid m ⇒ NodeDBs m → m # foldMap ∷ Monoid 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 # elem ∷ Eq a ⇒ a → NodeDBs a → Bool # maximum ∷ Ord a ⇒ NodeDBs a → a # | |
Traversable NodeDBs | |
Functor NodeDBs | |
data NodeOutput blk Source #
NodeOutput | |
|
data TestOutput blk Source #
TestOutput | |
|