| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- data IdentifyInfo = IdentifyInfo {
- idProtocolVersion :: !(Maybe Text)
- idAgentVersion :: !(Maybe Text)
- idPublicKey :: !(Maybe ByteString)
- idListenAddrs :: ![ByteString]
- idObservedAddr :: !(Maybe ByteString)
- idProtocols :: ![Text]
- idSignedPeerRecord :: !(Maybe ByteString)
- encodeIdentify :: IdentifyInfo -> ByteString
- decodeIdentify :: ByteString -> Either ParseError IdentifyInfo
- maxIdentifySize :: Int
Documentation
data IdentifyInfo Source #
Identify message payload.
Constructors
| IdentifyInfo | |
Fields
| |
Instances
| Show IdentifyInfo Source # | |
Defined in LibP2P.Protocol.Identify.Message Methods showsPrec :: Int -> IdentifyInfo -> ShowS # show :: IdentifyInfo -> String # showList :: [IdentifyInfo] -> ShowS # | |
| Eq IdentifyInfo Source # | |
Defined in LibP2P.Protocol.Identify.Message | |
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.