IPFSConfig constructor

IPFSConfig({
  1. bool offline = false,
  2. NetworkConfig? network,
  3. DHTConfig? dht,
  4. @Deprecated('StorageConfig is never read; use the top-level path fields.') StorageConfig? storage,
  5. SecurityConfig? security,
  6. GatewayConfig? gateway,
  7. BitswapConfig? bitswap,
  8. GraphsyncConfig? graphsync,
  9. bool debug = true,
  10. bool verboseLogging = true,
  11. bool enablePubSub = true,
  12. bool enableDHT = true,
  13. bool enableRPC = false,
  14. String? rpcApiKey,
  15. @Deprecated('Use NetworkConfig.circuitRelay.enabled; this option is ignored.') bool enableCircuitRelay = true,
  16. bool enableContentRouting = true,
  17. bool enableDNSLinkResolution = true,
  18. @Deprecated('IPLD is a core dependency and cannot be disabled; this flag is ignored.') bool enableIPLD = true,
  19. bool enableGraphsync = true,
  20. bool enableMetrics = true,
  21. bool enableIpnsPubSub = false,
  22. @Deprecated('Logging is always enabled; use logLevel to control verbosity.') bool enableLogging = true,
  23. @Deprecated('Structured logging is not wired into the node runtime; ' 'this option is ignored.') bool enableStructuredLogging = false,
  24. int ipnsCacheSize = 1000,
  25. String logLevel = 'info',
  26. @Deprecated('No bandwidth quota subsystem exists; this flag is ignored.') bool enableQuotaManagement = true,
  27. @Deprecated('No bandwidth quota subsystem exists; this flag is ignored.') int defaultBandwidthQuota = 1048576,
  28. int maxConcurrentBitswapRequests = 10,
  29. String datastorePath = './ipfs_data/datastore',
  30. String keystorePath = './ipfs_keystore',
  31. String blockStorePath = 'blocks',
  32. @Deprecated('No libp2p bridge transport exists; this flag is ignored.') bool enableLibp2pBridge = false,
  33. String libp2pListenAddress = '/ip4/0.0.0.0/tcp/4001',
  34. Uint8List? libp2pIdentitySeed,
  35. String? nodeId,
  36. @Deprecated('No repository garbage-collection loop exists; this flag is ignored.') Duration garbageCollectionInterval = const Duration(hours: 24),
  37. @Deprecated('No repository garbage-collection loop exists; this flag is ignored.') bool garbageCollectionEnabled = true,
  38. MetricsConfig metrics = const MetricsConfig(),
  39. String dataPath = './ipfs_data',
  40. Keystore? keystore,
  41. @Deprecated('Use GraphsyncConfig.defaultMaxDepth; this flag is ignored.') int maxSelectorDepth = 32,
  42. @Deprecated('Use GraphsyncConfig.defaultMaxBlocks; this flag is ignored.') int maxSelectorNodes = 10000,
  43. @Deprecated('Custom config entries are never read; this option is ignored.') Map<String, dynamic> customConfig = const {},
  44. String? swarmKeyPath,
  45. Uint8List? privateNetworkPsk,
})

Creates a new IPFSConfig with the specified options.

Implementation

IPFSConfig({
  this.offline = false,
  NetworkConfig? network,
  DHTConfig? dht,
  @Deprecated('StorageConfig is never read; use the top-level path fields.')
  // ignore: deprecated_member_use_from_same_package
  StorageConfig? storage,
  SecurityConfig? security,
  GatewayConfig? gateway,
  BitswapConfig? bitswap,
  GraphsyncConfig? graphsync,
  this.debug = true,
  this.verboseLogging = true,
  this.enablePubSub = true,
  this.enableDHT = true,
  this.enableRPC = false,
  this.rpcApiKey,
  @Deprecated(
    'Use NetworkConfig.circuitRelay.enabled; this option is ignored.',
  )
  this.enableCircuitRelay = true,
  this.enableContentRouting = true,
  this.enableDNSLinkResolution = true,
  @Deprecated(
    'IPLD is a core dependency and cannot be disabled; this flag is ignored.',
  )
  this.enableIPLD = true,
  this.enableGraphsync = true,
  this.enableMetrics = true,
  this.enableIpnsPubSub = false,
  @Deprecated('Logging is always enabled; use logLevel to control verbosity.')
  this.enableLogging = true,
  @Deprecated(
    'Structured logging is not wired into the node runtime; '
    'this option is ignored.',
  )
  this.enableStructuredLogging = false,
  this.ipnsCacheSize = 1000,
  this.logLevel = 'info',
  @Deprecated('No bandwidth quota subsystem exists; this flag is ignored.')
  this.enableQuotaManagement = true,
  @Deprecated('No bandwidth quota subsystem exists; this flag is ignored.')
  this.defaultBandwidthQuota = 1048576,
  this.maxConcurrentBitswapRequests = 10,
  this.datastorePath = './ipfs_data/datastore',
  this.keystorePath = './ipfs_keystore',
  this.blockStorePath = 'blocks',
  @Deprecated('No libp2p bridge transport exists; this flag is ignored.')
  this.enableLibp2pBridge = false,
  this.libp2pListenAddress = '/ip4/0.0.0.0/tcp/4001',
  this.libp2pIdentitySeed,
  String? nodeId,
  @Deprecated(
    'No repository garbage-collection loop exists; this flag is ignored.',
  )
  this.garbageCollectionInterval = const Duration(hours: 24),
  @Deprecated(
    'No repository garbage-collection loop exists; this flag is ignored.',
  )
  this.garbageCollectionEnabled = true,
  this.metrics = const MetricsConfig(),
  this.dataPath = './ipfs_data',
  Keystore? keystore,
  @Deprecated('Use GraphsyncConfig.defaultMaxDepth; this flag is ignored.')
  this.maxSelectorDepth = 32,
  @Deprecated('Use GraphsyncConfig.defaultMaxBlocks; this flag is ignored.')
  this.maxSelectorNodes = 10000,
  @Deprecated('Custom config entries are never read; this option is ignored.')
  this.customConfig = const {},
  this.swarmKeyPath,
  this.privateNetworkPsk,
}) : network = network ?? NetworkConfig(),
     dht = dht ?? const DHTConfig(),
     // ignore: deprecated_member_use_from_same_package
     storage = storage ?? const StorageConfig(),
     security = security ?? const SecurityConfig(),
     gateway = gateway ?? const GatewayConfig(),
     bitswap = bitswap ?? const BitswapConfig(),
     graphsync = graphsync ?? const GraphsyncConfig(),
     nodeId = nodeId ?? _generateDefaultNodeId(),
     keystore = keystore ?? Keystore() {
  // Sync top-level PNET fields into the nested network config so the
  // router only has to inspect [network].
  this.network.swarmKeyPath ??= swarmKeyPath;
  this.network.privateNetworkPsk ??= privateNetworkPsk;
}