1. 03 Apr, 2020 5 commits
    • Adin Schmahmann's avatar
      Configurable Peer Filtering (#471) · 0543571f
      Adin Schmahmann authored
      Allows specifying peer filter functions on query and on adding peers to the routing table. This patch also includes some reasonable default functions for a public-only and private-only DHT.
      Co-authored-by: default avatarWill Scott <will@cypherpunk.email>
      Co-authored-by: default avatarSteven Allen <steven@stebalien.com>
      0543571f
    • Adin Schmahmann's avatar
      Upgrade DHT version (#479) · 07dff1f5
      Adin Schmahmann authored
      * upgraded the protocol id to version 2 (i.e. /kad/2.0.0) and made it so v2 peers running in server mode respond to queries from v1 peers. Note: v2 peers will only send queries using the v2 protocol, will only add v2 peers to their routing tables, and will only tell v1 peers about v2 peers.
      * to run a forked network we now use network specific protocol prefixes instead of manually setting protocol IDs. Use the ProtocolPrefix option instead of the Protocols option.
      * emit errors during initialization if the user misuses the default protocol prefix by setting parameters inconsistent with the default protocol's network specification
      * since the Client option has been deprecated it's been removed from the dht's options. While deprecated it is still available in the dht options package. Setting `Client(false)` now puts the node into ModeAuto.
      07dff1f5
    • Steven Allen's avatar
      feat: move options to main package and make internals private (#486) · 30fa0861
      Steven Allen authored
      * feat: move options to main package and make internals private
      
      Rationale:
      
      1. This allows us to make private options for testing.
      2. This removes an import for DHT users.
      3. This makes options much easier to discover.
      4. This makes it possible to make the config/options internals private.
      
      We originally put them in a sub-package to avoid poluting the root namespace,
      but that isn't really necessary.
      
      This keeps the old package (for now) to avoid breaking too much.
      30fa0861
    • Adin Schmahmann's avatar
      Enable switching DHT between client and server modes (#469) · d4134a46
      Adin Schmahmann authored
      * created Mode(ModeOpt) option for choosing between auto/client/server modes
      * Auto mode internally switches the DHT between client and server modes based on the EvtLocalReachabilityChanged event emitted on the event bus (e.g. by AutoNAT)
      * routing table management of peers that switch between client and server mode while we are connected to them (i.e. are in auto mode)
      * removed Client(bool) option, becoming a DHT client is specified using Mode(ModeClient) instead
      d4134a46
    • Adin Schmahmann's avatar
      options: KValue and AlphaValue global variables no longer used internally.... · e967acad
      Adin Schmahmann authored
      options: KValue and AlphaValue global variables no longer used internally. Concurrency option now sets alpha. DisjointPaths option now sets d. Default number of disjoint paths is now bucketSize/2.
      e967acad
  2. 18 Feb, 2020 1 commit
  3. 17 Feb, 2020 2 commits
  4. 07 Dec, 2019 1 commit
  5. 06 Dec, 2019 3 commits
  6. 15 Nov, 2019 1 commit
  7. 05 Nov, 2019 3 commits
    • Raúl Kripalani's avatar
      inline struct for RoutingTable config. · a33b0b97
      Raúl Kripalani authored
      a33b0b97
    • Steven Allen's avatar
      chore: rename bootstrap to refresh · ef319676
      Steven Allen authored
      As pointed out by raul, bootstrapping and refreshing are not the same thing.
      Bootstrapping is the initial setup (i.e., connect to some initial nodes to get
      started). Refreshing is the process of refreshing the routing table.
      ef319676
    • Steven Allen's avatar
      feat(bootstrap): simplify bootstrapping · ed244cd4
      Steven Allen authored
      * Rename triggerAutoBootstrap to autoBootstrap. This variable used to control
      _triggering_ only but now completely disables automatic bootstrapping.
      * Remove the BootstrapConfig. We introduced this before we switched to
      functional options. Now that we're breaking the interfaces anyways, we might as
      well use functional options all the way (easier to extend).
      * Always query self (feedback from @raulk).
      * Important: don't abort the bootstrap process if we timeout finding ourselves.
      ed244cd4
  8. 03 Nov, 2019 1 commit
  9. 01 Nov, 2019 1 commit
  10. 11 Oct, 2019 1 commit
    • Aarsh Shah's avatar
      1) seed RT whenever it becomes empty · f4630f62
      Aarsh Shah authored
      2) seed RT if empty before starting bootstrap incase 1 hasn't fired
      3) pass bootstrap config as option while creating Dht
      4) replace all bootstrap function with 1 function
      f4630f62
  11. 04 Oct, 2019 1 commit
  12. 26 May, 2019 1 commit
  13. 15 Apr, 2019 1 commit
  14. 01 Jun, 2018 3 commits