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

LibP2P.Protocol.GossipSub.Extensions

Description

GossipSub v1.3 extension advertisement and dispatch.

Synopsis

Documentation

attachExtensionsToHello :: GossipSubRouter -> PeerProtocol -> RPC -> IO RPC Source #

Add our supported extensions to the first outbound v1.3 RPC.

markExtensionAdvertisementSent :: GossipSubRouter -> PeerId -> IO () Source #

Record that our extension advertisement was successfully sent.

handleExtensionAdvertisement :: GossipSubRouter -> PeerId -> RPC -> IO () Source #

Record the first v1.3 extension advertisement and penalize repeats.

handlePartialMessageRPC :: GossipSubRouter -> PeerId -> RPC -> IO () Source #

Dispatch a partial-message RPC only when both peers advertised support.

peerSupportsPartialExtension :: GossipSubRouter -> PeerId -> IO Bool Source #

Whether a peer advertised the partial-messages extension on v1.3.

peerRequestsPartial :: GossipSubRouter -> PeerId -> Topic -> IO Bool Source #

Whether a peer requested partial messages for a topic.

peerSupportsSendingPartial :: GossipSubRouter -> PeerId -> Topic -> IO Bool Source #

Whether a peer can send partial messages for a topic.

localPartialMode :: GossipSubRouter -> Topic -> IO (Maybe PartialTopicMode) Source #

Local partial-message mode for a subscribed topic.

runPartialHeartbeat :: GossipSubRouter -> IO () Source #

Run partial-message state expiry during the GossipSub heartbeat.

emitPartialGossip :: GossipSubRouter -> Topic -> [PeerId] -> IO () Source #

Ask the partial-message runtime to gossip groups to selected peers.

notifyPartialPeerDisconnected :: GossipSubRouter -> PeerId -> IO () Source #

Remove per-peer partial-message state after disconnect.