221 Commits

Author SHA1 Message Date
Matt Joiner
8b37385468 Rename log to logger 2019-02-03 13:14:35 +11:00
Steven Allen
201eea5e0b
Revert "Tidy up bootstrapping" 2019-01-24 14:06:38 -08:00
Matt Joiner
f423e38edd Simplify the bootstrap logic 2019-01-24 09:52:56 +11:00
Kevin Atkinson
a303c45371 gx update and fix code to use new Cid type 2018-09-11 21:54:47 -04:00
Steven Allen
f5423a6a72 don't double-validate values
Also, de-duplicate some logic.
2018-08-10 13:57:45 -07:00
Steven Allen
cd3cac0194 go fmt 2018-08-10 13:51:01 -07:00
Łukasz Magiera
246579e78b SearchValue: respect ctx on output 2018-08-10 12:13:17 +02:00
Łukasz Magiera
6ca5dd7bf4 SearchValues: more review addressing 2018-08-10 12:06:32 +02:00
Łukasz Magiera
d72432caf1 SearchValue: address review 2018-08-10 12:06:32 +02:00
Łukasz Magiera
51c475d117 SearchValue: make default quorum infinite for search 2018-08-10 12:06:32 +02: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
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
4d76fd28ed upgrade protobuf and switch to bytes keys
fixes #177
2018-08-07 18:50:04 -07:00
Steven Allen
993399a183 don't treat a canceled context as a successful query
fixes #172
2018-07-10 17:29:02 +02:00
Steven Allen
97131ef4c2 remove random print from test 2018-06-15 14:13:07 -07:00
Steven Allen
ed35a2d66c return ErrNotFound when offline routing is requested and we have no local value
err is nil in this case
2018-06-13 19:20:00 -07:00
Steven Allen
6c4aa35c94 validate and compare record on local put 2018-06-13 17:01:53 -07:00
Steven Allen
39907a7658 reuse getRecordFromDatastore in getValue
Also, double check the key (should be impossible but the check is cheep).
2018-06-13 16:59:12 -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
cad57471f5 update for the routing refactor
GetValues was very DHT specific so the routing interface has been updated to
remove that function. Instead, it has introduced general-purpose options.

This is a minimal alternative to #141 to avoid bundling too many changes
together.
2018-05-31 17:47:35 -07:00
vyzo
ae5dd23eb2 mutex protect peersSeen map in FindPeersConnectedToPeer 2018-04-29 21:53:34 +03:00
Steven Allen
058c472825
Merge pull request #134 from MichaelMure/review
document and clean small things
2018-04-01 17:08:02 +00:00
Michael Muré
2026fcb558
document and clean small things 2018-04-01 12:38:15 +02:00
Lars Gierth
db3b915a17 docs: remove mentions of coral, it's not implemented 2018-03-28 03:44:49 +02:00
Dirk McCormick
7808271093 Ensure that records published by this peer do not immediately expire 2018-03-12 13:45:02 -04:00
Dirk McCormick
a9c59f3f15 Remove record signature verification 2018-02-07 14:52:15 -08:00
Forrest Weston
70fc1084b6 Add Event logging to dht routing
License: MIT
Signed-off-by: ForrestWeston <forrest@protocol.ai>
2017-12-11 14:00:16 -08:00
Steven Allen
491afc8e27 optimize allocations
Try to preallocate slices up-front instead of repeatedly reallocating.
2017-12-05 15:46:24 -08:00
Herman Junge
655ea5e262 Add queried peer ID to query event 2017-07-14 22:08:13 -04:00
Jeromy
04ee593ef6 update to use no-broadcast option 2017-05-16 18:23:18 -07:00
Jeromy
52e620c6ef Add addresses from received provider records
Thanks @mildred for catching this and providing a patch.
2017-03-24 10:28:37 -07:00
Jeromy
00b46e0cf7 Fixes for dht findpeer queries
First, we use Alpha instead of K as the number of peers we grab from the
routing table (as per the kademlia paper).

Second, we don't use a size limited set for the 'GetClosestPeers' query.
We're going to process more than K peers before we find the K closest
peers.

Third, Change GetClosestPeers to actually return the K Closest peers,
not a hodge podge of peers that it found on the way to finding the
closest peers.
2017-03-05 21:36:46 -08:00
Jeromy
6894f33507 update dependencies after package extraction funtime 2016-10-05 12:34:28 -07:00
Jeromy
e00b3ca0a4 use stdlib context and clean up deps 2016-09-30 10:24:03 -07:00
Jeromy
c372d79e42 switch to strings and cids instead of keys 2016-09-30 10:13:57 -07:00
George Antoniadis
30d43d22e0 Fix dependencies 2016-09-02 20:21:23 +01:00
George Antoniadis
5f3e63aa46 Undo gx rewrites and add gx package.json 2016-08-21 17:18:58 +01:00
Jeromy
be1a0dd77a dht: add in code to detect and diagnose #3032
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-08-03 18:19:47 -07:00
Jeromy Johnson
034ee297f2 Merge pull request #2941 from ipfs/feat/backoff-clear-connect
Feat/backoff clear connect
2016-07-05 15:19:31 -07:00
Jeromy
c3a2a104b9 fix handling of dht records and local fixups
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-07-05 12:34:03 -07:00
Jeromy
95553964a2 update go-libp2p
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-07-04 12:27:26 -07:00
Jakub Sztandera
22af8d1151 Update go-log in whole dependency tree (#2898)
* Update golog in go-ipfs

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update go-libp2p for go-log

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update go-libp2p-secio for go-log

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update go-libp2p-crypto for go-log

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update go-libp2p-peer for go-log

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Import peersore, it wasn't imported

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update peerstore

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update peer

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update secio

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update go-libp2p

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-24 09:38:07 -07:00
Jeromy Johnson
3f05aa0579 Merge pull request #2853 from ipfs/feature/decapitalize-Debug
Decapitalized log.Debug messages
2016-06-17 10:26:20 -07:00
Jeromy
47d10d7be6 update go-libp2p to 3.3.4
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-06-15 13:04:49 -07:00
Richard Littauer
2203d3b1fe Decapitalized log.Debug messages
According to golang standards, these should not be capitalized nor having a trailing period, AFAIK.

License: MIT
Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
2016-06-15 08:56:34 +01:00
Jeromy
9f37aaa272 a few small changes to make the dht more efficient
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-06-11 17:08:34 -07:00
Jeromy
63b6db0589 pull in libp2p updates with utp fixes
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-06-11 10:33:44 -07:00