Package Exports
- ipfs-bitswap
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ipfs-bitswap) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ipfs-bitswap
Node.js implementation of the Bitswap 'data exchange' protocol used by IPFS
Table of Contents
Install
npm
> npm install ipfs-bitswap
Use in Node.js
const Bitswap = require('ipfs-bitswap')
Use in a browser with browserify, webpack or any other bundler
const Bitswap = require('ipfs-bitswap')
Use in a browser using a script tag
Loading this module through a script tag will make the IpfsBitswap
object available in the global namespace.
<script src="https://unpkg.com/ipfs-bitswap/dist/index.min.js"></script>
<!-- OR -->
<script src="https://unpkg.com/ipfs-bitswap/dist/index.js"></script>
Usage
See https://ipfs.github.io/js-ipfs-bitswap
API
See https://ipfs.github.io/js-ipfs-bitswap
Development
Structure
» tree src
src
├── components
│ ├── decision
│ │ ├── engine.js
│ │ ├── index.js
│ │ └── ledger.js
│ ├── network # Handles peerSet and open new conns
│ │ └── index.js
│ └── want-manager # Keeps track of all blocks the peer wants (not the others which it is connected)
│ ├── index.js
│ └── msg-queue.js # Messages to send queue, one per peer
├── constants.js
├── index.js
└── types
├── message # (Type) message that is put in the wire
│ ├── entry.js
│ ├── index.js
│ └── message.proto.js
└── wantlist # (Type) track wanted blocks
├── entry.js
└── index.js
Contribute
Feel free to join in. All welcome. Open an issue!
This repository falls under the IPFS Code of Conduct.