libp2p
    Preparing search index...

    Module @libp2p/gossipsub

    Gossipsub is an implementation of pubsub based on meshsub and floodsub.

    You can read the specification here.

    @libp2p/gossipsub currently implements version 1.1 of the spec.

    Formerly published as @chainsafe/libp2p-gossipsub.

    import { identify } from '@libp2p/identify'
    import { createLibp2p } from 'libp2p'
    import { gossipsub } from '@libp2p/gossipsub'

    const node = await createLibp2p({
    services: {
    identify: identify(),
    pubsub: gossipsub()
    }
    //... other options
    })
    await node.start()

    node.services.pubsub.addEventListener('message', (evt) => {
    console.log(`${evt.detail.topic}:`, new TextDecoder().decode(evt.detail.data))
    })

    node.services.pubsub.subscribe('fruit')

    node.services.pubsub.publish('fruit', new TextEncoder().encode('banana'))
    TopicValidatorResult
    GossipSub
    GossipSubComponents
    GossipSubEvents
    GossipsubMessage
    GossipsubOpts
    MeshPeer
    PublishResult
    SignedMessage
    Subscription
    SubscriptionChangeData
    TopicValidatorFn
    UnsignedMessage
    Message
    SignaturePolicy
    multicodec
    StrictNoSign
    StrictSign
    gossipsub