@ethersphere/core-sdk

中文文档
0.3.0发布于 2026/10/27BSD-3-ClauseTypeScriptESM + CJS构建来源已验证近 30 天下载 8473

用于 Swarm 分散存储网络的框架不可知类型Script 原始

中文使用文档
文档目录4 节
  1. 安装
  2. 快速实例
  3. 包括什么
  4. 发展

沼泽核心

框架不可知类型 沼泽 分权存储网络:打入字节包装、内容地址和单所有者块、Mantaray Express tree、Reed-Solomon desersure 编码、加密和邮票签名.

没有I/O网络——这个库只构建并剖析了斯瓦尔姆的-盘/接线数据结构. 与Bee节点交谈是留给消费者的(例如. 贝杰斯) (中文(简体) ).

安装

npm install @ethersphere/core-sdk

船舶既作为无害环境管理,又作为普通JS,具有完整的类型Script. 从您的子路径导入 :

import { Bytes, Reference } from '@ethersphere/core-sdk/bytes'
import { makeContentAddressedChunk } from '@ethersphere/core-sdk/chunk'

快速实例

import { makeContentAddressedChunk } from '@ethersphere/core-sdk/chunk'

const chunk = makeContentAddressedChunk('Hello, Swarm!')
console.log(chunk.address.toHex())

包括什么

子路径目录
@ethersphere/core-sdk/bytesBytes 和打入的包装Reference, (中文(简体) ), BatchId, (中文(简体) ), EthAddress, (中文(简体) ), PrivateKey, (中文(简体) ), PublicKey, (中文(简体) ), Signature, (中文(简体) ), Span, (中文(简体) ), Topic, (中文(简体) ), Identifier, (中文(简体) ), FeedIndex, (中文(简体) ), PeerAddress, (中文(简体) ), TransactionId+ 低等编码辅助器(hex/base32/base64、concat、切片、整数包装)
@ethersphere/core-sdk/cryptoKeccak-256、ECDSA标志/恢复/核查、公用/私用钥匙衍生
@ethersphere/core-sdk/chunk内容地址为Chunks(CAC)、单所有者chunks(SOC/SOC复制品)、BMT块散列以及 ChunkSplitter编号 :ChunkJoiner 用于建造和重建块状树木
@ethersphere/core-sdk/mantarayMantarayNode ——用于目录/收藏上传的表列三相
@ethersphere/core-sdk/erasure-codingReed-Solomon对等,冗余级表格,以及用于将等分块添加到流中的批量逻辑
@ethersphere/core-sdk/encryption春克级流密码和 XOR 助手
@ethersphere/core-sdk/bpsBPS-lite live pub/sub(SWIP-74/87):会话主题和块编号,签名的DATA/AUTH/ROSTER/EOS块,WebSocket帧编码器,名册有效载荷,以及 BpsPosition 恢复订阅
@ethersphere/core-sdk/stamper邮票签名(Stamper, (中文(简体) ), stamp())和有效能力数学

每个子路径也会从包根再导出(@ethersphere/core-sdk),这样 import { Bytes } from '@ethersphere/core-sdk' 还行.

发展

pnpm install
pnpm test          # vitest
pnpm typecheck
pnpm format:check
pnpm build          # esbuild (ESM + CJS) + tsc (.d.ts)
pnpm bench          # perf-sensitive functions, checked against a stored baseline

需要节点.js 22+.

版本与发布记录

@ethersphere/core-sdk 共发布 6 个版本,首次发布于 2026/08/18;过去 12 个月发布了 6 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.0latest2026/10/2717 天前
0.2.22026/10/131 个月前
0.2.12026/09/281 个月前
0.2.02026/09/251 个月前
0.1.12026/08/182 个月前
0.0.12026/08/182 个月前

关于 @ethersphere/core-sdk 的常见问题

@ethersphere/core-sdk 是什么?

用于 Swarm 分散存储网络的框架不可知类型Script 原始

如何安装 @ethersphere/core-sdk?

在项目目录运行 npm install @ethersphere/core-sdk,或使用 pnpm add / yarn add / bun add。

@ethersphere/core-sdk 支持 TypeScript 吗?

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

@ethersphere/core-sdk 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@ethersphere/core-sdk 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ethersphere/core-sdk 可以商用吗?

@ethersphere/core-sdk 使用 BSD-3-Clause 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括,不构成法律意见,请以许可原文为准。

@ethersphere/core-sdk 的下载量有多少?

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

@ethersphere/core-sdk 还在维护吗?

最新版本 0.3.0 发布于 2026/10/27(17 天前);至今共发布 6 个版本,其中过去 12 个月发布了 6 个;首次发布于 2026/08/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。