Interface BitswapBlockBrokerInit

interface BitswapBlockBrokerInit {
    hashLoader?: MultihashHasherLoader;
    incomingStreamTimeout?: number;
    maxInboundStreams?: number;
    maxIncomingMessageSize?: number;
    maxOutboundStreams?: number;
    maxOutgoingMessageSize?: number;
    maxSizeReplaceHasWithBlock?: number;
    messageSendConcurrency?: number;
    protocol?: string;
    runOnLimitedConnections?: boolean;
    sendBlocksConcurrency?: number;
    sendBlocksDebounce?: number;
    sendBlocksTimeout?: number;
}

Hierarchy (view full)

Properties

Enables loading esoteric hash functions

incomingStreamTimeout?: number

An incoming stream must resolve within this number of seconds

Default

30000
maxInboundStreams?: number

This is the maximum number of concurrent inbound bitswap streams that are allowed

Default

32
maxIncomingMessageSize?: number

The maximum size in bytes of an incoming message that we will process.

Messages larger than this will cause the incoming stream to be reset.

Defaults to maxOutgoingMessageSize

Default

2097152
maxOutboundStreams?: number

This is the maximum number of concurrent outbound bitswap streams that are allowed

Default

128
maxOutgoingMessageSize?: number

The maximum size in bytes of a message that we will send. If a message is larger than this (due to lots of blocks or wantlist entries) it will be broken up into several smaller messages that are under this size.

maxSizeReplaceHasWithBlock?: number

If the client sends a want-have, and we have the corresponding block, we check the size of the block and if it's small enough we send the block itself, rather than sending a HAVE.

This defines the maximum size up to which we replace a HAVE with a block.

Default

1024
messageSendConcurrency?: number

When sending want list updates to peers, how many messages to send at once

Default

50
protocol?: string

The protocol that we speak

Default

'/ipfs/bitswap/1.2.0'
runOnLimitedConnections?: boolean

Whether to run on transient (e.g. time/data limited) connections

Default

false
sendBlocksConcurrency?: number

When sending blocks to peers, how many messages to send at once

Default

50
sendBlocksDebounce?: number

When a block is added to the blockstore and we are about to send that block to peers who have it in their wantlist, wait this many milliseconds before queueing the send job in case more blocks are added that they want

Default

10
sendBlocksTimeout?: number

When sending blocks to peers, timeout after this many milliseconds. This is useful for preventing slow/large peer-connections from consuming your bandwidth/streams.

Default

10000