Skip to content

Commit 607ae9d

Browse files
committed
docs(bitswap): update to current
Several aspects of Bitswap are out of data (no 1.1, old repo) -- this fixes and brings things up to current
1 parent 42af694 commit 607ae9d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

bitswap/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The wire format for Bitswap is simply a stream of Bitswap messages. The followin
7878
message Message {
7979
message Wantlist {
8080
message Entry {
81-
optional string block = 1; // the block key
81+
optional bytes block = 1; // the block key
8282
optional int32 priority = 2; // the priority (normalized). default to 1
8383
optional bool cancel = 3; // whether this revokes an entry
8484
}
@@ -87,8 +87,14 @@ message Message {
8787
optional bool full = 2; // whether this is the full wantlist. default to false
8888
}
8989
90-
optional Wantlist wantlist = 1;
91-
repeated bytes blocks = 2;
90+
message Block {
91+
bytes prefix = 1; // CID prefix (cid version, multicodec and multihash prefix (type + length)
92+
bytes data = 2;
93+
}
94+
95+
Wantlist wantlist = 1;
96+
optional repeated bytes blocks = 2; // used to send Blocks in bitswap 1.0.0
97+
repeated Block payload = 3; // used to send Blocks in bitswap 1.1.0
9298
}
9399
```
94100

@@ -200,5 +206,5 @@ bs.getBlock(multihash, (err, block) => {
200206
201207
# Implementations
202208

203-
- <https://github.com/ipfs/go-ipfs/tree/master/exchange/bitswap>
209+
- <https://github.com/ipfs/go-bitswap>
204210
- <https://github.com/ipfs/js-ipfs-bitswap>

0 commit comments

Comments
 (0)