1. 03 Apr, 2020 11 commits
    • Aarsh Shah's avatar
      fix validation · e1ed8259
      Aarsh Shah authored
      e1ed8259
    • Aarsh Shah's avatar
      change peer validation func · 050c4b8f
      Aarsh Shah authored
      050c4b8f
    • Adin Schmahmann's avatar
      fix: protect rng with a mutex · 5358a4fb
      Adin Schmahmann authored
      5358a4fb
    • Aarsh Shah's avatar
      change tests · 169395b4
      Aarsh Shah authored
      169395b4
    • Aarsh Shah's avatar
      RT connectivity changes · c17965fa
      Aarsh Shah authored
      c17965fa
    • 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
      Utilize identify events to add peers to the routing table (#472) · 509c0bce
      Adin Schmahmann authored
      * feat: consume identify events to evaluate routing table addition
      * fix: routing table no longer gets an update just because new messages have arrived or been sent
      * fix: add already connected peers into the routing table before listening to events
      Co-authored-by: default avatarRaúl Kripalani <raul.kripalani@gmail.com>
      Co-authored-by: default avatarAarsh Shah <aarshkshah1992@gmail.com>
      509c0bce
    • 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
    • Adin Schmahmann's avatar
      first pass at proper kad · 6793dc11
      Adin Schmahmann authored
      6793dc11
  2. 22 Mar, 2020 1 commit
  3. 13 Mar, 2020 1 commit
  4. 04 Mar, 2020 1 commit
  5. 18 Feb, 2020 1 commit
  6. 17 Feb, 2020 1 commit
  7. 04 Feb, 2020 1 commit
  8. 19 Dec, 2019 3 commits
  9. 12 Dec, 2019 3 commits
  10. 10 Dec, 2019 1 commit
    • Steven Allen's avatar
      feat: refresh and wait · 0be0cbc5
      Steven Allen authored
      We'd like to be able to refresh then _wait_ for the refresh to finish in the testground DHT tests. That way, we can:
      
      1. Start and disable _auto_ refresh.
      2. Bootstrap.
      3. Refresh a couple of times till we're stable.
      4. Wait to _stop_ refreshing.
      5. Disconnect from and forget about all peers _not_ in our routing tables.
      6. Run the actual tests without interference from the bootstrapping logic.
      0be0cbc5
  11. 06 Dec, 2019 2 commits
  12. 02 Dec, 2019 1 commit
    • Steven Allen's avatar
      chore(dep): update · 0d482540
      Steven Allen authored
      Update deps:
      
      * Switch to multiformats/go-base32
      * Regenerate protobuf decoding code
      0d482540
  13. 15 Nov, 2019 1 commit
  14. 05 Nov, 2019 4 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
    • Steven Allen's avatar
      98cf9149
  15. 02 Nov, 2019 1 commit
  16. 01 Nov, 2019 2 commits
  17. 11 Oct, 2019 5 commits