Commit Graph

88 Commits

Author SHA1 Message Date
Juan Batiz-Benet
ccafa3c314 peer/queue/sync: remove buffering
cc @whyrusleeping
2014-12-21 16:06:03 -08:00
Juan Batiz-Benet
0d760a94f8 core: cleanup initIdentity 2014-12-21 14:09:33 -08:00
Juan Batiz-Benet
e6fc31bbc4 Network: added notion of versions (h1) to h3 2014-12-21 05:45:31 -08:00
Juan Batiz-Benet
c9e4dcbcd6 peerstore: convenience functions 2014-12-20 21:08:04 -08:00
Juan Batiz-Benet
e6923ad969 peerstore: PeerInfo func 2014-12-20 14:23:33 -08:00
Juan Batiz-Benet
0b12fd65df peer.PeerInfo comment accuracy 2014-12-20 13:39:36 -08:00
Juan Batiz-Benet
3c5f484d58 latency metrics 2014-12-19 23:49:36 -08:00
Juan Batiz-Benet
5931546507 updated peer/queue + peerset 2014-12-19 22:24:31 -08:00
Juan Batiz-Benet
423cd2cc8d peer: added a PeerInfo struct
PeerInfo is a small struct used to pass around a peer with
a set of addresses and keys. This is not meant to be a
complete view of the system, but rather to model updates to
the peerstore. It is used by things like the routing system.
2014-12-19 22:23:09 -08:00
Juan Batiz-Benet
20068c8637 peer: added hex enc/dec 2014-12-19 22:22:54 -08:00
Juan Batiz-Benet
b8a3c3d770 backpressure now uses peer.ID 2014-12-19 21:56:30 -08:00
Juan Batiz-Benet
6818090249 peerstore: added privkey holding 2014-12-19 20:10:47 -08:00
Juan Batiz-Benet
c49580044d peer fix: String() uses Pretty 2014-12-19 19:15:37 -08:00
Juan Batiz-Benet
fc10d6937d peer: test key/id relationship 2014-12-19 12:29:23 -08:00
Juan Batiz-Benet
d16eb663c4 peer change 2014-12-19 12:20:30 -08:00
Juan Batiz-Benet
f952275bf2 shorter queue test (reloaded) 2014-12-10 21:06:07 -08:00
Juan Batiz-Benet
0f12f4b245 shorter peer queue test 2014-12-10 21:03:31 -08:00
Juan Batiz-Benet
26e7656164 dht tests: dont introduce nil multiaddr
this is the type of assumption we shouldn't violate.
2014-12-08 20:52:45 -08:00
Brian Tiger Chow
80bc9251a6 style(peer) shorter ID when printing Peer
feel free to contest/revert if this becomes a problem

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 16:28:31 -08:00
Brian Tiger Chow
74eb03231d fix(core, peer) helpers to testutil, err handling
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 14:32:52 -08:00
Brian Tiger Chow
c69f6895db feat(peerstore) add peer to peerstore upon instantiation
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 02:10:42 -08:00
Brian Tiger Chow
d77c4bb5e0 refactor(peer): create peer through peerstore
for safety!

use mockpeer.WithID methods to create peers in tests

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 02:10:42 -08:00
Brian Tiger Chow
73a89e161d 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
1e007791a5 refactor(peer) impl peerstore with map
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 02:10:42 -08:00
Brian Tiger Chow
3f63e50c54 fix(peer): use error-checking multiaddr method
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 01:10:25 -08:00
Brian Tiger Chow
52631c697e fix(logging) interpret peer id strings correctly
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-27 17:29:52 -08:00
Jeromy
0de12b5d36 implement ipfs id in the new commands library 2014-11-16 16:46:06 -08:00
Brian Tiger Chow
4b1607819f 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
Brian Tiger Chow
a11c59dcac feat(peer) add Type (Unspecified, Local, Remote) 2014-11-16 07:00:58 -08:00
Brian Tiger Chow
079bdbacdf doc(peer) question 2014-11-16 07:00:28 -08:00
Brian Tiger Chow
2e0371c60a doc(peer) add TODO
TODO ensure correctness at ID generation and enforce this by only exposing functions that generate IDs safely. Then any peer.ID type found in the codebase is known to be correct.
2014-11-16 03:43:23 -08:00
Brian Tiger Chow
0aff6873dd fix(peer) perform bounds check on peer Id when printing String 2014-11-16 03:43:23 -08:00
Brian Tiger Chow
0c530bf5f1 tests(peer) ensure String() works when p created WithId
presently, fails
2014-11-16 03:43:23 -08:00
Brian Tiger Chow
ed4a8eb782 chore(tests) add Short() -> SkipNow() to slowest tests
vanilla:
    21.57 real        45.14 user         8.51 sys

short:
    14.40 real        31.13 user         5.56 sys

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-15 02:10:53 -08:00
Jeromy
4f083d54d6 write a few package doc strings to improve look of godoc 2014-11-08 21:42:36 -08:00
Brian Tiger Chow
550b98b7fd doc(peer) 2014-11-05 10:15:17 -08:00
Brian Tiger Chow
074722cf8a fix(peer) update latency 2014-11-05 10:15:17 -08:00
Juan Batiz-Benet
40aea2a934 handshake: log whether new addr observed 2014-11-05 04:05:30 -08:00
Jeromy
c3d04570c0 a few more comments 2014-11-03 03:53:16 +00:00
Juan Batiz-Benet
184c25430b 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
Juan Batiz-Benet
701035d5b0 handshake3 (addrs) 2014-10-22 05:25:31 -07:00
Juan Batiz-Benet
f7c1ed39e0 renamed datastore.go -> go-datastore 2014-10-21 15:10:58 -07:00
Juan Batiz-Benet
ac62d13e42 peerstore Put -> Add
Changed lots of peer use, and changed the peerstore to ensure
there is only ever one peer in use.

Fixed #174
2014-10-20 06:37:12 -07:00
Juan Batiz-Benet
9ca87fbb93 peer.Peer is now an interface
![](http://m.memegen.com/77n7dk.jpg)
2014-10-20 03:26:46 -07:00
Juan Batiz-Benet
b1d11ccfcb 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
Juan Batiz-Benet
08af98d412 logging friendliness 2014-10-18 04:36:20 -07:00
Juan Batiz-Benet
e989d6febe move IDFromPubKey to peer pkg 2014-10-18 04:28:26 -07:00
Jeromy
77cec59083 actually put diagCmd into the super command so it can be run 2014-10-10 13:18:19 -07:00
Juan Batiz-Benet
66839fa1de 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
77fccaa2f3 Obviated need for .ID.Pretty() all over the place. 2014-10-06 04:23:55 -07:00