Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultPrefix protocol.ID = "/dep2p"
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 = 10 * time.Second o.RoutingTable.RefreshQueryTimeout = 10 * time.Second o.RoutingTable.RefreshInterval = 10 * time.Minute o.RoutingTable.AutoRefresh = true o.RoutingTable.PeerFilter = EmptyRTFilter o.MaxRecordAge = providers.ProvideValidity o.BucketSize = defaultBucketSize o.Concurrency = 10 o.Resiliency = 3 o.LookupCheckConcurrency = 256 o.OptimisticProvideJobsPoolSize = 60 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
Concurrency int
Resiliency int
MaxRecordAge time.Duration
EnableProviders bool
EnableValues bool
ProviderStore providers.ProviderStore
QueryPeerFilter QueryFilterFunc
LookupCheckConcurrency int
RoutingTable struct {
RefreshQueryTimeout time.Duration
RefreshInterval time.Duration
AutoRefresh bool
LatencyTolerance time.Duration
CheckInterval time.Duration
PeerFilter RouteTableFilterFunc
DiversityFilter peerdiversity.PeerIPGroupFilter
}
BootstrapPeers func() []peer.AddrInfo
AddressFilter func([]ma.Multiaddr) []ma.Multiaddr
// test specific Config options
DisableFixLowPeers bool
TestAddressUpdateProcessing bool
EnableOptimisticProvide bool
OptimisticProvideJobsPoolSize int
}
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.