[ ](https://travis-ci.org/ipfs/js-ipfs)
IPFS JavaScript implementation entry point and roadmap
This repo will contain the entry point for the JavaScript implementation of IPFS spec, similar to 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.
IPFS implementation in JavaScript is a work in progress. As such, there's a few things you can do right now to help out:
- Go through the modules below and check out existing issues. This would be especially useful for modules in active development. Some knowledge of IPFS may be required, as well as the infrasture behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically.
- Perform code reviews. Most of this has been developed by @diasdavid, which means that more eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
- Take a look at go-ipfs and some of the planning repositories or issues: for instance, the libp2p spec here. Contributions here that would be most helpful are top-level comments about how it should look based on our understanding. Again, the more eyes the better.
- Add tests. There can never be enough tests.
- Contribute to the FAQ repository with any questions you have about IPFS or any of the relevant technology. A good example would be asking, 'What is a merkledag tree?'. If you don't know a term, odds are, someone else doesn't either. Eventually, we should have a good understanding of where we need to improve communications and teaching together to make IPFS and IPN better.
**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.
$ npm i ipfs --save
var IPFS = require('ipfs')
var node = new IPFS()
In order to use js-ipfs as a CLI, you must install it with the -g flag.
$ npm install ipfs --global
The cli is availble through jsipfs
in your terminal
┌───┐ ┌───────────────┐ ┌──────────────┐
│CLI│───▶│ HTTP API ├───▶│IPFS Core Impl│
└───┘ └───────────────┘ └──────────────┘
△ △ △
└──────────────└──────────┬─────────┘
│
┌─────┐
│Tests│
└─────┘
IPFS Core is divided into separate subsystems, each of them exist in their own repo/module. The dependencies between each subsystem is assured by injection at the IPFS Core level. IPFS Core exposes an API, defined by the IPFS API spec. libp2p is the networking layer used by IPFS, but out of scope in IPFS core, follow that project here
▶ ┌───────────────────────────────────────────────────────────────────────────────┐
│ IPFS Core │
│ └───────────────────────────────────────────────────────────────────────────────┘
│
│ │
│
│ ┌──────────────┬──────────────┼────────────┬─────────────────┐
│ │ │ │ │
│ │ │ │ │ │
▼ │ ▼ │ ▼
│ ┌──────────────────┐ │ ┌──────────────────┐ │ ┌──────────────────┐
│ │ │ │ │ │ │ │
│ │ Block Service │ │ │ DAG Service │ │ │ IPFS Repo │
│ │ │ │ │ │ │ │
│ └──────────────────┘ │ └──────────────────┘ │ └──────────────────┘
│ │ │ │
IPFS Core │ ▼ │ ┌────┴────┐ │
┌────────┐ │ ▼ ▼ │
│ │ Block │ │ ┌────────┐┌────────┐ │
└────────┘ │ │DAG Node││DAG Link│ │
│ │ └────────┘└────────┘ │
┌──────────────────┐ │ │ ┌──────────────────┐
│ │ │ │ │ │ │
│ Bitswap │◀────┤ ├──────▶│ Importer │
│ │ │ │ │ │ │
└──────────────────┘ │ │ └──────────────────┘
│ │ │ │
│ │ ┌────┴────┐
│ │ │ ▼ ▼
│ │ ┌────────┐┌────────┐
│ ┌──────────────────┐ │ │ │ layout ││chunker │
│ │ │ ┌────────────┘ └────────┘└────────┘
│ │ Files │◀────┘ │
│ │ │
│ └──────────────────┘ │
▶ │
▼
┌───────────────────────────────────────────────────────────────────────────────┐
│ │
│ │
│ │
│ libp2p │
│ │
│ │
└───────────────────────────────────────────────────────────────────────────────┘
IPFS Core is the entry point module for IPFS. It exposes an interface defined on IPFS Specs.
Block Service uses IPFS Repo (local storage) and Bitswap (network storage) to store and fetch blocks. A block is a serialized MerkleDAG node.
DAG Service offers some graph language semantics on top of the MerkleDAG, composed by DAG Nodes (which can have DAG Links). It uses the Block Service as its storage and discovery service.
IPFS Repo is storage driver of IPFS, follows the IPFS Repo Spec and supports the storage of different types of files.
Bitswap is the exchange protocol used by IPFS to 'trade' blocks with other IPFS nodes.
Files is the API that lets us work with IPFS objects (DAG Nodes) as if they were Unix Files.
Importer are a set of layouts (e.g. UnixFS) and chunkers (e.g: fixed-size, rabin, etc) that convert data to a MerkleDAG representation inside IPFS.
This is a WIP, behare of the Dragons!
Name | Spec | Disc |
---|---|---|
data importing | ipfs/specs#57 | ipfs#41 |
repo | https://github.com/ipfs/specs/tree/master/repo | ipfs#51 |
network layer | https://github.com/ipfs/specs/tree/master/libp2p | https://github.com/diasdavid/js-libp2p/issues |
bitswap | ipfs#51 | ipfs#51 |
pin | ipfs#59 | |
files | ipfs#60 | |
daemon | ipfs#57 | |
object | ipfs#58 | |
block | ipfs#50 | |
bootstrap | ipfs#46 | |
init | ipfs#42 |
- core
- version
- daemon
- id
- block
- get
- put
- stat
- object - Basic manipulation of the DAG
- data
- get
- links
- new
- patch
- put
- stat
- refs - Listing of references. (alking around the graph)
- local
- repo
- init
- stat
- gc
- pin
- add
- ls
- rm
- log
- level
- tail
- extensions
- name (IPNS)
- publish
- resolve
- dns
- resolve
- tar
- add
- cat
- tour
- list
- next
- restart
- files
- add
- cat
- get
- stat - Statistics about everything
- bw
- mount
- bootstrap
- add
- list
- rm
- bitswap
- stat
- unwant
- wantlist
- name (IPNS)
- tooling
- commands
- update
- init - sugar around ipfs repo init
- config
- edit
- replace
- show
- network (bubbles up from libp2p)
- ping
- dht
- findpeer
- findprovs
- get
- put
- query
- swarm
- addrs
- addrs local
- connect
- disconnect
- filters
- filters add
- filters rm
- peers
- records (IPRS)
- put
- get