@dappnode/toolkit

中文文档
0.1.21发布于 2024/01/27ISCES Module近 30 天下载 2371

The DappNode Toolkit is a collection of shared smart contracts, types, and utility functions that can be used across various DappNode projects. This toolkit aims to simplify development by providing reusable code and a consistent set of interfaces and typ

原始使用文档
文档目录10 节
  1. Considerations
  2. Integrations
  3. TheGraph
  4. Truffle
  5. Typechain
  6. Modules
  7. Testing
  8. Roadmap
  9. Contributing
  10. License

DappNode Toolkit

This repository contains a collection of modules and tools designed to simplify interaction with the Aragon Package Manager (Registry and Repository) and the Dappnode Directory Smart Contract.

Considerations

Please note that this NPM package is not compatible with browsers, as it includes Node.js native file system modules.

Integrations

The toolkit offers multiple integrations with various tools available in the JavaScript ecosystem, aiming to streamline and enhance the usage of Dappnode Smart Contracts:

TheGraph

The Registry Smart Contract interacts with both the public and dnp Registries Smart Contracts. There are two methods for obtaining Dappnode packages from either the dnp or public Registries Smart Contracts: scanning the blockchain for the NewRepo event, and using TheGraph to collect all the events for each Smart Contract.

Two subgraphs have been deployed to facilitate the retrieval of these events.

Truffle

All the smart contracts are compiled using Truffle. These compilations are subsequently utilized by Ethers and TypeChain.

Typechain

To ensure proper typing in TypeScript, the TypeChain tool generates types from the compiled Smart Contracts created by Truffle.

Modules

  • Registry: This module manages the registries available in Dappnode: dnp.dappnode.eth and public.dappnode.eth. The dnp registry is maintained by the Dappnode organization, while the public registry is accessible to anyone wishing to publish their own package. The Registry module utilizes TheGraph, among other tools, to search for NewRepo events emitted by each Smart Contract Registry. It also fetches all the Dappnode packages under each registry and utilizes the Repository module to retrieve all the Dappnode package release assets.
  • Directory: This module interacts with the Dappnode Directory Smart Contract, which defines the Dappnode packages available in the DappStore for both dnp and public Dappnode packages. The Smart Contract determines the whitelist of Dappnode packages, their position, and the featured index.
  • Repository: This module manages the Repository Smart Contract to which each Dappnode package ENS resolves. It enables fetching IPFS hashes based on provided versions, resolving these IPFS hashes using an IPFS URL, and supports both IPFS gateways and APIs. Content trust verification for IPFS gateways is also available (with dag).
  • Typechain: This module contains the Smart Contract types created with TypeChain and the compiled Smart Contracts by Truffle. It allows for typed Smart Contracts using the Ethers library.

Testing

Tests are available for the following Smart Contracts modules:

  • Registry: Tests the integration with TheGraph to fetch all the Dappnode packages for each registry: dnp and public.
  • Directory: Tests the Directory Smart Contract by fetching its content.
  • Repository: Tests random Dappnode packages by fetching IPFS hashes with different versions and retrieving their content on an IPFS node.

Roadmap

To establish a clear roadmap for this toolkit, it would be beneficial to have a

Contributing

We welcome contributions to the DappNode Toolkit. Please refer to the CONTRIBUTING.md file for guidelines on how to contribute.

License

The DappNode Toolkit is released under the MIT License. For more information, please refer to the LICENSE file.

  • Responsibles:
    • @pablomendezroyo
    • @dappnodedev
    • @Marketen
    • @3alpha

版本与发布记录

@dappnode/toolkit 共发布 20 个版本,首次发布于 2023/05/11;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.21latest2024/01/272 年前
0.1.202023/07/103 年前
0.1.192023/06/093 年前
0.1.182023/05/243 年前
0.1.172023/05/243 年前
0.1.162023/05/233 年前

关于 @dappnode/toolkit 的常见问题

@dappnode/toolkit 是什么?

The DappNode Toolkit is a collection of shared smart contracts, types, and utility functions that can be used across various DappNode projects. This toolkit aims to simplify development by providing reusable code and a consistent set of interfaces and typ

如何安装 @dappnode/toolkit?

在项目目录运行 npm install @dappnode/toolkit,或使用 pnpm add / yarn add / bun add。

@dappnode/toolkit 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/dappnode__toolkit 是否存在。

@dappnode/toolkit 支持 ESM 还是 CommonJS?

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

@dappnode/toolkit 可以商用吗?

@dappnode/toolkit 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

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

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

@dappnode/toolkit 还在维护吗?

最新版本 0.1.21 发布于 2024/01/27(2 年前);至今共发布 20 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/05/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。