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

Commit

Permalink
Merge pull request #64 from ipfs/docs/architecture
Browse files Browse the repository at this point in the history
add full architecture visualization
  • Loading branch information
daviddias committed Jan 28, 2016
2 parents 56f771b + 1fee2bb commit b9fe47a
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 2 deletions.
85 changes: 83 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The cli is availble through `jsipfs` in your terminal

```
┌───┐ ┌───────────────┐ ┌──────────────┐
│CLI│───▶│ HTTP API ├───▶│IPFS Node Impl│
│CLI│───▶│ HTTP API ├───▶│IPFS Core Impl│
└───┘ └───────────────┘ └──────────────┘
△ △
└──────────┬─────────┘
Expand All @@ -61,9 +61,90 @@ The cli is availble through `jsipfs` in your terminal
└─────┘
```

# IPFS Core Implementation Architecture

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)


```
▶ ┌───────────────────────────────────────────────────────────────────────────────┐
│ IPFS Core │
│ └───────────────────────────────────────────────────────────────────────────────┘
│ │
│ ┌──────────────┬──────────────┼────────────┬─────────────────┐
│ │ │ │ │
│ │ │ │ │ │
▼ │ ▼ │ ▼
│ ┌──────────────────┐ │ ┌──────────────────┐ │ ┌──────────────────┐
│ │ │ │ │ │ │ │
│ │ Block Service │ │ │ DAG Service │ │ │ IPFS Repo │
│ │ │ │ │ │ │ │
│ └──────────────────┘ │ └──────────────────┘ │ └──────────────────┘
│ │ │ │
IPFS Core │ ▼ │ ┌────┴────┐ │
┌────────┐ │ ▼ ▼ │
│ │ Block │ │ ┌────────┐┌────────┐ │
└────────┘ │ │DAG Node││DAG Link│ │
│ │ └────────┘└────────┘ │
┌──────────────────┐ │ │ ┌──────────────────┐
│ │ │ │ │ │ │
│ Bitswap │◀────┤ ├──────▶│ Importer │
│ │ │ │ │ │ │
└──────────────────┘ │ │ └──────────────────┘
│ │ │ │
│ │ ┌────┴────┐
│ │ │ ▼ ▼
│ │ ┌────────┐┌────────┐
│ ┌──────────────────┐ │ │ │ layout ││chunker │
│ │ │ ┌────────────┘ └────────┘└────────┘
│ │ Files │◀────┘ │
│ │ │
│ └──────────────────┘ │
▶ │
┌───────────────────────────────────────────────────────────────────────────────┐
│ │
│ │
│ │
│ libp2p │
│ │
│ │
└───────────────────────────────────────────────────────────────────────────────┘
```

#### IPFS Core

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)

#### Block Service

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

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

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.

#### Bitswap

Bitswap is the exchange protocol used by IPFS to 'trade' blocks with other IPFS nodes.

#### Files

Files is the API that lets us work with IPFS objects (DAG Nodes) as if they were Unix Files.

#### Importer

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.

# Usage

> WIP
> This is a WIP, behare of the Dragons!
# Project Status

Expand Down
Binary file added graphs/arch-full.monopic
Binary file not shown.
46 changes: 46 additions & 0 deletions graphs/arch-full.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

▶ ┌───────────────────────────────────────────────────────────────────────────────┐
│ IPFS Core │
│ └───────────────────────────────────────────────────────────────────────────────┘
│ │
│ ┌──────────────┬──────────────┼────────────┬─────────────────┐
│ │ │ │ │
│ │ │ │ │ │
▼ │ ▼ │ ▼
│ ┌──────────────────┐ │ ┌──────────────────┐ │ ┌──────────────────┐
│ │ │ │ │ │ │ │
│ │ Block Service │ │ │ DAGService │ │ │ IPFS Repo │
│ │ │ │ │ │ │ │
│ └──────────────────┘ │ └──────────────────┘ │ └──────────────────┘
│ │ │ │
IPFS Core │ ▼ │ ┌────┴────┐ │
┌────────┐ │ ▼ ▼ │
│ │ Block │ │ ┌────────┐┌────────┐ │
└────────┘ │ │DAGNode ││DAGLink │ │
│ │ └────────┘└────────┘ │
┌──────────────────┐ │ │ ┌──────────────────┐
│ │ │ │ │ │ │
│ Bitswap │◀────┤ ├──────▶│ Importer │
│ │ │ │ │ │ │
└──────────────────┘ │ │ └──────────────────┘
│ │ │ │
│ │ ┌────┴────┐
│ │ │ ▼ ▼
│ │ ┌────────┐┌────────┐
│ ┌──────────────────┐ │ │ │ layout ││chunker │
│ │ │ ┌────────────┘ └────────┘└────────┘
│ │ Files │◀────┘ │
│ │ │
│ └──────────────────┘ │
▶ │
┌───────────────────────────────────────────────────────────────────────────────┐
│ │
│ │
│ │
│ libp2p │
│ │
│ │
└───────────────────────────────────────────────────────────────────────────────┘

0 comments on commit b9fe47a

Please sign in to comment.