Constructors

  • Parameters

    • multicodec: string
    • getConnections: ((peerId?) => Connection[])
        • (peerId?): Connection[]
        • Return a list of all connections this node has open, optionally filtering by a PeerId

          Parameters

          • Optional peerId: PeerId

          Returns Connection[]

          Example

          for (const connection of libp2p.getConnections()) {
          console.log(peerId, connection.remoteAddr.toString())
          // Logs the PeerId string and the observed remote multiaddr of each Connection
          }
    • addEventListener: (<K>(type, listener, options?) => void)
        • <K>(type, listener, options?): void
        • Type Parameters

          Parameters

          • type: K
          • listener: null | EventHandler<Libp2pEvents<Libp2pServices>[K]>
          • Optional options: boolean | AddEventListenerOptions

          Returns void

    Returns waku.StreamManager

Properties

addEventListener: any
createStream: any
createStreamWithLock: any
getConnections: any
getOpenStreamForCodec: any
handlePeerUpdateStreamPool: any
isStreamLocked: any
lockStream: any
log: any
multicodec: any
ongoingCreation: any
scheduleNewStream: any
streamPool: any

Methods

  • Parameters

    • peer: Peer

    Returns Promise<Stream>