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

Commit ffdf640

Browse files
committed
docs: update readme, add examples, pointers to API docs and more
1 parent 1b0b22d commit ffdf640

File tree

4 files changed

+268
-153
lines changed

4 files changed

+268
-153
lines changed

ARCHITECTURE.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Architecture
2+
3+
```
4+
┌───┐ ┌───────────────┐ ┌──────────────┐
5+
│CLI│───▶│ HTTP API ├───▶│IPFS Core Impl│
6+
└───┘ └───────────────┘ └──────────────┘
7+
△ △ △
8+
└──────────────└──────────┬─────────┘
9+
10+
┌─────┐
11+
│Tests│
12+
└─────┘
13+
```
14+
15+
## IPFS Core implementation architecture
16+
17+
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](https://github.com/diasdavid/js-libp2p)
18+
19+
20+
```
21+
▶ ┌───────────────────────────────────────────────────────────────────────────────┐
22+
│ IPFS Core │
23+
│ └───────────────────────────────────────────────────────────────────────────────┘
24+
25+
│ │
26+
27+
│ ┌──────────────┬──────────────┼────────────┬─────────────────┐
28+
│ │ │ │ │
29+
│ │ │ │ │ │
30+
▼ │ ▼ │ ▼
31+
│ ┌──────────────────┐ │ ┌──────────────────┐ │ ┌──────────────────┐
32+
│ │ │ │ │ │ │ │
33+
│ │ Block Service │ │ │ DAG Service │ │ │ IPFS Repo │
34+
│ │ │ │ │ │ │ │
35+
│ └──────────────────┘ │ └──────────────────┘ │ └──────────────────┘
36+
│ │ │ │
37+
IPFS Core │ ▼ │ ┌────┴────┐ │
38+
┌────────┐ │ ▼ ▼ │
39+
│ │ Block │ │ ┌────────┐┌────────┐ │
40+
└────────┘ │ │DAG Node││DAG Link│ │
41+
│ │ └────────┘└────────┘ │
42+
┌──────────────────┐ │ │ ┌──────────────────┐
43+
│ │ │ │ │ │ │
44+
│ Bitswap │◀────┤ ├──────▶│ Importer │
45+
│ │ │ │ │ │ │
46+
└──────────────────┘ │ │ └──────────────────┘
47+
│ │ │ │
48+
│ │ ┌────┴────┐
49+
│ │ │ ▼ ▼
50+
│ │ ┌────────┐┌────────┐
51+
│ ┌──────────────────┐ │ │ │ layout ││chunker │
52+
│ │ │ ┌────────────┘ └────────┘└────────┘
53+
│ │ Files │◀────┘ │
54+
│ │ │
55+
│ └──────────────────┘ │
56+
▶ │
57+
58+
┌───────────────────────────────────────────────────────────────────────────────┐
59+
│ │
60+
│ │
61+
│ │
62+
│ libp2p │
63+
│ │
64+
│ │
65+
└───────────────────────────────────────────────────────────────────────────────┘
66+
```
67+
68+
#### IPFS Core
69+
70+
IPFS Core is the entry point module for IPFS. It exposes an interface defined on [IPFS Specs.](https://github.com/ipfs/specs/blob/ipfs/api/api/core/README.md)
71+
72+
#### Block Service
73+
74+
Block Service uses IPFS Repo (local storage) and Bitswap (network storage) to store and fetch blocks. A block is a serialized MerkleDAG node.
75+
76+
#### DAG Service
77+
78+
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.
79+
80+
#### IPFS Repo
81+
82+
IPFS Repo is storage driver of IPFS, follows the [IPFS Repo Spec](https://github.com/ipfs/specs/tree/master/repo) and supports the storage of different types of files.
83+
84+
#### Bitswap
85+
86+
Bitswap is the exchange protocol used by IPFS to 'trade' blocks with other IPFS nodes.
87+
88+
#### Files
89+
90+
Files is the API that lets us work with IPFS objects (DAG Nodes) as if they were Unix Files.
91+
92+
#### Importer
93+
94+
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.
95+
96+

0 commit comments

Comments
 (0)