Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #35 from ipfs/jsipfs
Browse files Browse the repository at this point in the history
Getting jsipfs out the door
  • Loading branch information
daviddias committed Dec 10, 2015
2 parents d7e6fa5 + 35eb22d commit 88cc315
Show file tree
Hide file tree
Showing 62 changed files with 902 additions and 4 deletions.
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
**/node_modules/
**/*.log

# Logs
logs
*.log

coverage

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

build

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: node_js
node_js:
- "4"
- "5"

branches:
only:
- master

before_install:
- npm i -g npm
# Workaround for a permissions issue with Travis virtual machine images
script:
- npm test
58 changes: 54 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
js-ipfs
=========
=======

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) ![Build Status](https://travis-ci.org/diasdavid/js-ipfs.svg?style=flat-square)](https://travis-ci.org/diasdavid/js-ipfs) ![](https://img.shields.io/badge/coverage-%3F-yellow.svg?style=flat-square) [![Dependency Status](https://david-dm.org/diasdavid/js-ipfs.svg?style=flat-square)](https://david-dm.org/diasdavid/js-ipfs) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)

> IPFS JavaScript implementation entry point and roadmap
# Description

This repo will contain the entry point for the JavaScript implementation of IPFS spec, similar to [go-ipfs](https://github.com/ipfs/go-ipfs). Right now, it holds the roadmap for the development of modules for js-ipfs, as well as their current state.
This repo will contain the entry point for the JavaScript implementation of IPFS spec, similar to [go-ipfs](https://github.com/ipfs/go-ipfs).

We are building js-ipfs because it will inform how go-ipfs works, separate concerns, and allow a complete in-browser-tab implementation with no install friction. Most of the work for IPFS does happen elsewhere, but this is an equally important part of our roadmap to lead to a permanent, IPFSed web.

Expand All @@ -21,17 +23,65 @@ IPFS implementation in JavaScript is a work in progress. As such, there's a few

# Usage

> **Not ready for prime time yet**
> **Disclamer: Currently, js-ipfs is not a full IPFS node, it delegates all of its operations to a IPFS node available in the network, see "Getting jsipfs ready" below for more details.
### Installation

```bash
$ npm i ipfs --save
```

```JavaScript
var IPFS = require('ipfs')

var node = new IPFS()
```

### Command line tool

In order to use js-ipfs as a CLI, you must install it with the -g flag.

```bash
$ npm i ipfs -g
```

The cli is availble through `jsipfs` in your terminal

### API


# Project structure

```
┌───┐ ┌───────────────┐ ┌──────────────┐
│CLI│───▶│ HTTP API ├───▶│IPFS Node Impl│
└───┘ └───────────────┘ └──────────────┘
△ △
└──────────┬─────────┘
┌─────┐
│Tests│
└─────┘
```

# Roadmap for the full IPFS implementation in JavaScript

# Roadmap

- **Network layer**
- The network layer of IPFS is now known as libp2p, follow https://github.com/diasdavid/js-libp2p
- **Exchange**
- [ ] [js-bitswap](https://github.com/diasdavid/js-bitswap). [![](https://img.shields.io/badge/discuss--blue.svg?style=flat-square)](https://github.com/ipfs/js-ipfs/issues/17)![](https://img.shields.io/badge/status-has%20not%20started%20yet-brown.svg?style=flat-square)
- [ ] [js-ipfs-repo](https://github.com/ipfs/js-ipfs-repo)
- [ ] [keys](https://github.com/ipfs/js-ipfs-repo/issues/4)
- [ ] [version](https://github.com/ipfs/js-ipfs-repo/issues/5)
- [ ] [datastore](https://github.com/ipfs/js-ipfs-repo/issues/6)
- [ ] [config](https://github.com/ipfs/js-ipfs-repo/issues/7)
- [ ] [logs](https://github.com/ipfs/js-ipfs-repo/issues/8)
- [ ] [locks](https://github.com/ipfs/js-ipfs-repo/issues/9)
- [x] MerkleDAG node implementation (needs IPLD).
- [x] [js-ipld](https://github.com/diasdavid/js-ipld) ![](https://img.shields.io/badge/status-in%20progress-yellow.svg?style=flat-square)
- [x] [js-merkledag-store](https://github.com/diasdavid/js-merkledag-store) ![](https://img.shields.io/badge/status-in%20progress-yellow.svg?style=flat-square)
- [ ] js-ipfs [follow the roadmap](https://github.com/ipfs/pm/blob/js-ipfs/roadmap/ROADMAP.js-ipfs.md)
- [**Spec**](https://github.com/ipfs/specs/tree/master/protocol/network) ![](https://img.shields.io/badge/status-in%20progress-yellow.svg?style=flat-square)

### status badges
Expand Down
Binary file added graphs/arch.monopic
Binary file not shown.
9 changes: 9 additions & 0 deletions graphs/arch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
┌───┐ ┌───────────────┐ ┌──────────────┐
│CLI│───▶│ HTTP API ├───▶│IPFS Node Impl│
└───┘ └───────────────┘ └──────────────┘
△ △
└──────────┬─────────┘
┌─────┐
│Tests│
└─────┘
48 changes: 48 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "js-ipfs",
"version": "0.0.1",
"description": "JavaScript implementation of the IPFS specification",
"bin": {
"jsipfs": "src/cli/bin.js"
},
"main": "src/index.js",
"scripts": {
"lint": "standard",
"coverage": "istanbul cover --print both -- _mocha tests/*-test.js",
"test": "mocha tests/*-test.js"
},
"pre-commit": [
"lint"
],
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/js-ipfs.git"
},
"keywords": [
"IPFS"
],
"author": "David Dias <daviddias@ipfs.io>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ipfs/js-ipfs/issues"
},
"homepage": "https://github.com/ipfs/js-ipfs#readme",
"devDependencies": {
"chai": "^3.4.1",
"ipfsd-ctl": "^0.6.1",
"istanbul": "^0.4.1",
"mocha": "^2.3.4",
"ncp": "^2.0.0",
"pre-commit": "^1.1.2",
"rimraf": "^2.4.4",
"standard": "^5.3.1"
},
"dependencies": {
"hapi": "^11.1.2",
"ipfs-api": "^2.7.0",
"ipfs-repo": "^0.1.0",
"peer-id": "^0.4.0",
"peer-info": "^0.4.0",
"ronin": "^0.3.11"
}
}
11 changes: 11 additions & 0 deletions src/cli/bin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /usr/bin/env node

var ronin = require('ronin')

var cli = ronin(__dirname)

cli.run()

// cli.autoupdate(function () {
// cli.run()
// })
7 changes: 7 additions & 0 deletions src/cli/commands/add.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
7 changes: 7 additions & 0 deletions src/cli/commands/cat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
7 changes: 7 additions & 0 deletions src/cli/commands/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
7 changes: 7 additions & 0 deletions src/cli/commands/daemon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
7 changes: 7 additions & 0 deletions src/cli/commands/dns.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
7 changes: 7 additions & 0 deletions src/cli/commands/get.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
7 changes: 7 additions & 0 deletions src/cli/commands/id.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
31 changes: 31 additions & 0 deletions src/cli/commands/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var Command = require('ronin').Command
// var help = require('../src/help-menu.js')

module.exports = Command.extend({
desc: 'Initialize ipfs local configuration',

// help: help,

options: {
bits: {
type: 'number',
alias: 'b',
default: '2048',
desc: 'Number of bits to use in the generated RSA private key (defaults to 2048)'
},
force: {
alias: 'f',
type: 'boolean',
desc: 'Overwrite existing config (if it exists)'
},
'empty-repo': {
alias: 'e',
type: 'boolean',
desc: 'Don\'t add and pin help files to the local storage'
}
},

run: function (name) {
console.log('NA - https://github.com/ipfs/js-ipfs/tree/jsipfs#getting-jsipfs-ready')
}
})
7 changes: 7 additions & 0 deletions src/cli/commands/ls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
7 changes: 7 additions & 0 deletions src/cli/commands/mount.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
7 changes: 7 additions & 0 deletions src/cli/commands/ping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
7 changes: 7 additions & 0 deletions src/cli/commands/refs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
12 changes: 12 additions & 0 deletions src/cli/commands/repo/gc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var Command = require('ronin').Command
// var IPFS = require('../../ipfs-core')

module.exports = Command.extend({
desc: '',

options: {
},

run: function (name) {
}
})
12 changes: 12 additions & 0 deletions src/cli/commands/repo/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var Command = require('ronin').Command
// var IPFS = require('../../ipfs-core')

module.exports = Command.extend({
desc: '',

options: {
},

run: function (name) {
}
})
19 changes: 19 additions & 0 deletions src/cli/commands/repo/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var Command = require('ronin').Command
var IPFS = require('../../../ipfs-core')

module.exports = Command.extend({
desc: 'Shows IPFS repo version information',

options: {
},

run: function (name) {
var node = new IPFS()
node.repo.version(function (err, version) {
if (err) {
return console.error(err)
}
console.log(version)
})
}
})
7 changes: 7 additions & 0 deletions src/cli/commands/resolve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
7 changes: 7 additions & 0 deletions src/cli/commands/update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Command = require('ronin').Command

module.exports = Command.extend({
desc: '',

run: function (name) {}
})
Loading

0 comments on commit 88cc315

Please sign in to comment.