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[SaltedId]
  seenSalt*: sha256
  Source   Edit

Consts

FloodSubCodec = "/floodsub/1.0.0"
  Source   Edit

Procs

proc addSeen(f: FloodSub; saltedId: SaltedId): bool {....raises: [], tags: [].}
  Source   Edit
proc firstSeen(f: FloodSub; saltedId: SaltedId): 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; saltedId: SaltedId): bool {....raises: [], tags: [].}
  Source   Edit
proc salt(f: FloodSub; msgId: MessageId): SaltedId {....raises: [], tags: [].}
  Source   Edit

Methods

method init(f: FloodSub) {....raises: [], tags: [].}
  Source   Edit
method initPubSub(f: FloodSub) {....raises: [InitializationError], raises: [],
                                 tags: [].}
  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