ouroboros-consensus-0.21.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.MiniProtocol.ChainSync.Server

Synopsis

Documentation

data Tip (b ∷ k) Source #

Used in chain-sync protocol to advertise the tip of the server's chain.

Instances

Instances details
ShowProxy b ⇒ ShowProxy (Tip b ∷ Type) 
Instance details

Defined in Ouroboros.Network.Block

Methods

showProxyProxy (Tip b) → String Source #

Generic (Tip b) 
Instance details

Defined in Ouroboros.Network.Block

Associated Types

type Rep (Tip b) ∷ TypeType #

Methods

fromTip b → Rep (Tip b) x #

toRep (Tip b) x → Tip b #

StandardHash b ⇒ Show (Tip b) 
Instance details

Defined in Ouroboros.Network.Block

Methods

showsPrecIntTip b → ShowS #

showTip b → String #

showList ∷ [Tip b] → ShowS #

StandardHash b ⇒ Eq (Tip b) 
Instance details

Defined in Ouroboros.Network.Block

Methods

(==)Tip b → Tip b → Bool #

(/=)Tip b → Tip b → Bool #

StandardHash b ⇒ NoThunks (Tip b) 
Instance details

Defined in Ouroboros.Network.Block

Condense (HeaderHash b) ⇒ Condense (Tip b) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.Condense

Methods

condenseTip b → String Source #

type Rep (Tip b) 
Instance details

Defined in Ouroboros.Network.Block

type Rep (Tip b) = D1 ('MetaData "Tip" "Ouroboros.Network.Block" "ouroboros-network-api-0.11.0.0-51203573fcfcfd3b2c06491320742b9da13f8f293bfcf4fc69f087b3c7b975f1" 'False) (C1 ('MetaCons "TipGenesis" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "Tip" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SlotNo) :*: (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HeaderHash b)) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 BlockNo))))

chainSyncBlocksServer ∷ ∀ m blk. (IOLike m, HasHeader (Header blk)) ⇒ Tracer m (TraceChainSyncServerEvent blk) → ChainDB m blk → Follower m blk (WithPoint blk (Serialised blk)) → ChainSyncServer (Serialised blk) (Point blk) (Tip blk) m () Source #

Chain Sync Server for blocks for a given a ChainDB.

The local node-to-client protocol uses the chain sync mini-protocol with chains of full blocks (rather than a header / body split).

chainSyncHeadersServer ∷ ∀ m blk. (IOLike m, HasHeader (Header blk)) ⇒ Tracer m (TraceChainSyncServerEvent blk) → ChainDB m blk → Follower m blk (WithPoint blk (SerialisedHeader blk)) → ChainSyncServer (SerialisedHeader blk) (Point blk) (Tip blk) m () Source #

Chain Sync Server for block headers for a given a ChainDB.

The node-to-node protocol uses the chain sync mini-protocol with chain headers (and fetches blocks separately with the block fetch mini-protocol).

Trace events

data BlockingType Source #

Whether reading a ChainSync server update instruction was blocking or non-blocking.

Constructors

Blocking 
NonBlocking 

data TraceChainSyncServerEvent blk Source #

Events traced by the Chain Sync Server.

Constructors

TraceChainSyncServerUpdate

Send a ChainUpdate message.

Fields

Low-level API

chainSyncServerForFollower ∷ ∀ m blk b. IOLike m ⇒ Tracer m (TraceChainSyncServerEvent blk) → STM m (Tip blk) → Follower m blk (WithPoint blk b) → ChainSyncServer b (Point blk) (Tip blk) m () Source #

A chain sync server.

This is a version of chainSyncServerExample that uses an action to get the current Tip and a Follower instead of ChainProducerState.

All the hard work is done by the Followers provided by the ChainDB.