# @freqhole/reliquary 中文文档

规范地址：https://npmcn.com/package/%40freqhole/reliquary/

版本：0\.3\.27
npm 元数据更新时间：2026-11-10T03:19:48.550Z
中文译文更新时间：2026-11-15T14:21:54.012Z
软件包许可：UNLICENSED

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40freqhole/reliquary
原文对照：https://npmcn.com/package/%40freqhole/reliquary/?lang=original
项目主页：https://github.com/freqhole/tomb#readme
源码仓库：https://github.com/freqhole/tomb

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：547 kB，221 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：1 个
- peer 依赖：vitest ^3\.2\.7，solid-js ^1\.9\.0，fake-indexeddb ^6\.0\.0，@automerge/automerge-repo ^2\.5\.6
- 首次发布：2026-07-21T22:11:13.200Z
- 最新版本发布：2026-11-10T03:19:48.110Z
- 近 30 天下载量：2780（2026-10-16 至 2026-11-14，npm 官方下载统计）
- 已发布版本数：43（近 12 个月 43 个）

## 中文简介

freqhole 介质 blob 存储域:内容地址 blobs, transfer, worker, s固态帮助器

## 安装

```sh
npm install @freqhole/reliquary
```

也可以使用：`pnpm add @freqhole/reliquary`、`yarn add @freqhole/reliquary`、`bun add @freqhole/reliquary`

## README

# 折叠

所有用于freqhole世界的媒体blob存储应用程序:内容地址为blob商店 (sqlite-native and indexeddb/opfs-browser), roh-blops 包装(fs商店生命周期,gc) 保护、经核实的转移、抢夺引擎(主动的blob复制)、确保 协议( 设置一个对等点来设置 blob) , blob acl gating, 媒体帮助器和共享浏览器 乌提尔斯。 生锈的箱子 `reliquary` + npm 软件包 `@freqhole/reliquary`。 。 。 .

## 结构

blake3是各地唯一的犬科内容地址. iroh p2p是一种运输,而不是 架构 - 储存合同和转移流由运输注入。 这个图书馆 从未拥有 http 服务器: 服务范围保留在耗用应用程序中 .

```mermaid
graph LR
    subgraph app
        A[your app]
    end
    subgraph rust
        B[BlobStore trait<br/>SqliteBlobStore]
        N[StorageNode<br/>iroh-blobs fs store + gc + downloader]
        SN[SnatchEngine<br/>proactive replication]
        EN[ensure protocol<br/>ALPN freqhole/1]
        G[AccessGate<br/>transfer acl seam]
    end
    subgraph browser ts
        TB[./blobs idb records +<br/>opfs/cache bytes]
        TT[./transfer snatch/serve/prefetch]
        TE[./ensure client + responder]
        TW[./worker hashing + opfs io]
    end
    A --> B & N & SN
    SN --> N
    EN --> B
    G -.gates.-> N
    A --> TB & TT & TE
    TT --> TW
    B --- DB[(reliquary.db<br/>own sqlite file)]
```

## 结构

```
rust/               crate: reliquary
  src/
    blobz.rs        BlobStore trait + sqlite impl (blake3 pk, soft delete, derived blobs)
    node.rs         StorageNode: fs store lifecycle, init_local/attach_endpoint, gc protect
    snatch.rs       SnatchEngine over BlobRefSource + PeerProbeTransport traits
    ensure.rs       EnsureBlobHandler + PeerMessage wire types (ALPN "freqhole/1")
    gate.rs         AccessGate seam for the iroh-blobs verified-transfer ALPN
    hash.rs         streaming blake3 helpers
    media/          image resize/webp (feature: media), pdf/video thumbs (feature: thumbnails)
    chunked_import.rs, identity.rs, db.rs
    testing.rs      fixtures (feature: test-utils)
  examples/         runnable walkthroughs (see below)
  migrations/       reliquary.db's own migration set
ts/                 npm: @freqhole/reliquary
  src/{blobs,transfer,ensure,worker,automerge,utils,solid,testing}
docs/               storage-traits.md (the BlobStore contract design)
```

## 生锈:开始

```rust
use reliquary::{BlobStore, NewBlobMeta};
use reliquary::testing::make_blobz_store;

let (store, _tmp) = make_blobz_store().await;
let record = store.insert(bytes, NewBlobMeta {
    filename: Some("example.txt".into()),
    mime: Some("text/plain".into()),
    ..Default::default()
}).await?;
let bytes_back = store.read_bytes(&record.blake3).await?;
```

特性( 除 `thumbnails`编号 :`test-utils`: `blobz`, (中文(简体) ), `node`, (中文(简体) ), `snatch`, (中文(简体) ), `ensure`, (中文(简体) ), `gate`, (中文(简体) ), `media`, (中文(简体) ), `chunked_import`, (中文(简体) ), `identity`。 。 。 .

```bash
cargo run --example blob-round-trip --features test-utils       # BlobStore contract, no network
cargo run --example blob-acl-gate --features test-utils         # AccessGate over transfer events
cargo run --example snatch-engine --features test-utils         # replication engine w/ mock transport
cargo run --example two-peer-blob-transfer --features test-utils  # real iroh, two endpoints
```

## ts: 开始

无框架核心子路径; `solid-js` 编号 : `@automerge/automerge-repo` 可选对等点 仅由 `./solid` 编号 : `./automerge`。 。 。 .

| 子路径 | 什麽 |
| --- | --- |
| `./blobs` | idb 记录商店 + opfs/ cache- api 字节, blake3 canonical ()`createBlobStore`(中文(简体) ) |
| `./transfer` | `snatchBlob`编号 :`snatchBlobToDisk` (暂停/恢复,每例战略下降), `BlobServer`, (中文(简体) ), `Prefetcher` |
| `./ensure` | 保证- blob 客户端 + 任何双流响应器( )`DEFAULT_ENSURE_ALPN = "freqhole/1"`(中文(简体) ) |
| `./worker` | blob 工人( hashing, opfs io, 块上传) + 客户端外观 |
| `./automerge` | Iroh NetworkAdapter + acl 更改取取包装器 |
| `./utils` | 图像使用、散列、标记日志 |
| `./solid` | 创建 Transfer 进步 创建 BlobUrl 创建 DocStore (可选) |
| `./testing` | 模拟流/节点、wav + 决定字节固定装置、 idb 带 |

```ts
import { createBlobStore } from "@freqhole/reliquary/blobs";
const store = createBlobStore({
  dbName: "myapp-blobs",
  allowCacheFallback: false,
});
```

热量消费者:由工人组成的中间溶液需要 `resolveId` 在两个插件 `plugins` 财务报告和审定财务报表 `worker.plugins` (见skein/loam) `vite.config.ts`\- 一个平地 `resolve.alias` 只在运行时默默失败 .

## 开发者快速启动

```bash
# rust (no DATABASE_URL needed - queries are runtime-checked)
cargo test --workspace --all-features
cargo fmt --all --check && cargo clippy --workspace --all-targets

# ts
cd ts && npm i
npm run typecheck && npm test && npm run build
```

箱子拥有自己的sqlite db(`reliquary.db`) 运行时间,与任何消耗时间分开 应用的db。 今天的消费者:斯克因(hub daemon + tauri + loam, 完全切口),墓葬/备忘录 (hash;存储接合正在进行),播放列表z(计划转移/blops收养).

见 [文件/储存-海峡.md](https://npmcn.com/package/%40freqhole/reliquary/docs/storage-traits.md) blobStore合同设计 墓葬重建计划位于墓葬/道克/xl-重建地.

## 常见问题

### @freqhole/reliquary 是什么？

freqhole 介质 blob 存储域:内容地址 blobs, transfer, worker, s固态帮助器

### 如何安装 @freqhole/reliquary？

在项目目录运行 npm install @freqhole/reliquary，或使用 pnpm add / yarn add / bun add。

### @freqhole/reliquary 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @freqhole/reliquary 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @freqhole/reliquary 可以商用吗？

@freqhole/reliquary 使用 UNLICENSED 许可。作者声明为 UNLICENSED，即不授予公开使用许可（与公共领域的 Unlicense 不同）。使用前需获得作者授权。以上为概括，不构成法律意见，请以许可原文为准。

### @freqhole/reliquary 的下载量有多少？

根据 npm 官方下载统计，@freqhole/reliquary 在 2026/10/16 – 2026/11/14 这 30 天内被下载 2,780 次，日均约 93 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @freqhole/reliquary 还在维护吗？

最新版本 0\.3\.27 发布于 2026/11/10（5 天前）；至今共发布 43 个版本，其中过去 12 个月发布了 43 个；首次发布于 2026/07/22。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

