Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peer and Content Routing (DHT) #142

Merged
merged 4 commits into from
Aug 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A though. I've been the one documenting pretty much the whole Bitswap. I do like to document things and make them easier for other people to use and contribute (its like teaching), however, it is kind of hard to when I'm mostly the one pushing the docs, graphs and writing other ideas down. It would be very helpful when the way that things are designed change (or created), to get the contributor to document as well.

This tree is missing the new notifications.js and I'm sure a lot of other thoughts that went into this. Could you try to capture all of them in writing to the best of your ability so that future selfs or contributors don't have to hit a wall? Thank you :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dignifiedquire never received an acknowledgment here. Could you share your feedback?

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