CDK Hyperledger Fabric Network
raw JSON → 0.8.990 verified Sat May 09 auth: no python
AWS CDK construct library (version 0.8.990) to deploy a Hyperledger Fabric network running on Amazon Managed Blockchain. Targeted at Python 3.9+ and follows a weekly release cadence.
pip install cdklabs-cdk-hyperledger-fabric-network Common errors
error ModuleNotFoundError: No module named 'cdklabs' ↓
cause Missing dependency or wrong Python environment.
fix
pip install cdklabs-cdk-hyperledger-fabric-network
error ImportError: cannot import name 'HyperledgerFabricNetwork' from 'cdklabs' ↓
cause Incorrect import path; using base cdklabs package instead of submodule.
fix
Use from cdklabs.cdk_hyperledger_fabric_network import HyperledgerFabricNetwork
Warnings
breaking Version 0.8.x dropped support for NetworkVersion.V1_2; use V1_4 only. ↓
fix Set network_version=NetworkVersion.V1_4
gotcha Module import path uses underscores (cdk_hyperledger_fabric_network) not hyphens, but package name has hyphens. ↓
fix Use from cdklabs.cdk_hyperledger_fabric_network import ...
deprecated Property 'vpc' is deprecated in 0.7+; use 'vpc_config' instead. ↓
fix Use vpc_config=VpcConfig(...) (imported from same module)
Imports
- HyperledgerFabricNetwork
from cdklabs.cdk_hyperledger_fabric_network import HyperledgerFabricNetwork
Quickstart
from aws_cdk import App, Stack
from aws_cdk import aws_kms as kms
from cdklabs.cdk_hyperledger_fabric_network import HyperledgerFabricNetwork, NetworkVersion
app = App()
stack = Stack(app, "TestStack")
HyperledgerFabricNetwork(
stack,
"MyNetwork",
network_version=NetworkVersion.V1_4,
member_name="Org1",
key_material=kms.Key.from_lookup(stack, "Key", alias_name="alias/fabric-key"),
)
app.synth()