NetworkConfig constructor
- List<
String> listenAddresses = defaultListenAddresses, - List<
String> bootstrapPeers = defaultBootstrapPeers, - @Deprecated('No connection-limit enforcement exists; this option is ignored.') int maxConnections = 50,
- @Deprecated('Dial timeouts are not configurable; this option is ignored.') Duration connectionTimeout = const Duration(seconds: 30),
- bool enableNatTraversal = false,
- bool enableMDNS = true,
- bool enableWebTransport = true,
- bool enableWebRtc = true,
- bool enableQuic = false,
- int quicListenPort = 4002,
- @Deprecated('No QUIC transport exists; this option is ignored.') int quicMaxStreams = 100,
- @Deprecated('No QUIC transport exists; this option is ignored.') bool preferQuic = false,
- CircuitRelayConfig circuitRelay = const CircuitRelayConfig(),
- List<
String> stunServers = const [], - List<
TurnServer> turnServers = const [], - @Deprecated('Node identity is derived from the libp2p keypair; ' 'IPFSConfig.nodeId names the mDNS instance. This option is ignored.') String? nodeId,
- String? delegatedRoutingEndpoint,
- List<
String> ipniEndpoints = const <String>[], - List<
String> reframeEndpoints = const <String>[], - String? swarmKeyPath,
- Uint8List? privateNetworkPsk,
Creates a network configuration with the given options.
Implementation
NetworkConfig({
this.listenAddresses = defaultListenAddresses,
this.bootstrapPeers = defaultBootstrapPeers,
@Deprecated(
'No connection-limit enforcement exists; this option is ignored.',
)
this.maxConnections = 50,
@Deprecated('Dial timeouts are not configurable; this option is ignored.')
this.connectionTimeout = const Duration(seconds: 30),
this.enableNatTraversal = false,
this.enableMDNS = true,
this.enableWebTransport = true,
this.enableWebRtc = true,
this.enableQuic = false,
this.quicListenPort = 4002,
@Deprecated('No QUIC transport exists; this option is ignored.')
this.quicMaxStreams = 100,
@Deprecated('No QUIC transport exists; this option is ignored.')
this.preferQuic = false,
this.circuitRelay = const CircuitRelayConfig(),
this.stunServers = const [],
this.turnServers = const [],
@Deprecated(
'Node identity is derived from the libp2p keypair; '
'IPFSConfig.nodeId names the mDNS instance. This option is ignored.',
)
String? nodeId,
this.delegatedRoutingEndpoint,
this.ipniEndpoints = const <String>[],
this.reframeEndpoints = const <String>[],
this.swarmKeyPath,
this.privateNetworkPsk,
// ignore: deprecated_member_use_from_same_package
}) : nodeId = nodeId ?? _generateDefaultNodeId();