formatting
This commit is contained in:
@@ -19,18 +19,18 @@ Hyperdrive is built on top of Autobase - it uses Autobase's virtual Hypercore me
|
||||
│ Hyperdrive │
|
||||
│ (Filesystem API) │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌──────────────────┐ ┌────────────────────────────┐ │
|
||||
│ │ Metadata Index │ │ Content Storage │ │
|
||||
│ │ (Hyperbee) │ │ (Hyperblobs) │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ path → entry │ │ hash → binary data │ │
|
||||
│ │ entry → path │ │ │ │
|
||||
│ └────────┬─────────┘ └────────────┬───────────────┘ │
|
||||
│ │ │ │
|
||||
│ └────────────┬────────────────────┘ │
|
||||
│ │
|
||||
│ ┌──────────────────┐ ┌────────────────────────────┐ │
|
||||
│ │ Metadata Index │ │ Content Storage │ │
|
||||
│ │ (Hyperbee) │ │ (Hyperblobs) │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ path → entry │ │ hash → binary data │ │
|
||||
│ │ entry → path │ │ │ │
|
||||
│ └────────┬─────────┘ └────────────┬───────────────┘ │
|
||||
│ │ │ │
|
||||
│ └────────────┬───────────────────┘ │
|
||||
│ ▼ │
|
||||
│ ┌─────────────────────────┐ │
|
||||
│ ┌──────────────────────────┐ │
|
||||
│ │ Virtual Core │ │
|
||||
│ │ (Autobase Output) │ │
|
||||
│ │ │ │
|
||||
@@ -38,17 +38,17 @@ Hyperdrive is built on top of Autobase - it uses Autobase's virtual Hypercore me
|
||||
│ │ - Metadata updates │ │
|
||||
│ │ - ACL changes │ │
|
||||
│ └────────────┬─────────────┘ │
|
||||
│ │ │
|
||||
│ ▼ │
|
||||
│ ┌─────────────────────────┐ │
|
||||
│ │ │
|
||||
│ ▼ │
|
||||
│ ┌──────────────────────────┐ │
|
||||
│ │ Input Feeds │ │
|
||||
│ │ │ │
|
||||
│ │ [Feed A] ─┐ │ │
|
||||
│ │ [Feed B] ─┼──> Merge │ │
|
||||
│ │ [Feed C] ─┘ │ │
|
||||
│ │ │ │
|
||||
│ └──────────────────────────┘ │
|
||||
│ │
|
||||
│ └──────────────────────────┘ │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
|
||||
@@ -10,42 +10,42 @@ Corestore provides shared storage for multiple Hypercores, while Hyperbee offers
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ Application │
|
||||
│ Application │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────────┐ │
|
||||
│ │ Corestore │ │
|
||||
│ │ (Storage Multiplexing) │ │
|
||||
│ │ │ │
|
||||
│ │ ┌───────────┐ ┌───────────┐ ┌───────────┐ │ │
|
||||
│ │ │ Core A │ │ Core B │ │ Core C │ │ │
|
||||
│ │ │ (users) │ │ (posts) │ │ (cache) │ │ │
|
||||
│ │ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ │ │
|
||||
│ │ │ │ │ │ │
|
||||
│ │ └───────────────┼───────────────┘ │ │
|
||||
│ │ ▼ │ │
|
||||
│ │ ┌─────────────────┐ │ │
|
||||
│ │ │ RocksDB │ │ │
|
||||
│ │ │ (Storage) │ │ │
|
||||
│ │ └─────────────────┘ │ │
|
||||
│ │ (Storage Multiplexing) │ │
|
||||
│ │ │ │
|
||||
│ │ ┌───────────┐ ┌───────────┐ ┌───────────┐ │ │
|
||||
│ │ │ Core A │ │ Core B │ │ Core C │ │ │
|
||||
│ │ │ (users) │ │ (posts) │ │ (cache) │ │ │
|
||||
│ │ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ │ │
|
||||
│ │ │ │ │ │ │
|
||||
│ │ └───────────────┼───────────────┘ │ │
|
||||
│ │ ▼ │ │
|
||||
│ │ ┌─────────────────┐ │ │
|
||||
│ │ │ RocksDB │ │ │
|
||||
│ │ │ (Storage) │ │ │
|
||||
│ │ └─────────────────┘ │ │
|
||||
│ └─────────────────────────────────────────────────────────┘ │
|
||||
│ │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ Hyperbee Instances │
|
||||
│ Hyperbee Instances │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
||||
│ │ UserDB │ │ PostDB │ │ CacheDB │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ users:1 → {} │ │ posts:1 → {} │ │ session:xyz │ │
|
||||
│ │ users:2 → {} │ │ posts:2 → {} │ │ session:abc │ │
|
||||
│ │ users:* → {} │ │ posts:* → {} │ │ │ │
|
||||
│ └──────────────┘ └──────────────┘ └──────────────┘ │
|
||||
│ │
|
||||
│ Each Hyperbee wraps a Hypercore from Corestore │
|
||||
│ │
|
||||
│ │
|
||||
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
||||
│ │ UserDB │ │ PostDB │ │ CacheDB │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ users:1 → {} │ │ posts:1 → {} │ │ session:xyz │ │
|
||||
│ │ users:2 → {} │ │ posts:2 → {} │ │ session:abc │ │
|
||||
│ │ users:* → {} │ │ posts:* → {} │ │ │ │
|
||||
│ └──────────────┘ └──────────────┘ └──────────────┘ │
|
||||
│ │
|
||||
│ Each Hyperbee wraps a Hypercore from Corestore │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
|
||||
@@ -6,31 +6,31 @@ Hyperdrive is a distributed file system built on top of Autobase, providing conf
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ Hyperdrive │
|
||||
│ Hyperdrive │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌──────────────────┐ ┌──────────────────────┐ │
|
||||
│ │ Hyperbee │ │ Hyperblobs │ │
|
||||
│ │ (Metadata) │ │ (File Content) │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ /file.txt ──────┼──────────┼──────> content │ │
|
||||
│ │ /dir/file ──────┼──────────┼──────> content │ │
|
||||
│ │ /img.png ───────┼──────────┼──────> content │ │
|
||||
│ └────────┬─────────┘ └──────────┬───────────┘ │
|
||||
│ │ │ │
|
||||
│ └────────────┬───────────────────┘ │
|
||||
│ ▼ │
|
||||
│ ┌─────────────────────┐ │
|
||||
│ │ Autobase │ │
|
||||
│ │ (Virtual Hypercore)│ │
|
||||
│ └──────────┬──────────┘ │
|
||||
│ │ │
|
||||
│ ▼ │
|
||||
│ ┌─────────────────────┐ │
|
||||
│ │ Input Hypercores │ │
|
||||
│ │ (One per writer) │ │
|
||||
│ └─────────────────────┘ │
|
||||
│ │
|
||||
│ │
|
||||
│ ┌──────────────────┐ ┌──────────────────────┐ │
|
||||
│ │ Hyperbee │ │ Hyperblobs │ │
|
||||
│ │ (Metadata) │ │ (File Content) │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ /file.txt ──────┼──────────┼──────> content │ │
|
||||
│ │ /dir/file ──────┼──────────┼──────> content │ │
|
||||
│ │ /img.png ───────┼──────────┼──────> content │ │
|
||||
│ └────────┬─────────┘ └──────────┬───────────┘ │
|
||||
│ │ │ │
|
||||
│ └────────────┬───────────────────┘ │
|
||||
│ ▼ │
|
||||
│ ┌─────────────────────┐ │
|
||||
│ │ Autobase │ │
|
||||
│ │ (Virtual Hypercore)│ │
|
||||
│ └──────────┬──────────┘ │
|
||||
│ │ │
|
||||
│ ▼ │
|
||||
│ ┌─────────────────────┐ │
|
||||
│ │ Input Hypercores │ │
|
||||
│ │ (One per writer) │ │
|
||||
│ └─────────────────────┘ │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ Complete architecture showing how all Holepunch primitives compose from the meta
|
||||
│ Hyperswarm | HyperDHT | Connection Management | NAT Traversal │
|
||||
├─────────────────────────────────────────────────────────────────────┤
|
||||
│ TRANSPORT LAYER │
|
||||
│ Protomux | HRPC | Channel Multiplexing | Protocol Negotiation │
|
||||
│ Protomux | HRPC | Channel Multiplexing | Protocol Negotiation │
|
||||
├─────────────────────────────────────────────────────────────────────┤
|
||||
│ SECURITY LAYER │
|
||||
│ SECURITY LAYER │
|
||||
│ Noise Protocol | Secret Stream | Encryption | Authentication │
|
||||
├─────────────────────────────────────────────────────────────────────┤
|
||||
│ PLATFORM LAYER │
|
||||
│ Bare Runtime | Pear | Electron | Native Bindings │
|
||||
│ PLATFORM LAYER │
|
||||
│ Bare Runtime | Pear | Electron | Native Bindings │
|
||||
└─────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
|
||||
@@ -8,27 +8,27 @@ Hyperdrive uses multiple storage systems:
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ Hyperdrive │
|
||||
│ Hyperdrive │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────┐ ┌────────────────────────┐ │
|
||||
│ │ Hyperbee │ │ Hyperblobs │ │
|
||||
│ │ (Metadata) │ │ (Content) │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ path → entry │ │ hash → binary │ │
|
||||
│ │ entry → path │ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ /file.txt ──────┼─────────┼────────▶ blob data │ │
|
||||
│ │ │ │ │ │
|
||||
│ └────────┬─────────┘ └────────────┬─────────┘ │
|
||||
│ │ │ │
|
||||
│ └─────────────┬───────────────────┘ │
|
||||
│ ▼ │
|
||||
│ ┌─────────────────────┐ │
|
||||
│ │ Virtual Core │ │
|
||||
│ │ (Autobase Output) │ │
|
||||
│ └─────────────────────┘ │
|
||||
│ │
|
||||
│ │
|
||||
│ ┌──────────────────┐ ┌────────────────────────┐ │
|
||||
│ │ Hyperbee │ │ Hyperblobs │ │
|
||||
│ │ (Metadata) │ │ (Content) │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ path → entry │ │ hash → binary │ │
|
||||
│ │ entry → path │ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ /file.txt ──────┼─────────┼────────▶ blob data │ │
|
||||
│ │ │ │ │ │
|
||||
│ └────────┬─────────┘ └─────────────┬──────────┘ │
|
||||
│ │ │ │
|
||||
│ └─────────────┬───────────────────┘ │
|
||||
│ ▼ │
|
||||
│ ┌─────────────────────┐ │
|
||||
│ │ Virtual Core │ │
|
||||
│ │ (Autobase Output) │ │
|
||||
│ └─────────────────────┘ │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
|
||||
@@ -5,36 +5,36 @@ Hyperblobs provides content-addressed binary storage for Hyperdrive, handling al
|
||||
## Architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
┌──────────────────────────────────────────────────────────────────┐
|
||||
│ Hyperdrive │
|
||||
│ (Filesystem API) │
|
||||
├────────────────────────────────────────────────────────────────�
|
||||
├───────────────────────────────────────────────────────────────────
|
||||
│ │
|
||||
│ ┌─────────────────────┐ ┌─────────────────────────┐ │
|
||||
│ │ Hyperbee │ │ Hyperblobs │ │
|
||||
│ │ (Metadata) │ │ (Content) │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ path → Entry │ │ hash → Binary │ │
|
||||
│ │ entry → path │ │ │ │
|
||||
│ │ │ │ Key: content hash │ │
|
||||
│ │ /file.txt ────────┼───────┤ Value: file data │ │
|
||||
│ │ hash: abc123 │ │ │ │
|
||||
│ │ size: 1024 │ │ abc123 ──────────────▶│ data│ │
|
||||
│ │ mtime: ... │ │ │ │
|
||||
│ └──────────┬──────────┘ └────────────┬────────────┘ │
|
||||
│ │ │ │
|
||||
│ └─────────────┬───────────────────┘ │
|
||||
│ ▼ │
|
||||
│ ┌────────────────────────────┐ │
|
||||
│ ┌─────────────────────┐ ┌─────────────────────────┐ │
|
||||
│ │ Hyperbee │ │ Hyperblobs │ │
|
||||
│ │ (Metadata) │ │ (Content) │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ path → Entry │ │ hash → Binary │ │
|
||||
│ │ entry → path │ │ │ │
|
||||
│ │ │ │ Key: content hash │ │
|
||||
│ │ /file.txt ─────────┼───────┤ Value: file data │ │
|
||||
│ │ hash: abc123 │ │ │ │
|
||||
│ │ size: 1024 │ │ abc123 ───────▶ data │ │
|
||||
│ │ mtime: ... │ │ │ │
|
||||
│ └──────────┬──────────┘ └──────────────┬──────────┘ │
|
||||
│ │ │ │
|
||||
│ └─────────────┬───────────────────┘ │
|
||||
│ ▼ │
|
||||
│ ┌────────────────────────────┐ │
|
||||
│ │ Hypercore Storage │ │
|
||||
│ │ │ │
|
||||
│ │ ┌──────────┬──────────┐ │ │
|
||||
│ │ │ Metadata │ Blobs │ │ │
|
||||
│ │ │ Core │ Core │ │ │
|
||||
│ │ └──────────┴──────────┘ │ │
|
||||
│ └────────────────────────────┘ │
|
||||
│ │ │ │
|
||||
│ │ ┌──────────┬──────────┐ │ │
|
||||
│ │ │ Metadata │ Blobs │ │ │
|
||||
│ │ │ Core │ Core │ │ │
|
||||
│ │ └──────────┴──────────┘ │ │
|
||||
│ └────────────────────────────┘ │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
└──────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## How Hyperdrive Uses Hyperblobs
|
||||
|
||||
@@ -47,30 +47,30 @@ swarm.on('connection', (conn) => {
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ Corestore │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌──────────────────────────────────────────────────────────┐ │
|
||||
│ │
|
||||
│ ┌───────────────────────────────────────────────────────────┐ │
|
||||
│ │ Storage Layer │ │
|
||||
│ │ (RocksDB) │ │
|
||||
│ │ (RocksDB) │ │
|
||||
│ │ │ │
|
||||
│ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │
|
||||
│ │ │ Block 1 │ │ Block 2 │ │ Block 3 │ │ Block 4 │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │ │
|
||||
│ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │
|
||||
│ │ │ Block 1 │ │ Block 2 │ │ Block 3 │ │ Block 4 │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ └───────────┴───────────┴───────────┘ │ │
|
||||
│ │ │ │ │
|
||||
│ └───────────────────────┼───────────────────────────────────┘ │
|
||||
│ ▼ │
|
||||
│ ┌──────────────────────────────────────────────────────────┐ │
|
||||
│ ▼ │
|
||||
│ ┌───────────────────────────────────────────────────────────┐ │
|
||||
│ │ Core Manager │ │
|
||||
│ │ │ │
|
||||
│ │ store.get('name1') ─────────▶ Core instance │ │
|
||||
│ │ store.get('name2') ─────────▶ Core instance │ │
|
||||
│ │ store.get({ key }) ─────────▶ Core instance │ │
|
||||
│ │ store.get('name1') ─────────▶ Core instance │ │
|
||||
│ │ store.get('name2') ─────────▶ Core instance │ │
|
||||
│ │ store.get({ key }) ─────────▶ Core instance │ │
|
||||
│ │ │ │
|
||||
│ │ store.replicate(conn) ───────▶ All cores │ │
|
||||
│ └──────────────────────────────────────────────────────────┘ │
|
||||
│ │
|
||||
│ │ store.replicate(conn) ───────▶ All cores │ │
|
||||
│ └───────────────────────────────────────────────────────────┘ │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
|
||||
@@ -7,28 +7,28 @@ How Hyperswarm uses the Distributed Hash Table for peer discovery, and how they
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ Hyperswarm │
|
||||
│ (High-Level P2P Networking) │
|
||||
│ (High-Level P2P Networking) │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────┐ ┌─────────────────┐ │
|
||||
│ │
|
||||
│ ┌─────────────────┐ ┌─────────────────┐ │
|
||||
│ │ Connection Mgmt │ │ Topic Lookup │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ - TCP/UDP │────▶│ - DHT lookup │ │
|
||||
│ │ - UDX │ │ - Announce │ │
|
||||
│ │ - Encryption │ │ - Peer filtering│ │
|
||||
│ └────────┬────────┘ └────────┬────────┘ │
|
||||
│ │ │ │
|
||||
│ │ - TCP/UDP │────▶│ - DHT lookup │ │
|
||||
│ │ - UDX │ │ - Announce │ │
|
||||
│ │ - Encryption │ │ - Peer filtering│ │
|
||||
│ └────────┬────────┘ └────────┬────────┘ │
|
||||
│ │ │ │
|
||||
│ └────────────┬────────────┘ │
|
||||
│ ▼ │
|
||||
│ ▼ │
|
||||
│ ┌─────────────────────────┐ │
|
||||
│ │ HyperDHT │ │
|
||||
│ │ (Peer Discovery) │ │
|
||||
│ │ │ │
|
||||
│ │ - Kademlia DHT │ │
|
||||
│ │ - Bencoding │ │
|
||||
│ │ - Bootstrap nodes │ │
|
||||
│ │ - Kademlia DHT │ │
|
||||
│ │ - Bencoding │ │
|
||||
│ │ - Bootstrap nodes │ │
|
||||
│ └─────────────────────────┘ │
|
||||
│ │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ The encryption layer that secures all P2P communications in the Holepunch ecosys
|
||||
│ (Stream Encryption + Framing) │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ Noise Protocol │
|
||||
│ (Key Exchange + Auth) │
|
||||
│ (Key Exchange + Auth) │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ Transport │
|
||||
│ (TCP / UDP) │
|
||||
|
||||
@@ -9,21 +9,21 @@ Protomux provides protocol multiplexing over encrypted connections, while HRPC (
|
||||
│ Application │
|
||||
│ (Your App Code) │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ HRPC │
|
||||
│ (Remote Procedure Calls) │
|
||||
│ request/response, streams, notifications │
|
||||
│ HRPC │
|
||||
│ (Remote Procedure Calls) │
|
||||
│ request/response, streams, notifications │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ Protomux │
|
||||
│ (Protocol Multiplexing) │
|
||||
│ Multiple channels, single connection │
|
||||
│ Protomux │
|
||||
│ (Protocol Multiplexing) │
|
||||
│ Multiple channels, single connection │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ Secret Stream │
|
||||
│ Secret Stream │
|
||||
│ (Noise Encryption) │
|
||||
│ Authenticated, forward secret │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ Hyperswarm │
|
||||
│ (P2P Networking) │
|
||||
│ Discovery, NAT traversal, connection │
|
||||
│ (P2P Networking) │
|
||||
│ Discovery, NAT traversal, connection │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user