Invoked after an incoming connection is opened but before PeerIds are exchanged, this lets the ConnectionManager check we have sufficient resources to accept the connection in which case it will return true, otherwise it will return false.
The multiaddr connection to evaluate.
A promise that resolves to true
if the connection can be accepted, false
otherwise.
Close our connections to a peer
The PeerId
whose connections should be closed.
Optional
options: AbortOptionsOptional abort options.
A promise that resolves once the connections are closed.
Return connections, optionally filtering by a PeerId
Optional
peerId: PeerIdThe PeerId to filter connections (optional).
An array of active Connection
objects.
Return a map of all connections with their associated PeerIds
A PeerMap
containing Connection[]
objects.
Return the list of in-progress or queued dials
An array of PendingDial
objects.
Given the current node configuration, returns a promise of true
or
false
if the node would attempt to dial the passed multiaddr.
This means a relevant transport is configured, and the connection gater would not block the dial attempt.
This may involve resolving DNS addresses so you should pass an AbortSignal.
The target multiaddr or an array of multiaddrs.
Optional
options: IsDialableOptionsOptional parameters for dialability check.
A promise that resolves to true
if the multiaddr is dialable, false
otherwise.
Open a connection to a remote peer
The target PeerId
, Multiaddr
, or an array of Multiaddr
s.
Optional
options: OpenConnectionOptionsOptional parameters for connection handling.
A promise that resolves to a Connection
object.
The
ConnectionManager
handles managing connections between peers in a libp2p network. It provides methods for opening, closing, and querying connections.This also provides methods for accessing the dial queue.