211 Commits

Author SHA1 Message Date
Steven Allen
2a39785d3f fix(options): make the disable providers/values options consistent 2019-12-06 09:47:22 -05:00
Steven Allen
52747fc1f0 feat: allow disabling value and provider storage/messages
fixes #274
2019-12-05 19:11:46 -05:00
Steven Allen
ef319676a9 chore: rename bootstrap to refresh
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.
2019-11-05 23:33:53 +00:00
Aarsh Shah
7cce5bdd96 make bootstrap synchronous & get tests to work 2019-11-02 00:37:15 +08:00
Aarsh Shah
00fffba0aa Update dht_bootstrap.go
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
2019-10-11 14:10:19 +09:00
Aarsh Shah
f4630f62d5 1) seed RT whenever it becomes empty
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
2019-10-11 13:17:36 +09:00
Aarsh Shah
5329454a0f removed cfg.Queries param from bootstrap 2019-10-11 13:13:53 +09:00
Aarsh Shah
36578e2be3 Striped locks for atomic Dht updates (#374)
Implement striped locking for datastore puts.
2019-07-22 20:47:45 -07:00
Raúl Kripalani
31765355df
migrate to consolidated types. (#344) 2019-05-26 23:33:15 +01:00
Steven Allen
95a6c2509f providers: use raw cids as map keys 2019-04-13 09:18:28 -07:00
Matt Joiner
86d78dc072
golangci-lint run -D errcheck (#298) 2019-03-14 11:07:15 +11:00
Steven Allen
6eafd65baa thread context to prep (#286)
We usually _explicitly_ call connect before calling `prep` but we may disconnect
somewhere in-between. We _don't_ want to get stuck here dialing if the context
has been canceled.
2019-03-07 18:53:16 +11:00
Matt Joiner
08c34b4d83
New node methods for tools and otherwise (#265)
* Add IpfsDHT.{Bootstrap{Random,Self},Peer{Id,Key}}
* Include client mode tests, support for Ping, and uncruft setupDHTs
* Include xerrors in deps
2019-03-06 08:10:38 +11:00
Steven Allen
c78d1e6786 fix(dialQueue): account for failed dials
fixes #276
2019-02-26 19:57:54 -07:00
Raúl Kripalani
120a585ebf Revert "Test go mod in travis and use major versioning in import paths (#236)"
This reverts commit 7e68ac3c60c15243c7d2e622b91aed92245a2677.
2019-02-12 14:12:53 +00:00
Adrian Lanzafame
7e68ac3c60 Test go mod in travis and use major versioning in import paths (#236) 2019-02-12 17:38:06 +11:00
Matt Joiner
8a62a14374
Deflake TestFindPeerQuery (#245)
* Rework TestFindPeersQuery

Unravel the logic and create a minimal test case that isn't flaky.

* Use testing.T.Logf

* Skip the original test in short mode

* Add comments for the arguments to testFindPeerQuery

* Qualify aberrant package name

* Use redundant package names

* gx import testify 1.3.0.
2019-02-05 10:35:37 +11:00
Matt Joiner
8b37385468 Rename log to logger 2019-02-03 13:14:35 +11:00
Matt Joiner
b598d08a51 Reduce noise in the bootstrap tests 2019-01-31 14:59:23 +11:00
Matt Joiner
2d2bb5513c
Tidy up bootstrapping (#235)
* Remove signal bootstrapping

Remove IpfsDHT.BootstrapOnSignal.

* Type check expected interfaces on IpfsDHT

* Simplify the bootstrap logic

* Tidy up a few other things

* Include BootstrapOnce

* Add comment about duplicating sanity checks

* Use existing import naming convention

* Defer error wrapping until we need it

* Restore existing query count behaviour
2019-01-31 10:06:56 +11:00
Steven Allen
201eea5e0b
Revert "Tidy up bootstrapping" 2019-01-24 14:06:38 -08:00
Matt Joiner
9055bd6981 Include BootstrapOnce 2019-01-24 09:52:56 +11:00
Matt Joiner
f423e38edd Simplify the bootstrap logic 2019-01-24 09:52:56 +11:00
Matt Joiner
69392ff66f Remove signal bootstrapping
Remove IpfsDHT.BootstrapOnSignal.
2019-01-24 09:52:55 +11:00
Hector Sanjuan
110dae4320
Revert "Remove signal bootstrapping" 2019-01-23 13:28:20 +01:00
Matt Joiner
b33ea78537 Remove signal bootstrapping
Remove IpfsDHT.BootstrapOnSignal.
2019-01-22 15:47:33 +11:00
Kevin Atkinson
a303c45371 gx update and fix code to use new Cid type 2018-09-11 21:54:47 -04:00
Łukasz Magiera
307660c78d SearchValue: Make -1 quorum mean infinite on get 2018-08-10 12:06:32 +02:00
Łukasz Magiera
e28b133f80 SearchValue: add backward-compatible GetValues 2018-08-10 12:06:32 +02:00
Łukasz Magiera
547c0a7170 SearchValue: simplify error handling further 2018-08-10 12:06:32 +02:00
Łukasz Magiera
ad37d996f6 SearchValue: add a test 2018-08-10 12:06:32 +02:00
Łukasz Magiera
64d1622c72 SearchValue: simplify error handling 2018-08-10 12:06:32 +02:00
Łukasz Magiera
e260fe510f Implement SearchValue 2018-08-10 12:06:32 +02:00
Steven Allen
2093a7192e cleanup tests and timeouts a bit
Addresses CR and ensures that we don't wait 10m for tests that should never take
more than 5s.
2018-06-25 16:58:34 -07:00
Steven Allen
97131ef4c2 remove random print from test 2018-06-15 14:13:07 -07:00
Steven Allen
203962c1c5 add tests for 161 and 162 2018-06-15 14:04:35 -07:00
Steven Allen
95067a1cc4 improve the dht tests 2018-06-13 19:37:29 -07:00
Steven Allen
6c4aa35c94 validate and compare record on local put 2018-06-13 17:01:53 -07:00
Steven Allen
7ecca973f3 fix for swarm refactor 2018-06-04 21:45:38 -07:00
Erin Swenson-Healey
a909366b1e improve DHT protocol test 2018-06-04 11:33:49 -07:00
Erin Swenson-Healey
15fe77a9f5 add test for DHTs using different protocols 2018-06-01 16:06:18 -07:00
Erin Swenson-Healey
3b148d2b88 make Protocols variadic, for usability 2018-06-01 15:54:53 -07:00
Erin Swenson-Healey
d94deae41d make DHT protocols pluggable 2018-06-01 14:55:16 -07:00
Steven Allen
c0d3351b8d revert interface changes and add options
Instead of changing the existing constructors, add a new DHT constructor that
takes options (and add DHT options).
2018-05-31 17:54:24 -07:00
Steven Allen
3befc403d7 require that the validator be explicitly passed in
Note: this does mean that the DHT won't work with peer keys by default and that
the constructor signature changes. Given all the changes that'll come with the
libp2p refactor, I don't feel too bad about this.
2018-05-31 17:54:19 -07:00
Steven Allen
97741ed0a8
Merge pull request #122 from dirkmc/fix/select-best-rec-on-put
Disallow overwriting new records with older records on DHT PUT
2018-03-15 02:10:31 +00:00
Steven Allen
b02b9245be correctly tear-down bootstrapper
1. We need to close the process to tear it down.
2. Closing the signal channel will cause the goprocess timer to fire repeatedly so let's not do that.
3. Don't leak a goroutine (the amplify one).
2018-03-14 14:03:22 -07:00
Steven Allen
87783c0ed0 better cancel/close after tests 2018-03-14 14:03:11 -07:00
Dirk McCormick
bdf2cdc986 Disallow overwriting new records with older records on DHT PUT 2018-03-05 15:13:12 -05:00
Steven Allen
1134fa1eb2 nit: be less noisy when testing
These aren't errors, don't log them as such.
2018-02-11 11:36:59 -08:00