Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
A ChainSync protocol server that allows external scheduling of its operations, while deferring the implementation of the message handler logic to a simplified, abstract interface provided as a parameter.
Synopsis
- data ChainSyncServerHandlers m state blk = ChainSyncServerHandlers {
- csshRequestNext ∷ state → STM m (Maybe (RequestNext blk), [TraceScheduledChainSyncServerEvent state blk])
- csshFindIntersection ∷ [Point blk] → state → STM m (Maybe (FindIntersect blk), [TraceScheduledChainSyncServerEvent state blk])
- data FindIntersect blk
- = IntersectFound (Point blk) (Tip blk)
- | IntersectNotFound (Tip blk)
- data RequestNext blk
- = RollForward (Header blk) (Tip blk)
- | RollBackward (Point blk) (Tip blk)
- | AwaitReply
- data ScheduledChainSyncServer m state blk = ScheduledChainSyncServer {
- scssServer ∷ ScheduledServer m state blk
- scssTracer ∷ Tracer m (TraceScheduledChainSyncServerEvent state blk)
- scssHandlers ∷ ChainSyncServerHandlers m state blk
- runScheduledChainSyncServer ∷ IOLike m ⇒ PeerId → STM m () → STM m (Maybe (NodeState blk)) → Tracer m (TraceEvent blk) → ChainSyncServerHandlers m (NodeState blk) blk → ChainSyncServer (Header blk) (Point blk) (Tip blk) m ()
Documentation
data ChainSyncServerHandlers m state blk Source #
Handlers for the request a ChainSync server might receive from a client. These take an abstract argument that corresponds to the state of a point schedule tick and return the simplified protocol message types.
See runHandlerWithTrace
for the meaning of [String]
.
ChainSyncServerHandlers | |
|
data FindIntersect blk Source #
Pure representation of the messages produced by the handler for the StIntersect
protocol state of a ChainSync server.
IntersectFound (Point blk) (Tip blk) | |
IntersectNotFound (Tip blk) |
data RequestNext blk Source #
Pure representation of the messages produced by the handler for the StNext
protocol state of a ChainSync server.
RollForward (Header blk) (Tip blk) | |
RollBackward (Point blk) (Tip blk) | |
AwaitReply |
data ScheduledChainSyncServer m state blk Source #
Resources used by a ChainSync server mock.
ScheduledChainSyncServer | |
|
runScheduledChainSyncServer ∷ IOLike m ⇒ PeerId → STM m () → STM m (Maybe (NodeState blk)) → Tracer m (TraceEvent blk) → ChainSyncServerHandlers m (NodeState blk) blk → ChainSyncServer (Header blk) (Point blk) (Tip blk) m () Source #
Construct a ChainSync server for the peer simulator.
See scheduledChainSyncServer
.