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

Commit

Permalink
docs: add IPFS Architecture Diagram (#1673)
Browse files Browse the repository at this point in the history
* docs: add IPFS Architecture Diagram

* docs: apply review to arch diagram
  • Loading branch information
daviddias authored Dec 4, 2018
1 parent d3345a5 commit 6f1381f
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -995,17 +995,19 @@ the metrics (in prometheus format) by making a GET request to the following endp
http://localhost:5002/debug/metrics/prometheus
```

### IPFS Core Architecture
### IPFS Architecture

![](/img/core.png)
![](/img/architecture.png)

[Annotated version](https://user-images.githubusercontent.com/1211152/47606420-b6265780-da13-11e8-923b-b365a8534e0e.png)j

What does this image explain?

- IPFS uses `ipfs-repo` which picks `fs` or `indexeddb` as its storage drivers, depending if it is running in Node.js or in the Browser.
- The exchange protocol, `bitswap`, uses the Block Service which in turn uses the Repo, offering a get and put of blocks to the IPFS implementation.
- The DAG API (previously Object) comes from the IPLD Resolver, it can support several IPLD Formats (i.e: dag-pb, dag-cbor, etc).
- The Files API uses `ipfs-unixfs-engine` to import and export files to and from IPFS.
- Swarm, the component that offers a network API, uses libp2p to dial and listen for connections, to use the DHT, for discovery mechanisms, and more. libp2p-ipfs-nodejs is used when running in Node.js and libp2p-ipfs-browser is used when running in the browser.
- libp2p, the network stack of IPFS, uses libp2p to dial and listen for connections, to use the DHT, for discovery mechanisms, and more.

## Contribute

Expand Down
4 changes: 3 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ Let us know if you find any issue or if you want to contribute and add a new tut

In this section, you will find explanations to different pieces of IPFS Architecture and how `js-ipfs` implements them.

![](../img/core.png)
![](../img/architecture.png)

[Annotated version](https://user-images.githubusercontent.com/1211152/47606420-b6265780-da13-11e8-923b-b365a8534e0e.png)

> These explanations are still a work in progress
Expand Down
Binary file added img/architecture.monopic
Binary file not shown.
Binary file added img/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions img/architecture.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
┌─────────────────────────────────────────────────────────────────────────────┐
│ The IPFS Architecture │
└─────────────────────────────────────────────────────────────────────────────┘
┏━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━
======================= IPFS Daemon ======================= ┃
┃ ┃
┃┌────┐ ┏ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
│ │ ++++++++++++++++++ IPFS Core ++++++++++++++++++ ┃
│ │ ┃ ┌──────────────────────────────────────────────────┐
│HTTP│ ┌─│ API (Core API) │ ┃┃
┃│Gate│ │ ├──────┬──────┬──────┬──────┬──────┬───────┬───────┤ ┃
┃│way │◀┤ │ Repo │Block │ DAG │ Pin │Files │ │Network│ ┃
│ │ │ └──────┴──────┴──────┴──────┴──────┘ └───────┘
│ │ │ │ │ │ │ │ │ ┃
│ │ │ │ │ ┌────┘ │ ┌────┘ ┌────┘ ┃
┃└────┘ │ ┌──┘ │ │ ┌──────┘ │ ▼ ┃┃
┃ │ │┌────────┘ │ ▼ ▼ ┌────────────────────┐
┌────┐ │ ││ │┌───────┐┌──────┐│ libp2p │┃
│ │ │ ││ ││Pinning││Unixfs││ (Network, PubSub, │
│ │ │ ││ ││Service││Engine││ Swarm, Crypto) │┃┃
┃│ │ │ ││ │└───────┘└──────┘│┌──────────────────┐│ ┃
┃│HTTP│ │ ││ │ │ │ ││Connection Manager││┃
│RPC │ │ ││ ├────┴────────┘ │└──────────────────┘│
┌───┐┌────────┐ │API │◀┘ ││ │ │┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ │┃
│CLI││ipfs-api│ │ │ ┃ ││ │ │ Peer Reputation ││ ┃
└───┘└────────┘┃│ │ ││ │ │└ ─ ─ ─ ─ ─ ─ ─ ─ ─ │┃┃
┃│ │ ┃ ││ ┌──┘ └────────────────────┘
│ │ ││ │ ┌ ─ ─ ─ ─ ┐┌ ─ ─ ─ ─ ─ ┃
└────┘ ┃ ││ │ Providers GC │
││ ▼ │ Service ││ ┃┃
┃ ┃ ││┌─────────────┐ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ ┃
┃ │││Graph Service│─────┬───────────┬───────────┐ ┃
┃ ││└─────────────┘ ▼ ▼ ▼
││ │ ┌ ─ ─ ─ ─ ─ ┌ ─ ─ ─ ─ ─ ┌ ─ ─ ─ ─ ─ ┃
┃ │└───────┤ GraphSync │ GraphSyncB│ GraphSyncC│ ┃
┃ │ ▼ └ ─ ─ ─ ─ ─ └ ─ ─ ─ ─ ─ └ ─ ─ ─ ─ ─ ┃┃
┃ ┃ │ ┌─────────────┐
│ │Block Service│─────┬───────────┬───────────┐ ┃
┃ │ └─────────────┘ ▼ ▼ ▼
│ │ ┌──────────┐┌ ─ ─ ─ ─ ─ ┌ ─ ─ ─ ─ ─ ┃┃
┃ ┃ └─────┬──┴──────│ Bitswap │ BitswapB │ BitswapB │ ┃
┃ ▼ └──────────┘└ ─ ─ ─ ─ ─ └ ─ ─ ─ ─ ─ ┃
┃ ┌─────────┐
│ Repo │ ┃
┃ └─────────┘ ┃
┃ │ ┃┃
┃ ┃ ┌─┴──────┬──────────┬───────┐
▼ ▼ ▼ ▼ ┃
┃ ┌────┐┌──────────┐┌────────┐┌────┐
│ fs ││indexedDB ││LevelDB ││ S3 │ ┃┃
┃ ┃ └────┘└──────────┘└────────┘└────┘ ┃
┃ ┃
┗ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━

┌───────────────────────────────────────────────────────────────────────────┐
│ Legend │
│ ┌ ─ ─ ┐ │
│ Planned, not yet implemented │
│ └ ─ ─ ┘ │
│ ┌─────┐ │
│ │ │ Exist and shipped with IPFS │
│ └─────┘ │
└───────────────────────────────────────────────────────────────────────────┘

0 comments on commit 6f1381f

Please sign in to comment.