DHTConfig constructor

const DHTConfig({
  1. @Deprecated('The Kademlia protocol ID is hardcoded in the DHT client; ' 'this option is ignored.') String protocolId = '/ipfs/kad/1.0.0',
  2. int alpha = 3,
  3. int bucketSize = 20,
  4. @Deprecated('Provider record counts are not limited by config; ' 'this option is ignored.') int maxProvidersPerKey = 20,
  5. Duration requestTimeout = const Duration(seconds: 30),
  6. @Deprecated('Query result counts are not limited by config; ' 'this option is ignored.') int maxRecordsPerQuery = 20,
  7. @Deprecated('Provider records are always stored; this option is ignored.') bool enableProviderRecording = true,
  8. @Deprecated('Value storage is always enabled; this option is ignored.') bool enableValueStorage = true,
  9. bool validateProviderRecords = true,
  10. bool reproviderEnabled = true,
  11. Duration reproviderInterval = const Duration(hours: 12),
  12. String reproviderStrategy = 'pinned',
  13. int reproviderBatchSize = 100,
  14. int reproviderConcurrency = 10,
  15. bool reproviderSweepOptimization = true,
})

Creates a new DHTConfig with default Kademlia settings.

Implementation

const DHTConfig({
  @Deprecated(
    'The Kademlia protocol ID is hardcoded in the DHT client; '
    'this option is ignored.',
  )
  this.protocolId = '/ipfs/kad/1.0.0',
  this.alpha = 3,
  this.bucketSize = 20,
  @Deprecated(
    'Provider record counts are not limited by config; '
    'this option is ignored.',
  )
  this.maxProvidersPerKey = 20,
  this.requestTimeout = const Duration(seconds: 30),
  @Deprecated(
    'Query result counts are not limited by config; '
    'this option is ignored.',
  )
  this.maxRecordsPerQuery = 20,
  @Deprecated('Provider records are always stored; this option is ignored.')
  this.enableProviderRecording = true,
  @Deprecated('Value storage is always enabled; this option is ignored.')
  this.enableValueStorage = true,
  this.validateProviderRecords = true,
  this.reproviderEnabled = true,
  this.reproviderInterval = const Duration(hours: 12),
  this.reproviderStrategy = 'pinned',
  this.reproviderBatchSize = 100,
  this.reproviderConcurrency = 10,
  this.reproviderSweepOptimization = true,
});