ouroboros-network-framework-0.1.0.1
Safe Haskell None
Language Haskell2010

Ouroboros.Network.Protocol.Handshake.Codec

Synopsis

Documentation

codecHandshake :: forall vNumber m failure. ( MonadST m, Ord vNumber, Show failure) => CodecCBORTerm (failure, Maybe Int ) vNumber -> Codec ( Handshake vNumber Term ) DeserialiseFailure m ByteString Source #

Handshake codec. The MsgProposeVersions encodes proposed map in ascending order and it expects to receive them in this order. This allows to construct the map in linear time. There is also another limiting factor to the number of versions on can present: the whole message must fit into a single TCP segment.

Version data codec

data VersionDataCodec bytes vNumber vData Source #

Codec for version data ( vData in code) exchanged by the handshake protocol.

Note: extra type param is instantiated to DictVersion ; agreedOptions is instantiated to NodeToNodeVersionData in Ouroboros.Network.NodeToNode or to () in Ouroboros.Network.NodeToClient .

Constructors

VersionDataCodec

Fields

  • encodeData :: vNumber -> vData -> bytes

    encoder of vData which has access to 'extra vData' which can bring extra instances into the scope (by means of pattern matching on a GADT).

  • decodeData :: vNumber -> bytes -> Either Text vData

    decoder of vData .