CDK construct to deploy a Hyperledger Fabric network running on Amazon Managed Blockchain
Project description
Hyperledger Fabric on Amazon Managed Blockchain
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
- Jud Neer (judneer@amazon.com)
- Vignesh Rajasingh (vrajasin@amazon.com)
License
This project is licensed under the MIT-0 License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cdklabs_cdk_hyperledger_fabric_network-0.8.726.tar.gz
.
File metadata
- Download URL: cdklabs_cdk_hyperledger_fabric_network-0.8.726.tar.gz
- Upload date:
- Size: 74.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc1fa899da98b52996d6d5331027da6d9cedebb938067e0abc509102b6a3dd16 |
|
MD5 | 3ae6fbe450410543bb0eb774456d5ac9 |
|
BLAKE2b-256 | 8c089c38ebde691e0fc3a0abb7e03ea961370f565ffab00ed4745d152aac114b |
File details
Details for the file cdklabs.cdk_hyperledger_fabric_network-0.8.726-py3-none-any.whl
.
File metadata
- Download URL: cdklabs.cdk_hyperledger_fabric_network-0.8.726-py3-none-any.whl
- Upload date:
- Size: 72.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc3fe7c7aa7534fdbbed062657d9fe0700281d13396471b91868cbe49556ea97 |
|
MD5 | 3d595d5afd84a3f462630669d01ec32b |
|
BLAKE2b-256 | 4a3ed847c91262d5ee4215077d6b0bdba079d193e54871db168f056e202855be |