NetworkConfig constructor

NetworkConfig({
  1. List<String> listenAddresses = defaultListenAddresses,
  2. List<String> bootstrapPeers = defaultBootstrapPeers,
  3. @Deprecated('No connection-limit enforcement exists; this option is ignored.') int maxConnections = 50,
  4. @Deprecated('Dial timeouts are not configurable; this option is ignored.') Duration connectionTimeout = const Duration(seconds: 30),
  5. bool enableNatTraversal = false,
  6. bool enableMDNS = true,
  7. bool enableWebTransport = true,
  8. bool enableWebRtc = true,
  9. bool enableQuic = false,
  10. int quicListenPort = 4002,
  11. @Deprecated('No QUIC transport exists; this option is ignored.') int quicMaxStreams = 100,
  12. @Deprecated('No QUIC transport exists; this option is ignored.') bool preferQuic = false,
  13. CircuitRelayConfig circuitRelay = const CircuitRelayConfig(),
  14. List<String> stunServers = const [],
  15. List<TurnServer> turnServers = const [],
  16. @Deprecated('Node identity is derived from the libp2p keypair; ' 'IPFSConfig.nodeId names the mDNS instance. This option is ignored.') String? nodeId,
  17. String? delegatedRoutingEndpoint,
  18. List<String> ipniEndpoints = const <String>[],
  19. List<String> reframeEndpoints = const <String>[],
  20. String? swarmKeyPath,
  21. 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();