DHTConfig class

Configuration options for the DHT (Distributed Hash Table)

This class holds settings for Kademlia DHT operations, such as lookup parallelization, bucket sizes, and request timeouts.

Constructors

DHTConfig({String protocolId = '/ipfs/kad/1.0.0', int alpha = 3, int bucketSize = 20, int maxProvidersPerKey = 20, Duration requestTimeout = const Duration(seconds: 30), int maxRecordsPerQuery = 20, bool enableProviderRecording = true, bool enableValueStorage = true})
Creates a new DHTConfig with default Kademlia settings.
const
DHTConfig.fromJson(Map<String, dynamic> json)
Creates a DHTConfig from JSON.
factory

Properties

alpha int
Number of parallel lookups (alpha value in Kademlia).
final
bucketSize int
Size of k-buckets.
final
enableProviderRecording bool
Whether to enable provider recording.
final
enableValueStorage bool
Whether to enable value storage.
final
hashCode int
The hash code for this object.
no setterinherited
maxProvidersPerKey int
Maximum number of providers to store per key.
final
maxRecordsPerQuery int
Maximum number of records to return per query.
final
protocolId String
Protocol identifier for DHT.
final
requestTimeout Duration
Time to wait before considering a request as failed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the config to JSON.
toString() String
A string representation of this object.
inherited

Operators

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