Interface ConnectionManagerConfig

Hierarchy

  • ConnectionManagerConfig

Properties

addressSorter?: AddressSorter

Sort the known addresses of a peer before trying to dial

allow?: string[]

A list of multiaddrs that will always be allowed (except if they are in the deny list) to open connections to this node even if we've reached maxConnections

autoDial?: boolean

If true, try to connect to all discovered peers up to the connection manager limit

autoDialInterval: number

How long to wait between attempting to keep our number of concurrent connections above minConnections

deny?: string[]

A list of multiaddrs that will never be allowed to open connections to this node under any circumstances

dialTimeout?: number

How long a dial attempt is allowed to take, including DNS resolution of the multiaddr, opening a socket and upgrading it to a Connection.

inboundConnectionThreshold?: number

If more than this many connections are opened per second by a single host, reject subsequent connections

inboundUpgradeTimeout: number

When a new inbound connection is opened, the upgrade process (e.g. protect, encrypt, multiplex etc) must complete within this number of ms.

maxAddrsToDial?: number

Number of max addresses to dial for a given peer

maxConnections: number

The maximum number of connections libp2p is willing to have before it starts disconnecting. Defaults to Infinity

maxDialsPerPeer?: number

Number of max concurrent dials per peer

maxEventLoopDelay?: number

Sets the maximum event loop delay (measured in milliseconds) this node is willing to endure before it starts disconnecting peers. Defaults to Infinity.

maxIncomingPendingConnections?: number

The maximum number of parallel incoming connections allowed that have yet to complete the connection upgrade - e.g. choosing connection encryption, muxer, etc

maxParallelDials?: number

Number of max concurrent dials

minConnections: number

The minimum number of connections below which libp2p not activate preemptive disconnections. Defaults to 0.

pollInterval?: number

Sets the poll interval (in milliseconds) for assessing the current state and determining if this peer needs to force a disconnect. Defaults to 2000 (2 seconds).

resolvers?: Record<string, Resolver>

Multiaddr resolvers to use when dialing

startupReconnectTimeout?: number

On startup we try to dial any peer that has previously been tagged with KEEP_ALIVE up to this timeout in ms. (default: 60000)