327 Commits

Author SHA1 Message Date
Juan Batiz-Benet
3dd6ee1f86 dht: update to use net.LocalPeer 2014-12-08 20:52:45 -08:00
Juan Batiz-Benet
e1b5933641 dht/pb: changed PeersToPBPeers to set ConnectionType
Uses an inet.Dialer
2014-12-08 20:52:45 -08:00
Juan Batiz-Benet
fb367a8619 dht: changed msgs, include multiple addrs + conn type
See https://github.com/jbenet/go-ipfs/issues/153#issuecomment-63350535
2014-12-08 20:52:34 -08:00
Juan Batiz-Benet
1383f8edfc dht: linting 2014-12-08 19:28:05 -08:00
Brian Tiger Chow
2c1700b45d refactor(dht) remove extraneous return value
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 16:28:22 -08:00
Brian Tiger Chow
6dc7dd5271 refactor(peerstore) s/Get/FindOrCreate
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 02:10:42 -08:00
Brian Tiger Chow
add43e52a4 fix(dht/routing) make GetProviders respect context
This commit makes GetProviders (sync) respect the request context. It
also amends all of GetProviders' callsites to pass a context in. This
meant changing the signature of the dht's handlerfunc.

I think I'll start referring to the request context as Vito Corleone.

cc @whyrusleeping @jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:56:27 -08:00
Brian Tiger Chow
40c2719146 fix(routing/dht) _always_ close chan on exit of FindProvidersAsync
the important change here is that within FindProvidersAsync, the channel
is closed using a `defer`. This ensures the channel is always closed,
regardless of the path taken to exit.

+ misc cleanup

cc @whyrusleeping @jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:56:27 -08:00
Brian Tiger Chow
914cdd8725 log(dht) Event: connect
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-25 06:16:40 -08:00
Brian Tiger Chow
b9d2b7628a log(dht) add eventlog.Update event
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-25 06:16:39 -08:00
Brian Tiger Chow
74a9c295a4 fix(misc) address PR comments
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:40:05 -08:00
Brian Tiger Chow
2f03a8e477 fix(imports) misc
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
91f8b1aad6 refactor(eventlog) elog -> eventlog
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
545bda9e11 log(dht) log a couple events to demonstrate API
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:00:58 -08:00
Jeromy
c5cf1ea156 address comments from PR 2014-11-16 02:45:20 -08:00
Jeromy
a5e5532788 verify ipns records 2014-11-16 02:45:19 -08:00
Jeromy
711144efeb fix routing resolver 2014-11-16 02:45:19 -08:00
Jeromy
79a8ea0d5c validator functions and ipns completion 2014-11-16 02:45:19 -08:00
Jeromy
cac56033a9 switch DHT entries over to be records, test currently fail 2014-11-16 02:45:19 -08:00
Jeromy
b1e34b5e90 write a few package doc strings to improve look of godoc 2014-11-08 21:42:36 -08:00
Brian Tiger Chow
077a34c247 fix(net) pass contexts to dial peer 2014-11-05 10:04:20 -08:00
Jeromy
01750dc710 comment comment comment comment 2014-11-03 03:02:56 +00:00
Jeromy
cb1443177a fix bug where terminal would randomly become garbled binary crap 2014-10-30 16:34:52 +00:00
Brian Tiger Chow
e3d7d2b50c refactor(routing) use routing.ErrNotFound 2014-10-28 02:17:46 -07:00
Juan Batiz-Benet
be52e35ed7 dht ctxcloserify 2014-10-25 21:33:59 -07:00
Jeromy
d2fba7bb62 logging, logging, and some minor logging 2014-10-25 14:50:22 -07:00
Jeromy
072e7d9555 add in dag removal 2014-10-25 12:39:36 -07:00
Brian Tiger Chow
1024504a6f refactor(dht/pb) move proto to pb package 2014-10-25 04:13:28 -07:00
Juan Batiz-Benet
2aeefaa102 go-vet friendly codebase
- distinguish log.Error and log.Errorf functions
- Initialize structs with field names
- A bit of unreachable code (defers)
2014-10-25 03:46:39 -07:00
Jeromy
d817b84a64 rewrite findpeer and other dht tweaks 2014-10-24 18:53:36 -07:00
Juan Batiz-Benet
5582e282d4 Dialer for dht
dht doesn't need the whole network interface, only needs a Dialer.
(much reduced surface of possible errors)
2014-10-22 03:24:05 -07:00
Juan Batiz-Benet
ae40568b44 this shouldn't connect quite yet. 2014-10-22 03:24:05 -07:00
Jeromy
9f4bdde9b8 working on debugging dht issues 2014-10-22 03:24:05 -07:00
Juan Batiz-Benet
3b15457cf0 renamed datastore.go -> go-datastore 2014-10-21 15:10:58 -07:00
Juan Batiz-Benet
28e083b902 peer.Peer is now an interface
![](http://m.memegen.com/77n7dk.jpg)
2014-10-20 03:26:46 -07:00
Juan Batiz-Benet
e98bb76b0f peerstore constructs peers
Now, all peers should be retrieved from the Peerstore, which will
construct the peers accordingly. This ensures there's only one peer
object per peer (opposite would be bad: things get out sync)

cc @whyrusleeping
2014-10-20 00:44:44 -07:00
Jeromy
f138a875b5 small changes to auxiliary dht functions 2014-10-18 04:28:26 -07:00
Jeromy
9dbba5c6d0 some dht cleanup, and make DHTs take a master context 2014-10-18 04:28:26 -07:00
Jeromy
34452f1678 fix bug in diagnostics, and add more peers to closer peer responses 2014-10-18 04:28:25 -07:00
Jeromy
c4d9c231dd fix up FindProvidersAsync 2014-10-18 04:28:25 -07:00
Juan Batiz-Benet
4429ee65e3 logging + tweaks 2014-10-18 04:28:24 -07:00
Juan Batiz-Benet
5fe1399bab dht handleAddProviders adds addr in msg
Otherwise don't have the peer's target address.
2014-10-18 04:28:24 -07:00
Jeromy
52fca5a91e add in some extra debug logging, and increase routing table latencies 2014-10-08 21:55:50 +00:00
Juan Batiz-Benet
740b381804 changed logging, in dht and elsewhere
- use log.* instead of u.*
- use automatic type conversions to .String()
  (Peer.String() prints nicely, and avoids calling b58 encoding
  until needed)
2014-10-07 21:33:59 -07:00
Juan Batiz-Benet
d50c42566f Obviated need for .ID.Pretty() all over the place. 2014-10-06 04:23:55 -07:00
Juan Batiz-Benet
84781abf54 loggers: set level 2014-10-04 03:53:21 -07:00
Juan Batiz-Benet
8c1bd59fb4 initialize loggers at ERROR 2014-10-04 03:36:30 -07:00
Juan Batiz-Benet
129ac6aaa6 use string datastore keys. 2014-10-03 15:39:22 -07:00
Juan Batiz-Benet
da0d3be852 vendoring ipns things 2014-10-01 00:44:22 -07:00
Jeromy
8815a7c482 implement publisher for ipns to wait until moments of rapid churn die down 2014-10-01 00:42:17 -07:00