Skip to content

Commit

Permalink
doc(options): document that disabling values/providers should only be…
Browse files Browse the repository at this point in the history
… done on forked dhts
  • Loading branch information
Stebalien committed Dec 6, 2019
1 parent 52747fc commit c2b72b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ type IpfsDHT struct {

maxRecordAge time.Duration

// Allows disabling dht subsystems. These should _only_ be set on
// "forked" DHTs (e.g., DHTs with custom protocols and/or private
// networks).
enableProviders, enableValues bool
}

Expand Down
6 changes: 6 additions & 0 deletions opts/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ func DisableAutoRefresh() Option {
// EnableProviders enables storing and retrieving provider records.
//
// Defaults to true.
//
// WARNING: do not change this unless you're using a forked DHT (i.e., a private
// network and/or distinct DHT protocols with the `Protocols` option).
func EnableProviders(enable bool) Option {
return func(o *Options) error {
o.EnableProviders = enable
Expand All @@ -195,6 +198,9 @@ func EnableProviders(enable bool) Option {
// EnableValues enables storing and retrieving value records.
//
// Defaults to true.
//
// WARNING: do not change this unless you're using a forked DHT (i.e., a private
// network and/or distinct DHT protocols with the `Protocols` option).
func EnableValues(enable bool) Option {
return func(o *Options) error {
o.EnableValues = enable
Expand Down

0 comments on commit c2b72b2

Please sign in to comment.