230 Commits

Author SHA1 Message Date
Jeromy
20687447c7 correct notifications for findProviders 2015-01-25 01:41:06 +00:00
Brian Tiger Chow
7429f19731 remove prefix logger 2015-01-24 00:30:56 -08:00
Jeromy
4f4246dba5 respect verbose option a bit, and show query events for other commands 2015-01-24 05:32:50 +00:00
Jeromy
2c2de4d93d use a notification type strategy for the query events 2015-01-24 03:56:45 +00:00
Jeromy
c1e316a764 really ugly impl of 'ipfs dht query' command 2015-01-24 03:56:45 +00:00
Juan Batiz-Benet
8d7a79816a dht: kick off all the queries wit every node in our rt
s/kademlia calls for makign sure to query all peers we
have in our routing table, not just those closest. this
helps ensure most queries resolve properly.
2015-01-23 02:08:29 -08:00
Brian Tiger Chow
dc586ab20f demote dht logs 2015-01-20 23:43:21 -08:00
Jeromy
c1596f4ab6 move dht record code into new package 2015-01-19 08:07:58 +00:00
Jeromy
71f6e2552f fix fuse mounting issues
this time, without loading the private key on every startup
2015-01-19 08:05:52 +00:00
Juan Batiz-Benet
38c3e88e61 addr-explosion mitigated adding
mitigated adding our own addresses where received
from peers

see #573
2015-01-16 11:38:46 -08:00
Jeromy
52de86ae4f remove low signal log messages 2015-01-15 22:01:33 +00:00
Jeromy
ac9e3a3377 rewrite as single line defer logs 2015-01-15 04:45:34 +00:00
Jeromy
074439d419 starting to move important events over to EventBegin/Done 2015-01-15 04:17:17 +00:00
Jeromy
f2669289fa Address PR comments and add in more user feedback 2015-01-10 07:27:48 +00:00
Juan Batiz-Benet
92c24c08ae dht: even more logging. 2015-01-05 04:55:02 -08:00
Juan Batiz-Benet
f47e5375a4 dht: some provider debug logging 2015-01-05 00:16:52 -08:00
Juan Batiz-Benet
719cd7c51c swap net2 -> net 2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
6bc26e01f3 net -> p2p/net
The net package is the next to move. It will be massaged
a bit still to fix the Network / "NetworkBackend" conflict.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
2b086634b2 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
Juan Batiz-Benet
fb661d5b31 routing: use debugerror 2015-01-02 08:36:32 -08:00
Jeromy
f57104bc6b Improve readability of getClosestPeers method.
Also remove older useless code.
2015-01-02 07:42:09 +00:00
Jeromy
2ec86a468d use query for getClosestPeers 2015-01-02 07:42:08 +00:00
Jeromy
0408e60ef6 some better logging and cleanup 2015-01-02 07:42:08 +00:00
Jeromy
72ac0bf268 a couple small fixes 2015-01-02 07:42:08 +00:00
Jeromy
0547622e00 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
Brian Tiger Chow
898ba6add9 wip with DHT
@whyrusleeping @jbenet this is a WIP with the DHT.

wip

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Conflicts:
	epictest/addcat_test.go
	exchange/bitswap/testnet/peernet.go
	exchange/bitswap/testutils.go
	routing/mock/centralized_server.go
	routing/mock/centralized_test.go
	routing/mock/interface.go

fix(routing/mock) fill in function definition
2014-12-24 09:31:19 -05:00
Juan Batiz-Benet
ed7ef491e6 dht: helpful debugging for no closer peers 2014-12-23 09:03:26 -08:00
Juan Batiz-Benet
3b37c43171 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
Jeromy
de0913f98f clean peerset constructor names 2014-12-17 23:44:46 -08:00
Jeromy
e6376f7479 refactor peerSet 2014-12-17 23:44:42 -08:00
Jeromy
d30fc0307a rewrite sendWantlistToProviders 2014-12-17 23:44:40 -08:00
Juan Batiz-Benet
fac6fe1e73 Integrated new network into ipfs 2014-12-16 14:47:29 -08:00
Jeromy
e10f49750a remove multilayered routing table from the DHT (for now) 2014-12-11 06:08:53 +00:00
Jeromy
3f3321c10b changes from PR 2014-12-11 05:42:05 +00:00
Jeromy
c459776cde rewrite FindProvidersAsync 2014-12-11 05:09:03 +00:00
Juan Batiz-Benet
52985f9012 dht: comment for asyncQueryBuffer 2014-12-08 21:55:51 -08:00
Juan Batiz-Benet
a718944be1 dht: FindPeersConnectedToPeer 2014-12-08 20:52:46 -08:00
Juan Batiz-Benet
3dd6ee1f86 dht: update to use net.LocalPeer 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
5e61ef67ac silence verbose output
for higher SnR at IPFS_LOGGING=info

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 15:07:33 -08:00
Brian Tiger Chow
88f4481c5e style: readability
@jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-05 20:56:28 -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
Jeromy
73621523f3 util keys need to be pointers for loggable 2014-12-05 20:53:33 +00:00
Jeromy
5aac9029d3 add readme for bitswap 2014-12-05 20:53:33 +00:00
Jeromy
461ed7c85f make bitswap sub-RPC's timeout (slowly for now) 2014-12-05 20:53:33 +00:00
Jeromy
6cb49c850d switch over to using sendMessage vs sendRequest 2014-12-05 20:53:32 +00:00
Jeromy
cac56033a9 switch DHT entries over to be records, test currently fail 2014-11-16 02:45:19 -08:00
Jeromy
ef134e0c99 log -> logf 2014-11-12 10:39:11 -08:00