Commit Graph

17 Commits

Author SHA1 Message Date
Brian Tiger Chow
42dfc50250 docs(bitswap/message) BitSwapMessage interface 2014-10-27 22:43:54 -07:00
Brian Tiger Chow
edf99f5e20 fix(bitswap) preserve ordering in bitswap message 2014-10-27 22:43:54 -07:00
Brian Tiger Chow
91a31a3e7d test(bitswap/message) no duplicates 2014-10-27 21:58:21 -07:00
Brian Tiger Chow
cebeff43b9 style(bitswap/message) rename method -> AddBlock
to emphasize idempotence
2014-10-27 21:58:21 -07:00
Brian Tiger Chow
caedb64697 fix(bitswap/message) impl with map to ensure no duplicate blocks
comes at the cost of O(n) Blocks() method.
2014-10-27 21:58:21 -07:00
Brian Tiger Chow
2c4fefb9d6 style(bitswap/message) rename struct
so there's one less name to think about
2014-10-27 21:58:20 -07:00
Brian Tiger Chow
f94d6a37b6 refactor(bitswap/message) use map to prevent duplicate entries
A nice invariant for bitswap sessions:

        Senders and receivers can trust that messages do not contain
        duplicate blocks or duplicate keys. Backing the message with a
        map enforces this invariant.

        This comes at the cost of O(n) getters.
2014-10-27 21:58:20 -07:00
Brian Tiger Chow
842b910853 style(bitswap/message) rename AppendWanted -> AddWanted
implementation will be patched to ensure bitswap messages cannot contain
duplicate blocks or keys
2014-10-27 21:58:20 -07:00
Brian Tiger Chow
80b573425b refactor(bitswap) mv proto PBMessage -> Message 2014-10-22 21:49:46 -07:00
Brian Tiger Chow
d3ac9ceee3 misc(exch/bitswap) add TODOs 2014-10-22 15:54:18 -07:00
Brian Tiger Chow
8823f46248 fix(exch/bs/pb) rename proto package -> bitswap_message_pb 2014-10-22 15:54:18 -07:00
Brian Tiger Chow
15605fb18f refactor(exchange/bitswap) move proto to internal pb package 2014-10-22 15:54:17 -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
Jeromy
6e0cfb3273 removed error from return type of blocks.NewBlock() 2014-10-07 20:46:01 +00:00
Brian Tiger Chow
315e121ef9 feat(bitswap:message) implement FromNet 2014-09-22 04:06:16 -07:00
Brian Tiger Chow
800af9ca3a fix(bitswap:message) don't use proto internally 2014-09-22 04:06:15 -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