Conversation
|
This is ready for review, speed is now even a bit better than on #83 with some more optimizations. |
|
For this to be merged all the way in, we want to have interop bitswap tests in js-ipfs API, which creates a tree of dependencies
|
daviddias
left a comment
There was a problem hiding this comment.
LGTM, we just need to ship the release train 🚂
README.md
Outdated
| #### `putStream()` | ||
|
|
||
| Returns a duplex `pull-stream` that emits an object `{key: Multihash}` for every written block when it was stored. | ||
| Objects passed into here should be of the form `{data: Buffer, key: Multihash}` |
There was a problem hiding this comment.
It is no long data: Buffer, key Multihash, instead it is block: block, cid: cid
README.md
Outdated
|
|
||
| #### `put(blockAndCid, callback)` | ||
|
|
||
| - `blockAndKey: {data: Buffer, cid: CID}` |
| return _.map(_.range(n * blockFactor), () => { | ||
| return new Block(crypto.randomBytes(n * blockFactor)) | ||
| }) | ||
| } |
package.json
Outdated
| "lodash.pullallwith": "^4.7.0", | ||
| "lodash.uniqwith": "^4.5.0", | ||
| "lodash.values": "^4.3.0", | ||
| "multihashes": "^0.3.1", |
| .map((k) => l.wantlistContains(k)) | ||
| .filter(Boolean) | ||
| .forEach((e) => { | ||
| // this.peerRequestQueue.push(e, l.partner) |
There was a problem hiding this comment.
I believe peerRequestQueue are no longer a thing, right?
There was a problem hiding this comment.
yep that's an artifact when I ripped it out :)
There was a problem hiding this comment.
Did you ripped out PeerRequestQueue and MessageQueue, or just PeerRequestQueue? From your comment in #88 (comment), it sounds like you have removed both, but I believe only PeerRequestQueue is gone.
There was a problem hiding this comment.
PeerRequestQueue is gone, but as mentioned in #88 if you look at the code for MsgQueue it's not a queue anymore, simply a buffer to coalesce messages. https://github.com/ipfs/js-ipfs-bitswap/blob/sq/src/components/want-manager/msg-queue.js
There was a problem hiding this comment.
Which is important to keep on a per peer basis, as we send messages out on a per peer basis.
There was a problem hiding this comment.
I need to update the graph :)
There was a problem hiding this comment.
also feel free to suggest a better name :)
| _onPeerMux (peerInfo) { | ||
| if (!this._running) { | ||
| return | ||
| } |
|
@diasdavid linking this together with the other repo PR, and the newly created interop tests and this adjustment in js-ipfs diff --git a/src/core/components/go-online.js b/src/core/components/go-online.js
index 793a026..28894f7 100644
--- a/src/core/components/go-online.js
+++ b/src/core/components/go-online.js
@@ -14,7 +14,6 @@ module.exports = function goOnline (self) {
}
self._bitswap = new Bitswap(
- self._libp2pNode.peerInfo,
self._libp2pNode,
self._repo.blockstore,
self._libp2pNode.peerBook
(END)I can confirm we can transfer data between go and js using bitswap 1.1.0 🎉 |
AWESOME :D Thank you :) |
- reduce base58 encoding - use utf8 encoding instead of hex - extract benchmarks from tests - group multiple blocks into single messages
|
🎉 |
This is the perf improvement PR #83 and with the cid changes from #76 rebased onto them. All tests are passing and benchmarks are close to what I had before.