JavaScript implementation of the Bitswap 'data exchange' protocol used by IPFS
> npm install ipfs-bitswap
const Bitswap = require('ipfs-bitswap')
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>
See https://ipfs.github.io/js-ipfs-bitswap
» tree src
src
├── constants.js
├── decision-engine
│ ├── index.js
│ └── ledger.js
├── index.js
├── network.js # Handles peerSet and open new conns
├── notifications.js # Handles tracking of incomning blocks and wants/unwants.
├─── want-manager # Keeps track of all blocks the peer (self) wants
│ ├── index.js
│ └── msg-queue.js # Messages to send queue, one per peer
└─── 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
Feel free to join in. All welcome. Open an issue!
This repository falls under the IPFS Code of Conduct.