Commit Graph

186 Commits

Author SHA1 Message Date
Brian Tiger Chow
4b5ff960c9 feat(core): use repo.Repo in core constructor 2015-01-18 14:41:42 -08:00
Brian Tiger Chow
884143bf9c move generic packages to thirdparty (see thirdparty/README.md) 2015-01-18 14:04:45 -08:00
Brian Tiger Chow
b252d0450d feat(eventlog): e := EventBegin; e.Done()
```Go
e := log.EventBegin(ctx, "provide")
e.Done()

e := log.EventBegin(ctx, "provide")
e.Close() // implements io.Closer in case you want to register with some lifecycle management system.
```
2015-01-14 17:55:28 -08:00
Brian Tiger Chow
50047dcf27 Update jenkins.go 2015-01-14 16:07:26 -08:00
Juan Batiz-Benet
0311c0518d testing/ci: all env var checks now use new pkgs
Good thing, i checked one wrong, too!
2015-01-14 16:01:03 -08:00
Juan Batiz-Benet
73b3c30452 ci-pkgs: added travis and jenkins ci pkgs 2015-01-14 15:37:10 -08:00
Juan Batiz-Benet
92e8a7bcd5 updated datastore for proper query handling
Queries now can be cancelled and the resources collected
2015-01-11 20:52:33 -08:00
Juan Batiz-Benet
da976a5f21 blocks: AllKeys + tests 2015-01-11 16:59:22 -08:00
Juan Batiz-Benet
f9ca67ef04 updated datastore (Query) 2015-01-11 16:59:22 -08:00
Brian Tiger Chow
007ffd40bd refactor: move LatencyConfig 2015-01-11 01:23:25 -08:00
Juan Batiz-Benet
474b74f70b dht/bootstrap: (optional) parallelism + error on peer
This also makes it an Error to find a peer.
2015-01-05 06:51:38 -08:00
Juan Batiz-Benet
09a2e1f64c testutil: obvious names for seeded key pairs 2015-01-05 04:55:02 -08:00
Juan Batiz-Benet
623625845d prefix logger
this commit adds a logger with prefixes
2015-01-05 00:16:52 -08:00
Juan Batiz-Benet
feb5e495f5 use ZeroLocalTCPAddress for network tests
This commit makes all network tests use ZeroLocalTCPAddress
as the initial peer address, and then relies on
net.ListenAddresses()

This should get rid of the tcp addr clash problems.
2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
cc0d7c9b57 crypto -> p2p/crypto
The crypto package moves into p2p. Nothing in it so far is ipfs
specific; everything is p2p-general.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
89f5cd4c94 introducing p2p pkg
I think it's time to move a lot of the peer-to-peer networking
but-not-ipfs-specific things into its own package: p2p.
This could in the future be split off into its own library.
The first thing to go is the peer.
2015-01-02 08:46:45 -08:00
Jeromy
da04d26779 clean up test setup interface 2015-01-02 08:33:42 +00:00
Jeromy
14fc4188be address comments from PR 2015-01-02 07:42:08 +00:00
Jeromy
07b064010e rewrite of provides to better select peers to send RPCs to
refactor test peer creation to be deterministic and reliable

a bit of cleanup trying to figure out TestGetFailure

add test to verify deterministic peer creation

switch put RPC over to use getClosestPeers

rm 0xDEADC0DE

fix queries not searching peer if its not actually closer
2015-01-02 07:42:07 +00:00
Juan Batiz-Benet
5999ae8d0d frac ctx - skip time tests in travis 2014-12-25 14:23:18 -08:00
Brian Tiger Chow
b5fd310a31 add todo 2014-12-24 12:48:15 -05:00
Brian Tiger Chow
0172e4f2bb style(testutil) rename testutil.Peer -> testutil.Identity
cc @jbenet
2014-12-24 09:59:24 -05:00
Brian Tiger Chow
12b92f03f1 add RandPeerOrFatal test helper 2014-12-24 09:31:17 -05:00
Brian Tiger Chow
a85aa9b5da refactor: rename testutil func 2014-12-24 09:31:17 -05:00
Brian Tiger Chow
b31f728188 feat(testutil) add testutil.Peer shim 2014-12-24 09:31:17 -05:00
Juan Batiz-Benet
0938471d1c ctxio: fix buffer of 1 so goroutine exits when io completes. 2014-12-24 05:50:05 -08:00
Juan Batiz-Benet
a4021eb433 ctxio -- io with a context.
This commit introduces a reader and writer that respect
contexts. Warning: careful how you use them. Returning
leaves a goroutine reading until the read finishes.
2014-12-24 02:10:56 -08:00
Juan Batiz-Benet
c43e8fa35b fixing race in testutil port 2014-12-23 17:59:35 -08:00
Juan Batiz-Benet
c84a714b16 peer change: peer.Peer -> peer.ID
this is a major refactor of the entire codebase
it changes the monolithic peer.Peer into using
a peer.ID and a peer.Peerstore.

Other changes:
- removed handshake3.
-	testutil vastly simplified peer
-	secio bugfix + debugging logs
-	testutil: RandKeyPair
-	backpressure bugfix: w.o.w.
-	peer: added hex enc/dec
-	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.
-	updated peer/queue + peerset
-	latency metrics
-	testutil: use crand for PeerID gen
 	RandPeerID generates random "valid" peer IDs. it does not
 	NEED to generate keys because it is as if we lost the key
 	right away. fine to read some randomness and hash it. to
 	generate proper keys and an ID, use:
 	  sk, pk, _ := testutil.RandKeyPair()
 	  id, _ := peer.IDFromPublicKey(pk)
 	Also added RandPeerIDFatal helper
- removed old spipe
- updated seccat
- core: cleanup initIdentity
- removed old getFromPeerList
2014-12-23 08:33:32 -08:00
Juan Batiz-Benet
ec96a0b0b5 util: fractional context 2014-12-23 08:27:53 -08:00
Juan Batiz-Benet
cc7a869e3d threadsafe SeededRand 2014-12-23 08:26:24 -08:00
Jeromy
9328fbaf81 clean peerset constructor names 2014-12-17 23:44:46 -08:00
Brian Tiger Chow
19764880d8 doc: peerset fixme
not changing this because i don't want to write a test for it now

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:46 -08:00
Brian Tiger Chow
45faa4d7a0 fix: set peerset size
addresses https://github.com/jbenet/go-ipfs/pull/438#discussion_r21952271

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:45 -08:00
Jeromy
69dd260236 refactor peerSet 2014-12-17 23:44:42 -08:00
Jeromy
cfbe92bc8b rewrite sendWantlistToProviders 2014-12-17 23:44:40 -08:00
Juan Batiz-Benet
ad43e1d462 testutil: peer gen with addrs 2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
31a62aff94 testutil: gen peers with keys 2014-12-17 23:25:39 -08:00
Juan Batiz-Benet
b9525f1524 added loggables pkg 2014-12-16 05:10:45 -08:00
Juan Batiz-Benet
393842e245 much simpler net
- removed ctxcloser
- removed multiconn
- focused on netio
2014-12-16 05:10:45 -08:00
Juan Batiz-Benet
55d1e794c7 multierr 2014-12-16 05:10:45 -08:00
Brian Tiger Chow
34b11a3b07 fix: routing mock accuracy
routing interface doesn't wait for value to appear in network, but value
doesn't appear in network until time as passed

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-15 20:46:43 -08:00
Brian Tiger Chow
8e0c8a7a7e refactor(mdag, bserv, bs) mocks, etc.
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-13 05:17:16 -08:00
Brian Tiger Chow
c3b3d7319e feat(util/ds2/delayed) add delayed datastore
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-13 05:17:16 -08:00
Brian Tiger Chow
ae79ac04d3 feat(util/delay) add Delay
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-13 05:17:16 -08:00
Juan Batiz-Benet
ac2be0b68b util/log: SetDebugLogging 2014-12-12 02:45:22 -08:00
Brian Tiger Chow
f8a449953b fix(core) bootstrap panic
@jbenet @mappum

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 18:04:41 -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
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
670d0244b4 feat(bitswap) make offline exchange query datastore
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 23:31:01 -08:00