@ariestools/chain-serve-local-s3

中文文档
0.3.0发布于 2026/10/31LGPL-3.0-onlyTypeScriptES Module近 30 天下载 2331

One-call local XL1 test harness: published-chain S3 layout (s3rver) + xl1-cli (api/producer/finalizer/mempool/indexer)

原始使用文档
文档目录5 节
  1. Install
  2. Single-call usage
  3. Vitest setupFile (lifehash-style globals)
  4. Options
  5. Notes

@ariestools/chain-serve-local-s3

Dev/test only. Boots an ephemeral local XL1 environment for integration and e2e tests. Not for production.

One function call starts:

  1. @ariestools/aries-chain-serve — S3-compatible published-chain layout (/blocks, /state, /indexes) via s3rver
  2. @xyo-network/xl1-cli — api + producer + finalizer + mempool + indexer, publishing finalized blocks and index into that layout

Install

pnpm add -D @ariestools/chain-serve-local-s3

Pulls in @ariestools/aries-chain-serve, @xyo-network/xl1-cli, and @xyo-network/xl1-sdk as runtime dependencies.

Single-call usage

import { startLocalS3Chain } from '@ariestools/chain-serve-local-s3'

const chain = await startLocalS3Chain()

// chain.rpcUrl              http://127.0.0.1:<port>/rpc
// chain.apiPort
// chain.chainId
// chain.blockProducerWallet // path 0 of the insecure test mnemonic
// chain.s3Endpoint          s3rver origin
// chain.s3ReadUrls          { finalized, chainState, index }

await chain.stop()

Vitest setupFile (lifehash-style globals)

// test/setup/api-local-s3.ts
import { afterAll, beforeAll } from 'vitest'
import { registerLocalS3Chain } from '@ariestools/chain-serve-local-s3'

registerLocalS3Chain(
  { beforeAll, afterAll },
  { assignGlobals: true },
)

With assignGlobals: true, specs can read:

GlobalDescription
apiPortXL1 API port
rpcUrlhttp://127.0.0.1:<port>/rpc
chainIdLocal chain id
blockProducerWalletGenesis / producer path-0 account
s3ReadUrls{ finalized, chainState, index } read base URLs
s3Endpoints3rver base URL

Options

OptionDefault
apiPort8080 + VITEST_WORKER_ID (or free fallback)
chainIdlocal-dev fixture id
mnemonicinsecure test test … junk phrase
healthTimeoutMs120_000
assignGlobalsfalse
silenttrue (s3rver)
logXl1true (child logs → stderr)

Notes

  • The local API serves /rpc only (no REST datalake). Writers typically run in inline mode; body resolution on the read side is up to the test.
  • S3 credentials accepted by the layout: S3RVER / S3RVER (exported as S3_CREDENTIALS).
  • Parallel vitest workers get distinct preferred API ports via VITEST_WORKER_ID; Prometheus and health-check ports are disabled in the child config to avoid clashes.
  • If xl1 exits before its API answers, the thrown error carries the tail of its stderr, even with logXl1: false.

版本与发布记录

@ariestools/chain-serve-local-s3 共发布 11 个版本,首次发布于 2026/07/23;过去 12 个月发布了 11 个版本。

版本发布日期距今
0.3.0latest2026/10/318 天前
0.2.12026/10/2711 天前
0.2.02026/10/021 个月前
0.1.232026/09/141 个月前
0.1.222026/09/131 个月前
0.1.202026/08/302 个月前

关于 @ariestools/chain-serve-local-s3 的常见问题

@ariestools/chain-serve-local-s3 是什么?

One-call local XL1 test harness: published-chain S3 layout (s3rver) + xl1-cli (api/producer/finalizer/mempool/indexer)

如何安装 @ariestools/chain-serve-local-s3?

在项目目录运行 npm install @ariestools/chain-serve-local-s3,或使用 pnpm add / yarn add / bun add。

@ariestools/chain-serve-local-s3 支持 TypeScript 吗?

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

@ariestools/chain-serve-local-s3 支持 ESM 还是 CommonJS?

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

@ariestools/chain-serve-local-s3 需要什么版本的 Node.js?

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

@ariestools/chain-serve-local-s3 可以商用吗?

@ariestools/chain-serve-local-s3 使用 LGPL-3.0-only 许可。弱 Copyleft:作为库被调用时通常不要求开源你自己的代码,但修改库本身需以 LGPL 开源;前端打包合并后的适用边界存在不同理解。以上为概括,不构成法律意见,请以许可原文为准。

@ariestools/chain-serve-local-s3 的下载量有多少?

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

@ariestools/chain-serve-local-s3 还在维护吗?

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