New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support bitswap 1.1.0 and bitswap 1.0.0 using CID #76
Closed
Closed
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4384208
add new protobuf
daviddias b15fb89
docs: move API docs to readme
daviddias effdbe2
fix: string is not the same as bytes in JS
daviddias ae95bbe
feat: update wantlist to support cid
daviddias 84abea9
wip: bitswap message
daviddias 99d64dd
feat: cid support in Bitswap message
daviddias cebd4b2
docs: add some notes to the readme about what is the code structure
daviddias 3189db6
test: cidV1 test in wantlist
daviddias 8758da6
feat: update wantmanager msg-queue to use cid
daviddias fd60a9c
feat: wantmanager uses cid
daviddias e7835cb
chore: refactor structure to make it more explicit what is which thin…
daviddias de99976
docs: add architecture graph
daviddias 8e3b7a7
cr: apply CR
daviddias d15910d
feat: priority-queue done
daviddias c17f410
feat: PeerRequestQueue with CID support
daviddias 89d922e
feat: upgrade ledger to use CID
daviddias 65dbd28
feat: decision engine migration to CID (just missing one test)
daviddias a8da40a
fix engine tests
dignifiedquire 0dc3b60
use .multihash intead of toV0
dignifiedquire 32e8997
feat: update network to understand CID
daviddias beff8d1
upgrade message to support bitswap 1.0.0 and 1.1.0 simultaneously, also
daviddias 3dc3493
feat: upgrade network component to support bitswap 1.0.0 and bitwap 1…
daviddias e892863
feat: update bitswap own API
daviddias File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
'use strict' | ||
|
||
module.exports = `package bitswap.message.pb; | ||
// from: https://github.com/ipfs/go-ipfs/blob/master/exchange/bitswap/message/pb/message.proto | ||
|
||
message Message { | ||
module.exports = ` | ||
message Message { | ||
message Wantlist { | ||
message Entry { | ||
// changed from string to bytes, | ||
// because it makes a difference | ||
// in JavaScript | ||
optional bytes block = 1; // the block cid (cidV0 in bitswap 1.0.0, cidV1 in bitswap 1.1.0) | ||
optional int32 priority = 2; // the priority (normalized). default to 1 | ||
optional bool cancel = 3; // whether this revokes an entry | ||
} | ||
|
||
message Wantlist { | ||
repeated Entry entries = 1; // a list of wantlist entries | ||
optional bool full = 2; // whether this is the full wantlist. default to false | ||
} | ||
|
||
message Entry { | ||
optional bytes block = 1; // the block key | ||
optional int32 priority = 2; // the priority (normalized). default to 1 | ||
optional bool cancel = 3; // whether this revokes an entry | ||
message Block { | ||
optional bytes prefix = 1; // CID prefix (cid version, multicodec and multihash prefix (type + length) | ||
optional bytes data = 2; | ||
} | ||
|
||
repeated Entry entries = 1; // a list of wantlist entries | ||
optional bool full = 2; // whether this is the full wantlist. default to false | ||
optional Wantlist wantlist = 1; | ||
repeated bytes blocks = 2; // used to send Blocks in bitswap 1.0.0 | ||
repeated Block payload = 3; // used to send Blocks in bitswap 1.1.0 | ||
} | ||
|
||
optional Wantlist wantlist = 1; | ||
repeated bytes blocks = 2; | ||
}` | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not good, you shouldn't use
||
if the input is a number.