libp2p
    Preparing search index...

    Interface GossipsubOpts

    interface GossipsubOpts {
        allowedTopics?: Set<string> | string[];
        allowPublishToZeroTopicPeers: boolean;
        asyncValidation: boolean;
        awaitRpcHandler: boolean;
        awaitRpcMessageHandler: boolean;
        batchPublish: boolean;
        canRelayMessage?: boolean;
        D: number;
        dataTransform?: DataTransform;
        debugName?: string;
        decodeRpcLimits?: DecodeRPCLimits;
        Dhi: number;
        directConnectTicks?: number;
        directPeers: AddrInfo[];
        Dlazy: number;
        Dlo: number;
        doPX: boolean;
        Dout: number;
        Dscore: number;
        emitSelf?: boolean;
        fallbackToFloodsub: boolean;
        fanoutTTL: number;
        fastMsgIdFn: FastMsgIdFn;
        floodPublish: boolean;
        globalSignaturePolicy?: SignaturePolicy;
        gossipFactor: number;
        gossipsubIWantFollowupMs: number;
        graftFloodThreshold?: number;
        heartbeatInterval: number;
        idontwantMaxMessages?: number;
        idontwantMinDataSize?: number;
        ignoreDuplicatePublishError: boolean;
        maxInboundDataLength?: number;
        maxInboundStreams?: number;
        maxOutboundBufferSize?: number;
        maxOutboundStreams?: number;
        mcacheGossip: number;
        mcacheLength: number;
        messageCache: MessageCache;
        messageProcessingConcurrency?: number;
        metricsRegister?: null | MetricsRegister;
        metricsTopicStrToLabel?: TopicStrToLabel;
        msgIdFn: MsgIdFn;
        msgIdToStrFn: MsgIdToStrFn;
        opportunisticGraftPeers?: number;
        opportunisticGraftTicks?: number;
        protocols?: string[];
        pruneBackoff?: number;
        prunePeers?: number;
        runOnLimitedConnection?: boolean;
        scoreParams: Partial<PeerScoreParams>;
        scoreThresholds: Partial<PeerScoreThresholds>;
        seenTTL: number;
        tagMeshPeers: boolean;
        unsubcribeBackoff?: number;
    }

    Hierarchy

    Index

    Properties

    allowedTopics?: Set<string> | string[]

    If provided, only allow topics in this list

    allowPublishToZeroTopicPeers: boolean

    Do not throw PublishError.NoPeersSubscribedToTopic error if there are no peers listening on the topic.

    N.B. if you sent this option to true, and you publish a message on a topic with no peers listening on that topic, no other network node will ever receive the message.

    asyncValidation: boolean

    If true will not forward messages to mesh peers until reportMessageValidationResult() is called. Messages will be cached in mcache for some time after which they are evicted. Calling reportMessageValidationResult() after the message is dropped from mcache won't forward the message.

    awaitRpcHandler: boolean

    For a single stream, await processing each RPC before processing the next

    awaitRpcMessageHandler: boolean

    For a single RPC, await processing each message before processing the next

    batchPublish: boolean

    serialize message once and send to all peers without control messages

    canRelayMessage?: boolean

    if can relay messages not subscribed

    D: number

    D sets the optimal degree for a Gossipsub topic mesh.

    dataTransform?: DataTransform
    debugName?: string

    Prefix tag for debug logs

    decodeRpcLimits?: DecodeRPCLimits

    Limits to bound protobuf decoding

    Dhi: number

    Dhi sets the upper bound on the number of peers we keep in a Gossipsub topic mesh.

    directConnectTicks?: number
    directPeers: AddrInfo[]

    peers with which we will maintain direct connections

    Dlazy: number

    Dlazy affects the minimum number of peers we will emit gossip to at each heartbeat.

    Dlo: number

    Dlo sets the lower bound on the number of peers we keep in a Gossipsub topic mesh.

    doPX: boolean

    whether PX is enabled; this should be enabled in bootstrappers and other well connected/trusted nodes.

    Dout: number

    Dout sets the quota for the number of outbound connections to maintain in a topic mesh.

    Dscore: number

    Dscore affects how peers are selected when pruning a mesh due to over subscription.

    emitSelf?: boolean

    if publish should emit to self, if subscribed

    fallbackToFloodsub: boolean

    if dial should fallback to floodsub

    fanoutTTL: number

    fanoutTTL controls how long we keep track of the fanout state. If it's been fanoutTTL milliseconds since we've published to a topic that we're not subscribed to, we'll delete the fanout map for that topic.

    fastMsgIdFn: FastMsgIdFn

    fast message id function

    floodPublish: boolean

    if self-published messages should be sent to all peers

    globalSignaturePolicy?: SignaturePolicy

    defines how signatures should be handled

    gossipFactor: number

    Specify what percent of peers to send gossip to. If the percent results in a number smaller than Dlazy, Dlazy will be used instead.

    It should be a number between 0 and 1, with a reasonable default of 0.25

    gossipsubIWantFollowupMs: number

    customize GossipsubIWantFollowupTime in order not to apply IWANT penalties

    graftFloodThreshold?: number
    heartbeatInterval: number

    heartbeatInterval is the time between heartbeats in milliseconds

    idontwantMaxMessages?: number

    The maximum number of IDONTWANT messages per heartbeat per peer

    512
    
    idontwantMinDataSize?: number

    The minimum message size in bytes to be considered for sending IDONTWANT messages

    512
    
    ignoreDuplicatePublishError: boolean

    Do not throw PublishError.Duplicate if publishing duplicate messages

    maxInboundDataLength?: number

    Specify max size to skip decoding messages whose data section exceeds this size.

    maxInboundStreams?: number

    Specify the maximum number of inbound gossipsub protocol streams that are allowed to be open concurrently

    maxOutboundBufferSize?: number

    Specify max buffer size in bytes for OutboundStream. If full it will throw and reject sending any more data.

    maxOutboundStreams?: number

    Specify the maximum number of outbound gossipsub protocol streams that are allowed to be open concurrently

    mcacheGossip: number

    mcacheGossip is the number of windows to gossip about

    mcacheLength: number

    mcacheLength is the number of windows to retain full messages for IWANT responses

    messageCache: MessageCache

    override the default MessageCache

    messageProcessingConcurrency?: number

    handle this many incoming pubsub messages concurrently

    metricsRegister?: null | MetricsRegister
    metricsTopicStrToLabel?: TopicStrToLabel
    msgIdFn: MsgIdFn

    message id function

    msgIdToStrFn: MsgIdToStrFn

    Uint8Array message id to string function

    opportunisticGraftPeers?: number
    opportunisticGraftTicks?: number
    protocols?: string[]

    Override the protocol registered with the registrar

    ['/floodsub/1.0.0']
    
    pruneBackoff?: number
    prunePeers?: number

    override constants for fine tuning

    runOnLimitedConnection?: boolean

    Pass true to run on limited connections - data or time-limited connections that may be closed at any time such as circuit relay connections.

    false
    
    scoreParams: Partial<PeerScoreParams>

    peer score parameters

    scoreThresholds: Partial<PeerScoreThresholds>

    peer score thresholds

    seenTTL: number

    seenTTL is the number of milliseconds to retain message IDs in the seen cache

    tagMeshPeers: boolean

    If true, will utilize the libp2p connection manager tagging system to prune/graft connections to peers, defaults to true

    unsubcribeBackoff?: number