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

Commit 6f1381f

Browse files
authored
docs: add IPFS Architecture Diagram (#1673)
* docs: add IPFS Architecture Diagram * docs: apply review to arch diagram
1 parent d3345a5 commit 6f1381f

File tree

5 files changed

+72
-4
lines changed

5 files changed

+72
-4
lines changed

Diff for: README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -995,17 +995,19 @@ the metrics (in prometheus format) by making a GET request to the following endp
995995
http://localhost:5002/debug/metrics/prometheus
996996
```
997997

998-
### IPFS Core Architecture
998+
### IPFS Architecture
999999

1000-
![](/img/core.png)
1000+
![](/img/architecture.png)
1001+
1002+
[Annotated version](https://user-images.githubusercontent.com/1211152/47606420-b6265780-da13-11e8-923b-b365a8534e0e.png)j
10011003

10021004
What does this image explain?
10031005

10041006
- 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.
10051007
- 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.
10061008
- The DAG API (previously Object) comes from the IPLD Resolver, it can support several IPLD Formats (i.e: dag-pb, dag-cbor, etc).
10071009
- The Files API uses `ipfs-unixfs-engine` to import and export files to and from IPFS.
1008-
- 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.
1010+
- libp2p, the network stack of IPFS, uses libp2p to dial and listen for connections, to use the DHT, for discovery mechanisms, and more.
10091011

10101012
## Contribute
10111013

Diff for: examples/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ Let us know if you find any issue or if you want to contribute and add a new tut
3232

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

35-
![](../img/core.png)
35+
![](../img/architecture.png)
36+
37+
[Annotated version](https://user-images.githubusercontent.com/1211152/47606420-b6265780-da13-11e8-923b-b365a8534e0e.png)
3638

3739
> These explanations are still a work in progress
3840

Diff for: img/architecture.monopic

6.8 KB
Binary file not shown.

Diff for: img/architecture.png

140 KB
Loading

Diff for: img/architecture.txt

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
┌─────────────────────────────────────────────────────────────────────────────┐
2+
│ The IPFS Architecture │
3+
└─────────────────────────────────────────────────────────────────────────────┘
4+
┏━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━
5+
======================= IPFS Daemon ======================= ┃
6+
┃ ┃
7+
┃┌────┐ ┏ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
8+
│ │ ++++++++++++++++++ IPFS Core ++++++++++++++++++ ┃
9+
│ │ ┃ ┌──────────────────────────────────────────────────┐
10+
│HTTP│ ┌─│ API (Core API) │ ┃┃
11+
┃│Gate│ │ ├──────┬──────┬──────┬──────┬──────┬───────┬───────┤ ┃
12+
┃│way │◀┤ │ Repo │Block │ DAG │ Pin │Files │ │Network│ ┃
13+
│ │ │ └──────┴──────┴──────┴──────┴──────┘ └───────┘
14+
│ │ │ │ │ │ │ │ │ ┃
15+
│ │ │ │ │ ┌────┘ │ ┌────┘ ┌────┘ ┃
16+
┃└────┘ │ ┌──┘ │ │ ┌──────┘ │ ▼ ┃┃
17+
┃ │ │┌────────┘ │ ▼ ▼ ┌────────────────────┐
18+
┌────┐ │ ││ │┌───────┐┌──────┐│ libp2p │┃
19+
│ │ │ ││ ││Pinning││Unixfs││ (Network, PubSub, │
20+
│ │ │ ││ ││Service││Engine││ Swarm, Crypto) │┃┃
21+
┃│ │ │ ││ │└───────┘└──────┘│┌──────────────────┐│ ┃
22+
┃│HTTP│ │ ││ │ │ │ ││Connection Manager││┃
23+
│RPC │ │ ││ ├────┴────────┘ │└──────────────────┘│
24+
┌───┐┌────────┐ │API │◀┘ ││ │ │┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ │┃
25+
│CLI││ipfs-api│ │ │ ┃ ││ │ │ Peer Reputation ││ ┃
26+
└───┘└────────┘┃│ │ ││ │ │└ ─ ─ ─ ─ ─ ─ ─ ─ ─ │┃┃
27+
┃│ │ ┃ ││ ┌──┘ └────────────────────┘
28+
│ │ ││ │ ┌ ─ ─ ─ ─ ┐┌ ─ ─ ─ ─ ─ ┃
29+
└────┘ ┃ ││ │ Providers GC │
30+
││ ▼ │ Service ││ ┃┃
31+
┃ ┃ ││┌─────────────┐ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ ┃
32+
┃ │││Graph Service│─────┬───────────┬───────────┐ ┃
33+
┃ ││└─────────────┘ ▼ ▼ ▼
34+
││ │ ┌ ─ ─ ─ ─ ─ ┌ ─ ─ ─ ─ ─ ┌ ─ ─ ─ ─ ─ ┃
35+
┃ │└───────┤ GraphSync │ GraphSyncB│ GraphSyncC│ ┃
36+
┃ │ ▼ └ ─ ─ ─ ─ ─ └ ─ ─ ─ ─ ─ └ ─ ─ ─ ─ ─ ┃┃
37+
┃ ┃ │ ┌─────────────┐
38+
│ │Block Service│─────┬───────────┬───────────┐ ┃
39+
┃ │ └─────────────┘ ▼ ▼ ▼
40+
│ │ ┌──────────┐┌ ─ ─ ─ ─ ─ ┌ ─ ─ ─ ─ ─ ┃┃
41+
┃ ┃ └─────┬──┴──────│ Bitswap │ BitswapB │ BitswapB │ ┃
42+
┃ ▼ └──────────┘└ ─ ─ ─ ─ ─ └ ─ ─ ─ ─ ─ ┃
43+
┃ ┌─────────┐
44+
│ Repo │ ┃
45+
┃ └─────────┘ ┃
46+
┃ │ ┃┃
47+
┃ ┃ ┌─┴──────┬──────────┬───────┐
48+
▼ ▼ ▼ ▼ ┃
49+
┃ ┌────┐┌──────────┐┌────────┐┌────┐
50+
│ fs ││indexedDB ││LevelDB ││ S3 │ ┃┃
51+
┃ ┃ └────┘└──────────┘└────────┘└────┘ ┃
52+
┃ ┃
53+
┗ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
54+
━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━ ━━
55+
56+
┌───────────────────────────────────────────────────────────────────────────┐
57+
│ Legend │
58+
│ ┌ ─ ─ ┐ │
59+
│ Planned, not yet implemented │
60+
│ └ ─ ─ ┘ │
61+
│ ┌─────┐ │
62+
│ │ │ Exist and shipped with IPFS │
63+
│ └─────┘ │
64+
└───────────────────────────────────────────────────────────────────────────┘

0 commit comments

Comments
 (0)