npm install --save ipfs-bitswap, it can also be used directly in the browser.
The source is available for download from GitHub. Alternatively, you can install using npm:
$ npm install --save ipfs-bitswap
You can then
require() ipfs-bitswap as normal:
const ipfsBitswap = require('ipfs-bitswap')
ipfs-bitswap should work in any ECMAScript 2018 environment out of the box.
The portable versions of
index.min.js, are included in the
ipfs-bitswap can also be found on unpkg.com under
Find providers given a
Find the providers of a given
cid and connect to them.
Tell the network we can provide content for the passed CID
Connects to another peer
The task merger that is used by default. Assumes that new tasks do not add any information over existing tasks, and doesn't try to merge.
Queue of requests to be processed by the engine. The requests from each peer are added to the peer's queue, sorted by priority. Tasks are popped in priority order from the best peer - see popTasks() for more details.
Queue of tasks for a particular peer, sorted by priority.
Queue of pending tasks for a particular peer, sorted by priority.
SortedMap is a Map whose iterator order can be defined by the user
Is equal for Maps of BitswapMessageEntry or Blocks