Commit dae6189b authored by David Dias's avatar David Dias Committed by Steven Allen

docs: README refresh, add cli-http-api-core diagram

License: MIT
Signed-off-by: default avatardiasdavid <daviddias.p@gmail.com>
parent 4fd8a6ef
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
[![GoDoc](https://godoc.org/github.com/ipfs/go-ipfs?status.svg)](https://godoc.org/github.com/ipfs/go-ipfs) [![GoDoc](https://godoc.org/github.com/ipfs/go-ipfs?status.svg)](https://godoc.org/github.com/ipfs/go-ipfs)
[![Build Status](https://travis-ci.org/ipfs/go-ipfs.svg?branch=master)](https://travis-ci.org/ipfs/go-ipfs) [![Build Status](https://travis-ci.org/ipfs/go-ipfs.svg?branch=master)](https://travis-ci.org/ipfs/go-ipfs)
> IPFS implementation in Go
## Project Status ## Project Status
[![Throughput Graph](https://graphs.waffle.io/ipfs/go-ipfs/throughput.svg)](https://waffle.io/ipfs/go-ipfs/metrics/throughput) [![Throughput Graph](https://graphs.waffle.io/ipfs/go-ipfs/throughput.svg)](https://waffle.io/ipfs/go-ipfs/metrics/throughput)
...@@ -39,15 +37,14 @@ Please put all issues regarding: ...@@ -39,15 +37,14 @@ Please put all issues regarding:
- [Download and Compile IPFS](#download-and-compile-ipfs) - [Download and Compile IPFS](#download-and-compile-ipfs)
- [Troubleshooting](#troubleshooting) - [Troubleshooting](#troubleshooting)
- [Development Dependencies](#development-dependencies) - [Development Dependencies](#development-dependencies)
- [Updating](#updating) - [Updating](#updating-go-ipfs)
- [Usage](#usage) - [Usage](#usage)
- [Getting Started](#getting-started) - [Getting Started](#getting-started)
- [Some things to try](#some-things-to-try) - [Some things to try](#some-things-to-try)
- [Docker usage](#docker-usage) - [Docker usage](#docker-usage)
- [Troubleshooting](#troubleshooting-1) - [Troubleshooting](#troubleshooting-1)
- [Development](#development)
- [Contributing](#contributing) - [Contributing](#contributing)
- [Want to hack on IPFS?](#want-to-hack-on-ipfs)
- [Want to read our code?](#want-to-read-our-code)
- [License](#license) - [License](#license)
## Security Issues ## Security Issues
...@@ -88,13 +85,15 @@ You can also download go-ipfs from this project's GitHub releases page if you ar ...@@ -88,13 +85,15 @@ You can also download go-ipfs from this project's GitHub releases page if you ar
In Arch Linux go-ipfs is available as In Arch Linux go-ipfs is available as
[go-ipfs](https://www.archlinux.org/packages/community/x86_64/go-ipfs/) package. [go-ipfs](https://www.archlinux.org/packages/community/x86_64/go-ipfs/) package.
$ sudo pacman -S go-ipfs ```
$ sudo pacman -S go-ipfs
```
Development version of go-ipfs is also on AUR under Development version of go-ipfs is also on AUR under
[go-ipfs-git](https://aur.archlinux.org/packages/go-ipfs-git/). [go-ipfs-git](https://aur.archlinux.org/packages/go-ipfs-git/).
You can install it using your favourite AUR Helper or manually from AUR. You can install it using your favourite AUR Helper or manually from AUR.
### Nix #### Nix
For Linux and MacOSX you can use the purely functional package manager [Nix](https://nixos.org/nix/): For Linux and MacOSX you can use the purely functional package manager [Nix](https://nixos.org/nix/):
...@@ -107,7 +106,9 @@ You can also install the Package by using it's attribute name, which is also `ip ...@@ -107,7 +106,9 @@ You can also install the Package by using it's attribute name, which is also `ip
With snap, in any of the [supported Linux distributions](https://snapcraft.io/docs/core/install): With snap, in any of the [supported Linux distributions](https://snapcraft.io/docs/core/install):
$ sudo snap install ipfs ```
$ sudo snap install ipfs
```
### Build from Source ### Build from Source
...@@ -115,7 +116,6 @@ With snap, in any of the [supported Linux distributions](https://snapcraft.io/do ...@@ -115,7 +116,6 @@ With snap, in any of the [supported Linux distributions](https://snapcraft.io/do
The build process for ipfs requires Go 1.10 or higher. If you don't have it: [Download Go 1.10+](https://golang.org/dl/). The build process for ipfs requires Go 1.10 or higher. If you don't have it: [Download Go 1.10+](https://golang.org/dl/).
You'll need to add Go's bin directories to your `$PATH` environment variable e.g., by adding these lines to your `/etc/profile` (for a system-wide installation) or `$HOME/.profile`: You'll need to add Go's bin directories to your `$PATH` environment variable e.g., by adding these lines to your `/etc/profile` (for a system-wide installation) or `$HOME/.profile`:
``` ```
...@@ -153,43 +153,44 @@ mismatched APIs. ...@@ -153,43 +153,44 @@ mismatched APIs.
#### Troubleshooting #### Troubleshooting
* Separate [instructions are available for building on Windows](docs/windows.md). - Separate [instructions are available for building on Windows](docs/windows.md).
* Also, [instructions for OpenBSD](docs/openbsd.md). - Also, [instructions for OpenBSD](docs/openbsd.md).
* `git` is required in order for `go get` to fetch all dependencies. - `git` is required in order for `go get` to fetch all dependencies.
* Package managers often contain out-of-date `golang` packages. - Package managers often contain out-of-date `golang` packages.
Ensure that `go version` reports at least 1.10. See above for how to install go. Ensure that `go version` reports at least 1.10. See above for how to install go.
* If you are interested in development, please install the development - If you are interested in development, please install the development
dependencies as well. dependencies as well.
* *WARNING: Older versions of OSX FUSE (for Mac OS X) can cause kernel panics when mounting!* - _WARNING_: Older versions of OSX FUSE (for Mac OS X) can cause kernel panics when mounting!-
We strongly recommend you use the [latest version of OSX FUSE](http://osxfuse.github.io/). We strongly recommend you use the [latest version of OSX FUSE](http://osxfuse.github.io/).
(See https://github.com/ipfs/go-ipfs/issues/177) (See https://github.com/ipfs/go-ipfs/issues/177)
* For more details on setting up FUSE (so that you can mount the filesystem), see the docs folder. - For more details on setting up FUSE (so that you can mount the filesystem), see the docs folder.
* Shell command completion is available in `misc/completion/ipfs-completion.bash`. Read [docs/command-completion.md](docs/command-completion.md) to learn how to install it. - Shell command completion is available in `misc/completion/ipfs-completion.bash`. Read [docs/command-completion.md](docs/command-completion.md) to learn how to install it.
* See the [init examples](https://github.com/ipfs/website/tree/master/static/docs/examples/init) for how to connect IPFS to systemd or whatever init system your distro uses. - See the [init examples](https://github.com/ipfs/website/tree/master/static/docs/examples/init) for how to connect IPFS to systemd or whatever init system your distro uses.
### Development Dependencies
If you make changes to the protocol buffers, you will need to install the [protoc compiler](https://github.com/google/protobuf). ### Updating go-ipfs
### Updating #### Using ipfs-update
#### Updating using ipfs-update
IPFS has an updating tool that can be accessed through `ipfs update`. The tool is IPFS has an updating tool that can be accessed through `ipfs update`. The tool is
not installed alongside IPFS in order to keep that logic independent of the main not installed alongside IPFS in order to keep that logic independent of the main
codebase. To install `ipfs update`, [download it here](https://ipfs.io/ipns/dist.ipfs.io/#ipfs-update). codebase. To install `ipfs update`, [download it here](https://ipfs.io/ipns/dist.ipfs.io/#ipfs-update).
#### Downloading IPFS builds using IPFS #### Downloading IPFS builds using IPFS
List the available versions of go-ipfs: List the available versions of go-ipfs:
``` ```
$ ipfs cat /ipns/dist.ipfs.io/go-ipfs/versions $ ipfs cat /ipns/dist.ipfs.io/go-ipfs/versions
``` ```
Then, to view available builds for a version from the previous command ($VERSION): Then, to view available builds for a version from the previous command ($VERSION):
``` ```
$ ipfs ls /ipns/dist.ipfs.io/go-ipfs/$VERSION $ ipfs ls /ipns/dist.ipfs.io/go-ipfs/$VERSION
``` ```
To download a given build of a version: To download a given build of a version:
``` ```
$ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_darwin-386.tar.gz # darwin 32-bit build $ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_darwin-386.tar.gz # darwin 32-bit build
$ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_darwin-amd64.tar.gz # darwin 64-bit build $ ipfs get /ipns/dist.ipfs.io/go-ipfs/$VERSION/go-ipfs_$VERSION_darwin-amd64.tar.gz # darwin 64-bit build
...@@ -317,41 +318,72 @@ Stop the running container: ...@@ -317,41 +318,72 @@ Stop the running container:
### Troubleshooting ### Troubleshooting
If you have previously installed IPFS before and you are running into If you have previously installed IPFS before and you are running into problems getting a newer version to work, try deleting (or backing up somewhere else) your IPFS config directory (~/.ipfs by default) and rerunning `ipfs init`. This will reinitialize the config file to its defaults and clear out the local datastore of any bad entries.
problems getting a newer version to work, try deleting (or backing up somewhere
else) your IPFS config directory (~/.ipfs by default) and rerunning `ipfs init`.
This will reinitialize the config file to its defaults and clear out the local
datastore of any bad entries.
Please direct general questions and help requests to our Please direct general questions and help requests to our [forum](https://discuss.ipfs.io) or our IRC channel (freenode #ipfs).
[forum](https://discuss.ipfs.io) or our IRC channel (freenode #ipfs).
If you believe you've found a bug, check the [issues list](https://github.com/ipfs/go-ipfs/issues) If you believe you've found a bug, check the [issues list](https://github.com/ipfs/go-ipfs/issues) and, if you don't see your problem there, either come talk to us on IRC (freenode #ipfs) or file an issue of your own!
and, if you don't see your problem there, either come talk to us on IRC (freenode #ipfs) or
file an issue of your own!
## Contributing ## Development
We ❤️ all [our contributors](docs/AUTHORS); this project wouldn’t be what it is without you! If you want to help out, please see [Contribute.md](contribute.md). This is a simple description of where the codebase stands. There are multiple subpackages:
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). - `bitswap` - the block exchange
- `blocks` - handles dealing with individual blocks and sharding files
- `blockservice` - handles getting and storing blocks
- `cmd/ipfs` - cli ipfs tool - the main **entrypoint** atm
- `config` - load/edit configuration
- `core` - the core node, joins all the pieces
- `fuse/readonly` - mount `/ipfs` as a readonly fuse fs
- `importer` - import files into ipfs
- `merkledag` - merkle dag data structure
- `path` - path resolution over merkledag data structure
- `peer` - identity + addresses of local and remote peers
- `routing` - the routing system
- `routing/dht` - the DHT default routing system implementation
- `swarm` - connection multiplexing, many peers and many transports
- `util` - various utilities
### Want to hack on IPFS? Some places to get you started on the codebase:
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md) - Main file: [cmd/ipfs/main.go](https://github.com/ipfs/go-ipfs/blob/master/cmd/ipfs/main.go)
- CLI Commands: [core/commands/](https://github.com/ipfs/go-ipfs/tree/master/core/commands)
- Bitswap (the data trading engine): [exchange/bitswap/](https://github.com/ipfs/go-ipfs/tree/master/exchange/bitswap)
- libp2p
- libp2p: https://github.com/libp2p/go-libp2p
- DHT: https://github.com/libp2p/go-libp2p-kad-dht
- PubSub: https://github.com/libp2p/go-floodsub
### CLI, HTTP-API, Architecture Diagram
### Want to read our code? ![](./docs/cli-http-api-core-diagram.png)
Some places to get you started. (WIP) > [Origin](https://github.com/ipfs/pm/pull/678#discussion_r210410924)
Main file: [cmd/ipfs/main.go](https://github.com/ipfs/go-ipfs/blob/master/cmd/ipfs/main.go) <br> Description: Dotted means "likely going away". The "Legacy" parts are thin wrappers around some commands to translate between the new system and the old system. The grayed-out parts on the "daemon" diagram are there to show that the code is all the same, it's just that we turn some pieces on and some pieces off depending on whether we're running on the client or the server.
CLI Commands: [core/commands/](https://github.com/ipfs/go-ipfs/tree/master/core/commands) <br>
Bitswap (the data trading engine): [exchange/bitswap/](https://github.com/ipfs/go-ipfs/tree/master/exchange/bitswap)
DHT: https://github.com/libp2p/go-libp2p-kad-dht <br> ### Testing
PubSub: https://github.com/libp2p/go-floodsub <br>
libp2p: https://github.com/libp2p/go-libp2p ```
make test
```
### Development Dependencies
If you make changes to the protocol buffers, you will need to install the [protoc compiler](https://github.com/google/protobuf).
### Developer Notes
Find more documentation for developers on [docs](./docs)
## Contributing
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)
We ❤️ all [our contributors](docs/AUTHORS); this project wouldn’t be what it is without you! If you want to help out, please see [Contribute.md](contribute.md).
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
## License ## License
MIT [MIT](./LICENSE)
# go-ipfs development
This is a simple description of where the codebase stands.
There are multiple subpackages:
- `bitswap` - the block exchange
- `blocks` - handles dealing with individual blocks and sharding files
- `blockservice` - handles getting and storing blocks
- `cmd/ipfs` - cli ipfs tool - the main **entrypoint** atm
- `config` - load/edit configuration
- `core` - the core node, joins all the pieces
- `fuse/readonly` - mount `/ipfs` as a readonly fuse fs
- `importer` - import files into ipfs
- `merkledag` - merkle dag data structure
- `path` - path resolution over merkledag data structure
- `peer` - identity + addresses of local and remote peers
- `routing` - the routing system
- `routing/dht` - the DHT default routing system implementation
- `swarm` - connection multiplexing, many peers and many transports
- `util` - various utilities
### What's done:
- merkle dag data structure
- path resolution over merkle dag
- local storage of blocks
- basic file import/export (`ipfs add`, `ipfs cat`)
- mounting `/ipfs` (try `{cat, ls} /ipfs/<path>`)
- multiplexing connections (tcp atm)
- peer addressing
- dht - impl basic kademlia routing
- bitswap - impl basic block exchange functionality
- crypto - building trust between peers in the network
- block splitting on import - Rabin fingerprints, etc
### What's in progress:
- ipns - impl `/ipns` obj publishing + path resolution
- expose objects to the web at `http://ipfs.io/<path>`
### What's next:
- version control - `commit` like data structure
- more...
## Cool demos
A list of cool demos to work towards
- boot a VM from an image in ipfs
- boot a VM from a filesystem tree in ipfs
- publish static websites directly from ipfs
- expose objects to the web at `http://ipfs.io/<path>`
- mounted auto-committing versioned personal dropbox
- mounted encrypted personal/group dropbox
- mounted {npm, apt, other pkg manager} registry
- open a video on ipfs, stream it in
- watch a video with a topology of 1 seed N leechers (N ~100)
- more in section 3.8 in the [paper](https://github.com/ipfs/ipfs/blob/master/papers/ipfs-cap2pfs/ipfs-p2p-file-system.pdf)
This diff was suppressed by a .gitattributes entry.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment