libp2p-hs-0.1.0.0: Haskell implementation of the libp2p networking stack
Safe HaskellNone
LanguageGHC2021

LibP2P.Protocol.Identify.Message

Description

Identify protocol message encoding/decoding (protobuf).

Wire format from specsidentifyREADME.md (field 8 from go-libp2p p2pprotocolidentifypbidentify.proto — the vendored spec copy of identify is r1 and predates it): Field 1: publicKey (bytes, optional) Field 2: listenAddrs (repeated bytes) Field 3: protocols (repeated string) Field 4: observedAddr (bytes, optional) Field 5: protocolVersion (string, optional) Field 6: agentVersion (string, optional) Field 8: signedPeerRecord (bytes, optional; RFC 0003 peer-record envelope)

Uses proto3-wire for protobuf encoding/decoding. On the wire the message is varint-length-delimited; the framing lives in LibP2P.Protocol.Identify (encodeFramedIdentify / readFramedIdentify).

Synopsis

Documentation

data IdentifyInfo Source #

Identify message payload.

Constructors

IdentifyInfo 

Fields

encodeIdentify :: IdentifyInfo -> ByteString Source #

Encode an Identify message to protobuf wire format.

decodeIdentify :: ByteString -> Either ParseError IdentifyInfo Source #

Decode an Identify message from protobuf wire format.

maxIdentifySize :: Int Source #

Maximum Identify message size: 64 KiB.