@cdklabs/cdk-hyperledger-fabric-network

中文文档
0.8.990发布于 2025/10/17MIT-0TypeScriptCommonJS零依赖构建来源已验证近 30 天下载 1851

CDK construct to deploy a Hyperledger Fabric network running on Amazon Managed Blockchain

原始使用文档
文档目录7 节
  1. Installation
  2. Usage
  3. References
  4. Contributing
  5. Security
  6. Authors
  7. License

Hyperledger Fabric on Amazon Managed Blockchain

license release npm:version PyPi:version Maven:version NuGet:version

This repository contains a CDK construct to deploy a Hyperledger Fabric network running on Amazon Managed Blockchain. It builds out a member and its nodes, a VPC and associated endpoint to access them, and a set of users enrolled on the network.

The following functionality is planned for future releases:

  • Create channels on nodes
  • Instantiate chaincode on nodes

Installation

Note that this construct requires AWS CDK v2.

JavaScript

npm install --save @cdklabs/cdk-hyperledger-fabric-network

Python

pip3 install cdklabs.cdk-hyperledger-fabric-network

Java

Add the following to pom.xml:

<dependency>
  <groupId>io.github.cdklabs</groupId>
  <artifactId>cdk-hyperledger-fabric-network</artifactId>
</dependency>

.NET

dotnet add package Cdklabs.CdkHyperledgerFabricNetwork

Usage

A minimally complete deployment is shown below. By default, a standard network will be created running Hyperledger Fabric 1.4 with a single bc.t3.small node.

import { Stack, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { HyperledgerFabricNetwork } from '@cdklabs/cdk-hyperledger-fabric-network';

class MyStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);
    new HyperledgerFabricNetwork(this, 'Example', {
      networkName: 'MyNetwork',
      memberName: 'MyMember',
    });
  }
}

The equivalent Python code is as follows:

from aws_cdk import Stack
from cdklabs.cdk_hyperledger_fabric_network import HyperledgerFabricNetwork

class MyStack(Stack):
    def __init__(self, scope, id, **kwargs):
        super().__init__(scope, id, **kwargs)
        HyperledgerFabricNetwork(
            self, 'Example',
            network_name='MyNetwork',
            member_name='MyMember',
        )

The following is a more complex instantiation illustrating some of the options available.

new HyperledgerFabricNetwork(this, 'Example', {
  networkName: 'MyNetwork',
  networkDescription: 'This is my Hyperledger Fabric network',
  memberName: 'MyMember',
  networkDescription: 'This is my Hyperledger Fabric member',
  frameworkVersion: hyperledger.FrameworkVersion.VERSION_1_2,
  proposalDurationInHours: 48,
  thresholdPercentage: 75,
  nodes: [
    {
      availabilityZone: 'us-east-1a',
      instanceType: hyperledger.InstanceType.STANDARD5_LARGE,
    },
    {
      availabilityZone: 'us-east-1b',
      instanceType: hyperledger.InstanceType.STANDARD5_LARGE,
    },
  ],
  users: [
    { userId: 'AppUser1', affilitation: 'MyMember' },
    { userId: 'AppUser2', affilitation: 'MyMember.department1' },
  ],
});

See the API Documentation for details on all available input and output parameters.

References

Contributing

Pull requests are welcomed. Please review the Contributing Guidelines and the Code of Conduct.

Security

See CONTRIBUTING for more information.

Authors

License

This project is licensed under the MIT-0 License. See the LICENSE file for details.

版本与发布记录

@cdklabs/cdk-hyperledger-fabric-network 共发布 994 个版本,首次发布于 2022/07/30;过去 12 个月发布了 0 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.8.990latest2025/10/171.1 年前
0.8.9892025/10/161.1 年前
0.8.9882025/10/151.1 年前
0.8.9872025/10/141.1 年前
0.8.9862025/10/121.1 年前
0.8.9852025/10/111.1 年前

关于 @cdklabs/cdk-hyperledger-fabric-network 的常见问题

@cdklabs/cdk-hyperledger-fabric-network 是什么?

CDK construct to deploy a Hyperledger Fabric network running on Amazon Managed Blockchain

如何安装 @cdklabs/cdk-hyperledger-fabric-network?

在项目目录运行 npm install @cdklabs/cdk-hyperledger-fabric-network,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:aws-cdk-lib(^2.24.1)、constructs(^10.0.5)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cdklabs/cdk-hyperledger-fabric-network 支持 TypeScript 吗?

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

@cdklabs/cdk-hyperledger-fabric-network 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@cdklabs/cdk-hyperledger-fabric-network 可以商用吗?

@cdklabs/cdk-hyperledger-fabric-network 使用 MIT-0 许可。声明的许可为 MIT-0,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@cdklabs/cdk-hyperledger-fabric-network 的下载量有多少?

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

@cdklabs/cdk-hyperledger-fabric-network 还在维护吗?

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