Document Hypercore module

This commit is contained in:
root
2026-02-19 08:36:23 +00:00
parent e148e1fdb9
commit 18773cecf2
+60
View File
@@ -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)