- 03 Apr, 2020 12 commits
-
-
Adin Schmahmann authored
* feat(query): fully async implementation of Kademlia lookup. peers returned from the lookup are not guaranteed to be alive (i.e. we're only guaranteed to have dialed the closest beta peers to the target), but given stable and correct routing tables the expectation that most of the peers returned are alive is high. * feat(query): add wrapper lookup followup function to followup after the lookup is completed and ensure that the closest k returned peers from a lookup have been queried even for beta < k * refactor(query) modified the structure returned from lookups to be a useful subset of the full query state instead of the entire query state * feat(options): beta parameter exposed as the Resiliency parameter * feat(routing): do not mark the routing table as updated after a FindPeer query * feat(routing): FindPeer can return addresses even if not Connected as long as it was either recently connected (CanConnect) or was discovered during the lookup * feat(bootstrap): bootstrap logic now uses GetClosestPeers instead of FindPeer * refactor(dht): stopFn no longer takes any state * fix(test): changed GetClosestPeers test to only assume beta instead of k peers since that is now more appropriate given the query logic changes and that the routing tables in that test are bad, i.e. a ring network with arbitrary peerIDs Co-authored-by: Petar Maymounkov <petarm@gmail.com> Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
-
Aarsh Shah authored
-
Aarsh Shah authored
-
Adin Schmahmann authored
-
Aarsh Shah authored
-
Aarsh Shah authored
-
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.
-
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.
-
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
-
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: Raúl Kripalani <raul.kripalani@gmail.com> Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
-
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.
-
Adin Schmahmann authored
-
- 22 Mar, 2020 1 commit
-
-
Steven Allen authored
go 1.14 is now required anyways
-
- 13 Mar, 2020 1 commit
-
-
David Dias authored
* feat: Expose the ProviderManager through the IpfsDht struct * feat: expose providers prefix so that we do not have to hard code it in other places Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
-
- 04 Mar, 2020 1 commit
-
-
Aarsh Shah authored
-
- 18 Feb, 2020 1 commit
-
-
Vibhav Pant authored
-
- 17 Feb, 2020 1 commit
-
-
Vibhav Pant authored
-
- 04 Feb, 2020 1 commit
-
-
Aarsh Shah authored
-
- 19 Dec, 2019 3 commits
-
-
Adin Schmahmann authored
-
Adin Schmahmann authored
-
Adin Schmahmann authored
-
- 12 Dec, 2019 3 commits
-
-
Henrique Dias authored
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
-
Henrique Dias authored
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
-
Henrique Dias authored
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
-
- 10 Dec, 2019 1 commit
-
-
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.
-
- 06 Dec, 2019 2 commits
-
-
Steven Allen authored
-
Steven Allen authored
fixes #274
-
- 02 Dec, 2019 1 commit
-
-
Steven Allen authored
Update deps: * Switch to multiformats/go-base32 * Regenerate protobuf decoding code
-
- 15 Nov, 2019 1 commit
-
-
Aarsh Shah authored
-
- 05 Nov, 2019 4 commits
-
-
Raúl Kripalani authored
-
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.
-
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.
-
Steven Allen authored
-
- 02 Nov, 2019 1 commit
-
-
Aarsh Shah authored
-
- 01 Nov, 2019 2 commits
-
-
Aarsh Shah authored
-
Steven Allen authored
1. Auto bootstrap on start. 2. Make `Bootstrap(ctx)` trigger a bootstrap but not _start_ the bootstrapping process.
-
- 11 Oct, 2019 4 commits
-
-
Aarsh Shah authored
1) on connecting to a new peer -> trigger self & bucket bootstrap if RT size goes below thereshold 2) accept formatting & doc suggestions in the review 3) remove RT recovery code for now -> will address in a separate PR once #383 goes in changes as per review
-
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
-
Steven Allen authored
-
aarshkshah1992 authored
-