| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Network.LibP2P.Protocol.Identify.Message
Description
Identify protocol message encoding/decoding (protobuf).
Wire format from docs07-protocols.md and specsidentify/README.md: 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)
Uses proto3-wire for protobuf encoding/decoding. No length prefix; the message boundary is determined by stream closure.
Synopsis
- data IdentifyInfo = IdentifyInfo {
- idProtocolVersion :: !(Maybe Text)
- idAgentVersion :: !(Maybe Text)
- idPublicKey :: !(Maybe ByteString)
- idListenAddrs :: ![ByteString]
- idObservedAddr :: !(Maybe ByteString)
- idProtocols :: ![Text]
- 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 Network.LibP2P.Protocol.Identify.Message Methods showsPrec :: Int -> IdentifyInfo -> ShowS # show :: IdentifyInfo -> String # showList :: [IdentifyInfo] -> ShowS # | |
| Eq IdentifyInfo Source # | |
Defined in Network.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.