Skip to content

Commit

Permalink
feat: add support for Peer and Content Routing (DHT)
Browse files Browse the repository at this point in the history
* feat: Peer and Content Routing Support (DHT) - first round
* feat: support for DHT and without DHT at the same time
* refactor(tests): make tests independent without require global set up steps
* feat: move libp2p just to the network, take libp2p as a whole and not pieces
* docs: Update README Documentation
* feat: factor notifications out
* fix: getMany call
* feat: add id to loggers
* feat(engine): improve message sending
* test: skip webworker tests
  • Loading branch information
dignifiedquire authored and daviddias committed Aug 25, 2017
1 parent dc143e8 commit 3a6b8a1
Show file tree
Hide file tree
Showing 44 changed files with 1,866 additions and 1,361 deletions.
31 changes: 31 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2
jobs:
build:
working_directory: ~/js-ipfs-bitswap
docker:
- image: circleci/node:6-browsers
environment:
CHROME_BIN: "/usr/bin/google-chrome"
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: install-deps
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: lint
command: npm run lint
- run:
name: test:node
command: npm run test:node
- run:
name: test:browser
command: npm run test:browser
- run:
name: coverage
command: npm run coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# While testing new npm
package-lock.json
yarn.lock

# Logs
logs
Expand Down
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@
> npm install ipfs-bitswap
```

### Use in Node.js

```js
const Bitswap = require('ipfs-bitswap')
```

### Use in a browser with browserify, webpack or any other bundler
### Use in Node.js or in the browser with browserify, webpack or any other bundler

```js
const Bitswap = require('ipfs-bitswap')
Expand All @@ -56,10 +50,6 @@ Loading this module through a script tag will make the `IpfsBitswap` object avai
<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
Expand All @@ -73,24 +63,22 @@ See https://ipfs.github.io/js-ipfs-bitswap
```sh
» 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
├── decision-engine
│   ├── index.js
│   └── ledger.js
├── index.js
└── types
├── message # (Type) message that is put in the wire
├── 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
└── wantlist # (Type) track wanted blocks
├── entry.js
└── index.js
```
Expand Down
14 changes: 0 additions & 14 deletions circle.yml

This file was deleted.

32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
"description": "Node.js implementation of the Bitswap data exchange protocol used by IPFS",
"main": "src/index.js",
"browser": {
"./test/libp2p-bundle": false
"./test/utils/create-libp2p-node": false,
"./test/utils/create-temp-repo-nodejs.js": "./test/utils/create-temp-repo-browser.js"
},
"scripts": {
"test": "aegir-test",
"test:browser": "aegir-test browser",
"test:node": "aegir-test node",
"lint": "aegir-lint",
"release": "aegir-release --docs",
"release-minor": "aegir-release --type minor --docs",
"release-major": "aegir-release --type major --docs",
"test": "aegir test --target node --target browser",
"test:browser": "aegir test --target browser",
"test:node": "aegir test --target node",
"lint": "aegir lint",
"release": "aegir release",
"release-minor": "aegir release --type minor",
"release-major": "aegir release --type major",
"bench": "node benchmarks/index",
"build": "aegir-build",
"coverage": "aegir-coverage",
"coverage-publish": "aegir-coverage publish",
"docs": "aegir-docs"
"build": "aegir build",
"coverage": "aegir coverage -u",
"docs": "aegir docs"
},
"repository": {
"type": "git",
Expand All @@ -37,12 +37,13 @@
},
"homepage": "https://github.com/ipfs/js-ipfs-bitswap#readme",
"devDependencies": {
"aegir": "^11.0.2",
"aegir": "ipfs/aegir",
"benchmark": "^2.1.4",
"chai": "^4.1.0",
"chai": "^4.1.1",
"dirty-chai": "^2.0.1",
"ipfs-repo": "~0.17.0",
"libp2p": "^0.11.0",
"libp2p-kad-dht": "^0.4.1",
"libp2p-multiplex": "^0.4.4",
"libp2p-secio": "^0.7.1",
"libp2p-tcp": "^0.10.2",
Expand All @@ -58,7 +59,7 @@
"dependencies": {
"async": "^2.5.0",
"cids": "~0.5.1",
"debug": "^2.6.8",
"debug": "^3.0.0",
"ipfs-block": "~0.6.0",
"lodash.debounce": "^4.0.8",
"lodash.find": "^4.6.0",
Expand All @@ -75,6 +76,7 @@
"pull-length-prefixed": "^1.3.0",
"pull-pushable": "^2.1.1",
"pull-stream": "^3.6.0",
"safe-buffer": "^5.1.1",
"varint-decoder": "^0.1.1"
},
"contributors": [
Expand Down
194 changes: 0 additions & 194 deletions src/components/network/index.js

This file was deleted.

Loading

0 comments on commit 3a6b8a1

Please sign in to comment.