Document Hypercore module
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
# Hypercore
|
||||
|
||||
## Overview
|
||||
|
||||
Hypercore is the foundational append-only log primitive. Secure, distributed, sparse replication.
|
||||
|
||||
**Key Features:**
|
||||
- Signed Merkle trees for integrity
|
||||
- Realtime updates
|
||||
- Sparse / range replication
|
||||
- Block encryption support
|
||||
- Forking / truncation (v10+ LTS)
|
||||
|
||||
Links: [GitHub](https://github.com/holepunchto/hypercore), [Docs](https://docs.pears.com/building-blocks/hypercore)
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
mermaid
|
||||
graph TD
|
||||
A[Append Block] --> B[Sign Tree]
|
||||
B --> C[Flat File Storage]
|
||||
C --> D[Oplog]
|
||||
C --> E[Merkle Tree]
|
||||
E --> F[Proofs]
|
||||
F --> G[Replication]
|
||||
```
|
||||
|
||||
Internals:
|
||||
- Flat-tree for merkle proofs
|
||||
- Hypercore-storage for persistence
|
||||
- Noise / Protomux for protocol
|
||||
|
||||
## API Highlights
|
||||
|
||||
```js
|
||||
const core = new Hypercore('./data')
|
||||
await core.append('hello')
|
||||
const data = await core.get(0)
|
||||
await core.update()
|
||||
```
|
||||
|
||||
Full API: append, get, update, download(range), replicate(), etc.
|
||||
|
||||
## Dependencies
|
||||
|
||||
From package.json:
|
||||
- hypercore-storage
|
||||
- flat-tree
|
||||
- compact-encoding
|
||||
- protomux
|
||||
- sodium-universal (crypto)
|
||||
|
||||
## Use Cases
|
||||
- Chat messages
|
||||
- File metadata
|
||||
- Event logs
|
||||
|
||||
## Limitations
|
||||
- Append-only (use Autobase for CRDT)
|
||||
Reference in New Issue
Block a user