CircuitV2Client class

CircuitV2Client implements the Circuit Relay v2 protocol as a Transport. It allows peers to establish connections through relay servers when direct connections are not possible (e.g., due to NATs or firewalls).

Implemented types
Available extensions

Constructors

CircuitV2Client({required Host host, required Upgrader upgrader, required ConnManager connManager, TransportConfig? config, RelayMetricsObserver? metricsObserver})

Properties

config TransportConfig
The configuration for this transport
final
connManager ConnManager
final
hashCode int
The hash code for this object.
no setterinherited
host Host
final
metricsObserver RelayMetricsObserver?
Metrics observer for reporting relay events
final
onRelayPathFailed RelayPathFailedCallback?
getter/setter pair
peerstore Peerstore
no setter
protocolId String
no setter
protocols List<String>
Returns the list of protocols supported by this transport For example: '/ip4/tcp', '/ip6/tcp'
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
upgrader Upgrader
final

Methods

canDial(MultiAddr addr) bool
Returns true if this transport can dial the given multiaddress
override
canListen(MultiAddr addr) bool
Returns true if this transport can listen on the given multiaddress
override
close() Future<void>
dial(MultiAddr addr, {Duration? timeout}) Future<TransportConn>
Dials a peer at the given multiaddress with optional timeout override Returns a connection to the peer if successful
override
dispose() Future<void>
override
listen(MultiAddr addr) Future<Listener>
Starts listening on the given multiaddress Returns a listener that can accept incoming connections
override
listenAddrs() List<MultiAddr>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reserve(PeerId relayPeerId) Future<Reservation>

Available on CircuitV2Client, provided by the ReservationExtension extension

Reserves a slot on a relay.
start() Future<void>
stop() Future<void>
toString() String
A string representation of this object.
inherited
transportForDial(MultiAddr addr) → dynamic
transportForListen(MultiAddr addr) → dynamic

Operators

operator ==(Object other) bool
The equality operator.
inherited