Commit Graph

21 Commits

Author SHA1 Message Date
Brian Tiger Chow
3663eef5ac refctor(bitswap/network) replace Network interface with Dialer interface 2014-11-15 02:10:53 -08:00
Brian Tiger Chow
154cf4af75 refactor(bitswap/network) rename -> BitSwapNetwork
remove 'adapter' concept
instead, describe the component as the bitswap network

it's still an adapter, but it's just not necessary to describe it as
such
2014-11-15 02:10:53 -08:00
Brian Tiger Chow
2bc82adfae style(bitswap) rename Adapter -> BitSwapNetwork for clarity 2014-11-15 02:10:52 -08:00
Brian Tiger Chow
23096de3c4 fix(net) pass contexts to dial peer 2014-11-05 10:04:20 -08:00
Brian Tiger Chow
c60d011764 fix(exchange) add context to DialPeer 2014-11-05 10:04:20 -08:00
Jeromy
d92db12460 lots of logging 2014-10-26 00:45:40 +00:00
Jeromy
ab7491f809 logging, logging, and some minor logging 2014-10-25 14:50:22 -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
a5a7d99860 meant to call net.DialPeer 2014-10-18 04:28:24 -07:00
Juan Batiz-Benet
1555ce7c48 bitswap dials peers
Important bugfix. Otherwise bitswap cannot message peers
the node has not connected to yet :(
2014-10-18 04:28:23 -07:00
Juan Batiz-Benet
338b037238 clean up and add inet.Network to bitswap
new Service interface
2014-10-10 20:43:04 -07:00
Brian Tiger Chow
e2a9c5de00 feat(net:service, routing) remove error return value 2014-09-24 23:35:36 -04:00
Brian Tiger Chow
0e494690b3 feat(bitswap:network) propagate errors up the stack
Rather than pushing errors back down to lower layers, propagate the
errors upward.

This commit adds a `ReceiveError` method to BitSwap's network receiver.

Still TODO: rm the error return value from:

    net.service.handler.HandleMessage

This is inspired by delegation patterns in found in the wild.
2014-09-24 23:35:36 -04:00
Brian Tiger Chow
39ad222da9 fix(bitswap) keep interface the same
changing the bitswap interace breaks tests and makes things a bit
difficult going forward. I think I have a temporary solution to replace
the async method.

this commit partially reverts changes from:

ec50703395098f75946f0bad01816cc54ab18a58

ec50703395
2014-09-22 04:06:18 -07:00
Juan Batiz-Benet
8112fae7b3 get bitswap working with dht
@perfmode using non-async version as apparently there's
a bug in async. will look into it.
2014-09-22 04:06:18 -07:00
Juan Batiz-Benet
52cefb16cd Routing uses context now
@perfmode boom
2014-09-22 04:06:18 -07:00
Brian Tiger Chow
a8a7caa088 refac(bitswap:testnet) give testnet its own package 2014-09-22 04:06:15 -07:00
Brian Tiger Chow
0c67019447 style(exch:bitswap) rename adapter, session, etc.
style(exch:bitswap) rename NetMessage adapter impl
2014-09-22 04:06:14 -07:00
Brian Tiger Chow
252be07ec5 refac(bitswap) let adapter be created with nil delegate
yay deleting code.
2014-09-22 04:06:14 -07:00
Brian Tiger Chow
ded1f8f5a8 fix(bitswap) compiler errors
didn't run tests after the refactor. apologies.
2014-09-22 04:06:13 -07:00
Brian Tiger Chow
fd086b9c48 refac(exchange) bitswap -> exchange/bitswap
Move go-ipfs/bitswap package to go-ipfs/exchange/bitswap

* Delineates the difference between the generic exchange interface and
  implementations (eg. BitSwap protocol)

  Thus, the bitswap protocol can be refined without having to overthink
  how future exchanges will work. Aspects common to BitSwap and other
  exchanges can be extracted out to the exchange package in piecemeal.

  Future exchange implementations can be placed in sibling packages next
  to exchange/bitswap. (eg. exchange/multilateral)
2014-09-22 04:06:13 -07:00