Commit Graph

201 Commits

Author SHA1 Message Date
Henry
069b4b5c8e rm util.NewByteChanReader() 2015-03-12 14:50:01 +01:00
Henry
71245e5971 remove unused POut() 2015-02-27 14:19:19 +01:00
Henry
29e82d59f0 tell godep about our shareness dependency on go-humanize 2015-02-27 13:57:23 +01:00
Henry
92d08db7a5 rewrote import paths of go.net/context to use golang.org/x/context
- updated go-ctxgroup and goprocess
ctxgroup: AddChildGroup was changed to AddChild. Used in two files:
- p2p/net/mock/mock_net.go
- routing/dht/dht.go

- updated context from hg repo to git
prev. commit in hg was ad01a6fcc8a19d3a4478c836895ffe883bd2ceab. (context: make parentCancelCtx iterative)
represents commit 84f8955a887232b6308d79c68b8db44f64df455c in git repo

- updated context to master (b6fdb7d8a4ccefede406f8fe0f017fb58265054c)

Aaron Jacobs (2):
net/context: Don't accept a context in the DoSomethingSlow example.
context: Be clear that users must cancel the result of WithCancel.

Andrew Gerrand (1):
go.net: use golang.org/x/... import paths

Bryan C. Mills (1):
net/context: Don't leak goroutines in Done example.

Damien Neil (1):
context: fix removal of cancelled timer contexts from parent

David Symonds (2):
context: Fix WithValue example code.
net: add import comments.

Sameer Ajmani (1):
context: fix TestAllocs to account for ints in interfaces
2015-02-25 11:58:19 +01:00
Jeromy
b79fffc965 implement metadata node for unixfs and other 2015-02-04 23:07:12 +00:00
Juan Batiz-Benet
5a8aa1afcf ipfsaddr: Transport part. 2015-02-01 06:34:13 -08:00
Juan Batiz-Benet
af5b835dc7 util/ipfsaddr: recover from panics parsing 2015-02-01 05:16:53 -08:00
Juan Batiz-Benet
29bf59dded bootstrap: use ipfsaddr for boostrap peers ⚠️
⚠️ this commit makes your current configs unusable, as the
default bootstrap peers. You may need to edit your config.

Go from:

```js
Bootstrap: [
  {
    "Address": "/ip4/104.131.131.82/tcp/4001",
    "PeerID": "QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
  }
]
```

To:
```js
Bootstrap: [
  "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
]
```
2015-02-01 05:16:52 -08:00
Juan Batiz-Benet
2e6be0b199 util/ipfsaddr: Multiaddr() + ID() 2015-02-01 05:16:52 -08:00
Mildred Ki'Lya
d221d55d85 HTTP: add handlers to allow object creation and modification 2015-01-31 20:47:34 +01:00
Jeromy
abb3c9c9c4 implement path type 2015-01-29 17:51:08 +00:00
Juan Batiz-Benet
eb79770683 p2p/net: cleaned up dial events
+ fixed race
2015-01-28 02:15:32 -08:00
Juan Batiz-Benet
b4af146fc8 p2p/net: better dial log.Event 2015-01-28 00:13:42 -08:00
Juan Batiz-Benet
9dac5bb7d3 p2p/net: dial log -> events
This commit turns all dial logs into log.Events.

Everything's great except for one problem:
The LoggableMap I'm using does not print out things
correctly. I gave it peer.IDs, and Multiaddrs
and both got logged as nothing `{}` (didn't even call
their String() methods!) So, for now, this function
encodes it when called... This is wrong and should be
fixed before being merged in. Otherwise we  will be
constantly encoding peer.IDs and Multiaddrs without
needing to.

@briantigerchow how do you suggest doing this?
I don't know my way around your Loggable.
2015-01-27 01:35:37 -08:00
Juan Batiz-Benet
45e4352c9c dropped down log.Errors 2015-01-26 19:13:44 -08:00
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