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

Ouroboros.Consensus.Node.Serialisation

Description

Serialisation for sending things across the network.

We separate NodeToNode from NodeToClient to be very explicit about what gets sent where.

Unlike in Ouroboros.Consensus.Storage.Serialisation, we don't separate the encoder from the decoder, because the reasons don't apply: we always need both directions and we don't have access to the bytestrings that could be used for the annotations (we use CBOR-in-CBOR in those cases).

Synopsis

Documentation

class SerialiseNodeToClient blk a where Source #

Serialise a type a so that it can be sent across the network via node-to-client protocol.

Minimal complete definition

Nothing

Instances

Instances details
SerialiseNodeToClient blk (ApplyTxErr blk) ⇒ SerialiseNodeToClient blk (WrapApplyTxErr blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseNodeToClient blk (GenTxId blk) ⇒ SerialiseNodeToClient blk (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseNodeToClient blk blk ⇒ SerialiseNodeToClient blk (I blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) SlotNo Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (HardForkApplyTxErr xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (GenTx (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (GenTxId (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (Serialised (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) (SomeSecond BlockQuery (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient

class SerialiseNodeToNode blk a where Source #

Serialise a type a so that it can be sent across network via a node-to-node protocol.

Minimal complete definition

Nothing

Instances

Instances details
SerialiseNodeToNode blk (GenTxId blk) ⇒ SerialiseNodeToNode blk (WrapGenTxId blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseNodeToNode blk blk ⇒ SerialiseNodeToNode blk (I blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Node.Serialisation

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (Header (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (GenTx (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (GenTxId (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (SerialisedHeader (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (Serialised (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

class SerialiseResult blk query where Source #

How to serialise the result of the result of a query.

The LocalStateQuery protocol is a node-to-client protocol, hence the NodeToClientVersion argument.

Methods

encodeResult ∷ ∀ result. CodecConfig blk → BlockNodeToClientVersion blk → query result → result → Encoding Source #

decodeResult ∷ ∀ result. CodecConfig blk → BlockNodeToClientVersion blk → query result → ∀ s. Decoder s result Source #

Defaults

defaultEncodeCBORinCBORSerialise a ⇒ a → Encoding Source #

Uses the Serialise instance, but wraps it in CBOR-in-CBOR.

Use this for the SerialiseNodeToNode and/or SerialiseNodeToClient instance of blk and/or Header blk, which require CBOR-in-CBOR to be compatible with the corresponding Serialised instance.

Re-exported for convenience

data Some (f ∷ k → Type) where Source #

Constructors

Some ∷ ∀ {k} (f ∷ k → Type) (a ∷ k). f a → Some f