ouroboros-network-0.1.0.1: A networking layer for the Ouroboros blockchain protocol
Safe Haskell None
Language Haskell2010

Ouroboros.Network.Protocol.ChainSync.Codec

Synopsis

Documentation

codecChainSync :: forall header point tip m. MonadST m => (header -> Encoding ) -> ( forall s. Decoder s header) -> (point -> Encoding ) -> ( forall s. Decoder s point) -> (tip -> Encoding ) -> ( forall s. Decoder s tip) -> Codec ( ChainSync header point tip) DeserialiseFailure m ByteString Source #

Codec for chain sync that encodes/decodes headers

NOTE: See wrapCBORinCBOR and unwrapCBORinCBOR if you want to use this with a header type that has annotations.

codecChainSyncId :: forall header point tip m. Monad m => Codec ( ChainSync header point tip) CodecFailure m ( AnyMessage ( ChainSync header point tip)) Source #

An identity Codec for the ChainSync protocol. It does not do any serialisation. It keeps the typed messages, wrapped in AnyMessage .

byteLimitsChainSync :: forall bytes header point tip. (bytes -> Word ) -> ProtocolSizeLimits ( ChainSync header point tip) bytes Source #

Byte Limits

timeLimitsChainSync :: forall header point tip. ChainSyncTimeout -> ProtocolTimeLimits ( ChainSync header point tip) Source #

Time Limits

'TokIdle'               'waitForever' (ie never times out)
'TokNext TokCanAwait'   the given 'canAwaitTimeout'
'TokNext TokMustReply'  the given 'mustReplyTimeout'
'TokIntersect'          the given 'intersectTimeout'

data ChainSyncTimeout Source #

Configurable timeouts

These are configurable for at least the following reasons.

o So that deployment and testing can use different values.

o So that a net running Praos can better cope with streaks of empty slots. (See input-output-hk/ouroboros-network#2245 .)