Config class

Config describes a set of settings for a libp2p node

This is not a stable interface. Use the options defined in the root package.

Available extensions

Constructors

Config()

Properties

addrsFactory ↔ AddrsFactory?
getter/setter pair
ambientAutoNATConfig ↔ AmbientAutoNATv2Config?
getter/setter pair
autoNATv2Options ↔ List<AutoNATv2Option>
getter/setter pair
connManager ↔ ConnManager?
getter/setter pair
disableObservedAddrManager ↔ bool?
getter/setter pair
disableSignedPeerRecord ↔ bool?
getter/setter pair
enableAutoNAT ↔ bool
getter/setter pair
enableAutoRelay ↔ bool
getter/setter pair
enableHolePunching ↔ bool
getter/setter pair
enablePing ↔ bool
getter/setter pair
enableRelay ↔ bool
getter/setter pair
eventBus ↔ EventBus?
getter/setter pair
forceReachability ↔ Reachability?
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
identifyProtocolVersion ↔ String?
getter/setter pair
identifyUserAgent ↔ String?
getter/setter pair
insecure ↔ bool
Whether to use insecure connections (no security)
getter/setter pair
listenAddrs ↔ List<MultiAddr>
List of addresses to listen on
getter/setter pair
muxers ↔ List<StreamMuxer>
List of stream multiplexers to use
getter/setter pair
natManagerFactory ↔ NATManager Function(Network)?
getter/setter pair
negotiationTimeout ↔ Duration?
getter/setter pair
peerKey ↔ KeyPair?
The private key for this node
getter/setter pair
protocolVersion ↔ String?
The protocol version that identifies the family of protocols used by the peer in the Identify protocol.
getter/setter pair
relayMetricsObserver ↔ RelayMetricsObserver?
getter/setter pair
relayServers ↔ List<String>
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
securityProtocols ↔ List<SecurityProtocol>
List of security protocols to use
getter/setter pair
transports ↔ List<Transport>
List of transports to use
getter/setter pair
userAgent ↔ String?
The identifier this node will send to other peers when identifying itself, e.g. via the identify protocol.
getter/setter pair

Methods

apply(List<Option> opts) → Future<void>
Apply applies the given options to the config, returning the first error encountered (if any).
newNode() → Future<Host>
Creates a new libp2p Host from the Config.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
withAddrsFactory(AddrsFactory factory) → Future<void>

Available on Config, provided by the ConfigOptions extension

withAmbientAutoNAT(AmbientAutoNATv2Config conf) → Future<void>

Available on Config, provided by the ConfigOptions extension

withAutoNAT(bool enabled) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to enable/disable the AutoNAT service.
withAutoNATv2AllowPrivateAddrs() → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures AutoNATv2 to allow private addresses (for testing)
withAutoNATv2AmplificationAttackPreventionDialWait(Duration duration) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures AutoNATv2 amplification attack prevention dial wait time
withAutoNATv2DataRequestPolicy(DataRequestPolicyFunc policy) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures AutoNATv2 with a custom data request policy
withAutoNATv2MetricsTracer(MetricsTracer metricsTracer) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures AutoNATv2 with a metrics tracer
withAutoNATv2Options(List<AutoNATv2Option> options) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures AutoNATv2 with specific options
withAutoNATv2ServerRateLimit(int rpm, int perPeerRPM, int dialDataRPM) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures AutoNATv2 server rate limits
withAutoRelay(bool enabled) → Future<void>

Available on Config, provided by the ConfigOptions extension

withConnManager(ConnManager manager) → Future<void>

Available on Config, provided by the ConfigOptions extension

withEventBus(EventBus bus) → Future<void>

Available on Config, provided by the ConfigOptions extension

withHolePunching(bool enabled) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to enable/disable the Hole Punching service.
withIdentifyDisableObservedAddrManager(bool disable) → Future<void>

Available on Config, provided by the ConfigOptions extension

withIdentifyDisableSignedPeerRecord(bool disable) → Future<void>

Available on Config, provided by the ConfigOptions extension

withIdentifyProtocolVersion(String version) → Future<void>

Available on Config, provided by the ConfigOptions extension

withIdentifyUserAgent(String agent) → Future<void>

Available on Config, provided by the ConfigOptions extension

withIdentity(KeyPair keyPair) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to use the given identity (private key).
withListenAddrs(List<MultiAddr> addrs) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to use the given addresses.
withMuxer(String id, Multiplexer muxerFactory(Conn secureConn, bool isClient)) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to use the given stream multiplexer.
withNatManager(NATManager factory(Network)) → Future<void>

Available on Config, provided by the ConfigOptions extension

withNegotiationTimeout(Duration timeout) → Future<void>

Available on Config, provided by the ConfigOptions extension

withNoSecurity() → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to use no security (insecure connections).
withPing(bool enabled) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to enable/disable the Ping service.
withProtocolVersion(String version) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to use the given protocol version.
withReachability(Reachability r) → Future<void>

Available on Config, provided by the ConfigOptions extension

withRelay(bool enabled) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to enable/disable the Relay service.
withRelayServers(List<String> servers) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures relay servers to automatically connect to during startup
withSecurity(SecurityProtocol securityProtocol) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to use the given security protocol.
withTransport(Transport transport) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to use the given transport.
withUserAgent(String agent) → Future<void>

Available on Config, provided by the ConfigOptions extension

Configures libp2p to use the given user agent.

Operators

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