@dappnode/dappnodesdk

中文文档
0.3.56发布于 2026/11/10GPL-3.0TypeScriptES Module构建来源已验证近 30 天下载 2692

dappnodesdk is a tool to make the creation of new dappnode packages as simple as possible. It helps to initialize and publish in ethereum blockchain

原始使用文档
文档目录12 节
  1. Install
  2. DEMO
  3. Initialization
  4. Build
  5. Root and variant files
  6. Publish
  7. Troubleshooting
  8. Github Actions
  9. bump-upstream action
  10. Internal dependencies
  11. Development
  12. License

DAppNodeSDK

The DappnodeSDK dappnodesdk is a tool that makes creating and publishing new Dappnode packages as simple as possible. It helps to initialize, build, test, and publish the new package/repo to an APM tracked on the Ethereum Mainnet.

We have deployed a public APM (Aragon Package Manager) registry in which anyone can create their own APM repository: public.dappnode.eth

Install

$ npm install -g @dappnode/dappnodesdk

DEMO

Initialization

This command runs you through a setup wizard to begin creating the basic files for a new Dappnode Package Repo.

$ dappnodesdk init

Build

Only generates the IPFS Hash to be able to install it without needing to create the APM Repo

$ dappnodesdk build

Root and variant files

In a multi-variant package (--all_variants or --variants), each release is assembled from the package root and the variant directory (package_variants/<variant> by default):

  • dappnode_package.json and docker-compose.yml are deep-merged, with the variant overriding the root.
  • setup-wizard.* fields are merged by id, and notifications.yaml endpoints by correlationId. Within a matched entry, the variant's values override the root's, and an array from the variant (for example enum, conditions or alerts) replaces the root's array. The release contains exactly what was validated.
  • Single files (avatar, prometheus-targets.*, disclaimer.md, getting-started.md, setup.schema.json, setup-target.json, setup-ui.json, signature.json) are taken from the variant directory when it has one, and otherwise from the root.
  • Grafana dashboards (*grafana-dashboard.json) are collected from both the root and the variant.

Schema validation coerces some values (for example isBanner: "false" becomes false). The release ships the coerced value, and the build prints a warning in the "Validate files" step so the source file can be fixed.

Publish

It does the build of the image and shows the necessary transaction to be able to publish the package. The first time will create the repository but the rest will be updates of it.

To be able to update a repository you must be the authorized dev.

The script increases the current version of the repository based on the specified type (patch, minor, major), unless a version hasn't yet been published

For more information about versioning check semver

$ dappnodesdk publish < patch | minor | major >

Please take in account that the package version is not the internal version of the package you want to upload. We use Aragon package manager, and it only allows starting with version 1 and incrementing it one by one. Valid initial versions are 1.0.0, 0.1.0 or 0.0.1.

Troubleshooting

If your system does not find the binary dappnodesdk when running the command, please try the following alternative methods

  • Run with npx which may handle better global NPM packages
npx @dappnode/dappnodesdk <command>
  • Prefix the binary with the location of your global NPM package installation, for example:
~/.npm-packages/bin/dappnodesdk <command>

Github Actions

bump-upstream action

This Github Action automatically creates pull requests bumping the version to the latest released upstream version on DAppNode Packages. It then tests building the new bumped upstream version and automatically posts an IPFS hash if the build was successful so that the new version can be tested further with other Github Actions and by human testers.

Note: This action also requires a Pinata account with an API Access Token and a Github Personal Access Token stored in the repo's, individual's, or organization's secrets in order to work properly.

Sample Usage

.github/workflows/auto_check.yml

name: Bump upstream version

on:
  schedule:
    - cron: "00 */4 * * *"
  push:
    branches:
      - "master"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npx @dappnode/dappnodesdk github-action bump-upstream
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }}
          PINATA_SECRET_API_KEY: ${{ secrets.PINATA_SECRET_API_KEY }}

You must specify in the package manifest what upstream Github repo the package is tracking. Also indicate what build variable in the docker-compose file should be updated.

dappnode_package.json

{
  "name": "prysm.dnp.dappnode.eth",
  "upstreamVersion": "v1.0.0",
  "upstreamRepo": "prysmaticlabs/prysm",
  "upstreamArg": "UPSTREAM_VERSION"
}

docker-compose.yml

version: "3.4"
services:
  beacon-chain:
    build:
      args:
        UPSTREAM_VERSION: v1.0.0

Internal dependencies

The dappnode SDK ueses the following internal dependencies to avoid code duplication across the dappnodeSDK, DNP_DAPPMANAGER and sdk-publish modules:

  • @dappnode/types
  • @dappnode/schemas

In order to have a better developing experience these modules lives inside the DNP_DAPPMANAGER repository

Development

Use Node.js 22.13+ or Node.js 24+ (Node.js 20 reached end of life in April 2026), and install the exact locked dependencies with yarn install --frozen-lockfile.

  • yarn lint checks source and tests without changing files; yarn lint:fix applies automatic fixes.
  • yarn build checks and compiles the SDK.
  • yarn test runs deterministic regressions using temporary files, mocked Docker commands, and localhost HTTP servers. It does not need external credentials.
  • yarn test:integration runs the live Docker/IPFS/Ethereum tests and requires those services to be available.

Terminal builds show numbered package/architecture stages and recent complete log lines; uploads display a separate waiting-for-pinning phase after transmission.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details

版本与发布记录

@dappnode/dappnodesdk 共发布 173 个版本,首次发布于 2018/09/09;过去 12 个月发布了 5 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.56latest2026/11/101 天前
0.3.552026/08/242 个月前
0.3.542026/08/242 个月前
0.3.532026/07/163 个月前
0.3.522026/02/069 个月前
0.3.482025/11/041 年前

关于 @dappnode/dappnodesdk 的常见问题

@dappnode/dappnodesdk 是什么?

dappnodesdk is a tool to make the creation of new dappnode packages as simple as possible. It helps to initialize and publish in ethereum blockchain

如何安装 @dappnode/dappnodesdk?

在项目目录运行 npm install @dappnode/dappnodesdk,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 dappnodesdk,可以用 npx dappnodesdk 直接运行。

@dappnode/dappnodesdk 支持 TypeScript 吗?

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

@dappnode/dappnodesdk 支持 ESM 还是 CommonJS?

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

@dappnode/dappnodesdk 需要什么版本的 Node.js?

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

@dappnode/dappnodesdk 可以商用吗?

@dappnode/dappnodesdk 使用 GPL-3.0 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以 GPL-3.0 兼容许可开源,并附带专利与反锁定条款。仅内部使用不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

@dappnode/dappnodesdk 的下载量有多少?

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

@dappnode/dappnodesdk 还在维护吗?

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