libp2p/protocols/pubsub/floodsub

    Dark Mode
Search:
Group by:
  Source   Edit

Simple flood-based publishing.

Types

FloodSub {.public.} = ref object of PubSub
  floodsub*: PeerTable
  seen*: TimedCache[MessageId]
  seenSalt*: seq[byte]
  Source   Edit

Consts

FloodSubCodec = "/floodsub/1.0.0"
  Source   Edit

Procs

proc addSeen(f: FloodSub; msgId: MessageId): bool {....raises: [], tags: [].}
  Source   Edit
proc firstSeen(f: FloodSub; msgId: MessageId): Moment {....raises: [], tags: [].}
  Source   Edit
proc handleSubscribe(f: FloodSub; peer: PubSubPeer; topic: string;
                     subscribe: bool) {....raises: [], tags: [RootEffect,
    WriteIOEffect, TimeEffect].}
  Source   Edit
proc hasSeen(f: FloodSub; msgId: MessageId): bool {....raises: [], tags: [].}
  Source   Edit

Methods

method init(f: FloodSub) {....raises: [], tags: [RootEffect].}
  Source   Edit
method initPubSub(f: FloodSub) {....raises: [InitializationError], raises: [],
                                 tags: [RootEffect].}
  Source   Edit
method publish(f: FloodSub; topic: string; data: seq[byte]): Future[int] {.
    stackTrace: false, ...raises: [], gcsafe, raises: [], raises: [],
    tags: [RootEffect].}
  Source   Edit
method rpcHandler(f: FloodSub; peer: PubSubPeer; data: seq[byte]): Future[void] {.
    stackTrace: false, ...raises: [], gcsafe, raises: [], raises: [],
    tags: [RootEffect].}
  Source   Edit
method unsubscribePeer(f: FloodSub; peer: PeerId) {....raises: [],
    tags: [WriteIOEffect, TimeEffect].}
handle peer disconnects   Source   Edit