Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultPrefix protocol.ID = "/ipfs"
DefaultPrefix is the application specific prefix attached to all DHT protocols by default.
Variables ¶
View Source
var Defaults = func(o *Config) error { o.Validator = record.NamespacedValidator{} o.Datastore = dssync.MutexWrap(ds.NewMapDatastore()) o.ProtocolPrefix = DefaultPrefix o.EnableProviders = true o.EnableValues = true o.QueryPeerFilter = EmptyQueryFilter o.RoutingTable.LatencyTolerance = time.Minute o.RoutingTable.RefreshQueryTimeout = 1 * time.Minute o.RoutingTable.RefreshInterval = 10 * time.Minute o.RoutingTable.AutoRefresh = true o.RoutingTable.PeerFilter = EmptyRTFilter o.MaxRecordAge = time.Hour * 36 o.RoutingTable.ConsiderLatency = false o.RoutingTable.AvgBitsImprovedPerStep = 0 o.RoutingTable.AvgRoundTripsPerStepWithNewPeer = 0 o.BucketSize = defaultBucketSize o.ProtectedBuckets = defaultProtectedBuckets o.Concurrency = 10 o.Resiliency = 3 return nil }
Defaults are the default DHT options. This option will be automatically prepended to any options you pass to the DHT constructor.
Functions ¶
func EmptyQueryFilter ¶
func EmptyRTFilter ¶
Types ¶
type Config ¶
type Config struct { Datastore ds.Batching Validator record.Validator ValidatorChanged bool // if true implies that the validator has been changed and that Defaults should not be used Mode ModeOpt ProtocolPrefix protocol.ID V1ProtocolOverride protocol.ID BucketSize int ProtectedBuckets int // #DAOT Concurrency int Resiliency int MaxRecordAge time.Duration EnableProviders bool EnableValues bool ProviderStore providers.ProviderStore QueryPeerFilter QueryFilterFunc RoutingTable struct { RefreshQueryTimeout time.Duration RefreshInterval time.Duration AutoRefresh bool LatencyTolerance time.Duration CheckInterval time.Duration PeerFilter RouteTableFilterFunc DiversityFilter peerdiversity.PeerIPGroupFilter /* #DAOT */ ConsiderLatency bool AvgBitsImprovedPerStep float64 AvgRoundTripsPerStepWithNewPeer float64 } BootstrapPeers func() []peer.AddrInfo // test specific Config options DisableFixLowPeers bool TestAddressUpdateProcessing bool }
Config is a structure containing all the options that can be used when constructing a DHT.
func (*Config) ApplyFallbacks ¶
ApplyFallbacks sets default values that could not be applied during config creation since they are dependent on other configuration parameters (e.g. optA is by default 2x optB) and/or on the Host
type QueryFilterFunc ¶
QueryFilterFunc is a filter applied when considering peers to dial when querying
type QuorumOptionKey ¶
type QuorumOptionKey struct{}
type RouteTableFilterFunc ¶
RouteTableFilterFunc is a filter applied when considering connections to keep in the local route table.
Click to show internal directories.
Click to hide internal directories.