You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: BITSWAP.md
+9-7
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,9 @@ Bitswap is a data exchange protocol for sending and receiving content addressed
27
27
28
28
## Introduction
29
29
30
-
Bitswap is a message-based protocol, as opposed to request-response. All messages contain wantlists, and/or blocks. Upon receiving a wantlist, a Bitswap server should eventually process and respond to the requester with either information about the block or the block itself. Upon receiving blocks, the client should send a `Cancel` notification to peers that have asked for the data, signifying that the client no longer wants the block.
30
+
Bitswap is a message-based protocol, as opposed to request-response. All messages contain wantlists, and/or blocks.
31
+
Upon receiving a wantlist, a Bitswap server should eventually process and respond to the requester with either information about the block or the block itself.
32
+
Upon receiving blocks, the client should send a `Cancel` notification to peers that have asked for the data, signifying that the client no longer wants the block.
31
33
32
34
Bitswap aims to be a simple protocol, so that implementations can balance aspects such as throughput, latency, fairness, memory usage, etc. for their specific requirements.
33
35
@@ -53,7 +55,7 @@ Given that a client C wants to fetch data from some server S:
53
55
1. C may either send a complete wantlist, or an update to an outstanding wantlist
54
56
2. C may reuse this stream to send new wants
55
57
2. S sends back blocks on a stream `s_receive`. S may reuse this stream to send back subsequent responses.
56
-
1. S should respect the relative priority of wantlist requests from C, with wants that have higher `priority` values being responded to first.
58
+
1. S should respect the relative priority of wantlist requests from C, with wants that have higher `priority` values being responded to first.
57
59
3. When C no longer needs a block it previously asked for, it should send a `Cancel` message for that block to all peers from which it has not received a response about that block
58
60
59
61
### Bitswap 1.0.0: Message
@@ -88,7 +90,7 @@ message Message {
88
90
89
91
All protocol messages sent over a stream are prefixed with the message length in
90
92
bytes, encoded as an unsigned variable length integer as defined by the
0 commit comments