Giter VIP home page Giter VIP logo

cdk-hyperledger-fabric-network's Introduction

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.

cdk-hyperledger-fabric-network's People

Contributors

cdklabs-automation avatar iliapolo avatar lordjabez avatar mrgrain avatar trinitykey avatar vponselvan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cdk-hyperledger-fabric-network's Issues

Move all node configuration to constructor

Due to an issue with CDK (aws/aws-cdk#18237) the permissions around the AwsCustomResource used to perform Hyperledger functions have to be broader than necessary, and not scoped to the constructs where they're used.

When the CDK bug is fixed, the code here can be cleaned up accordingly, see https://github.com/cdklabs/cdk-hyperledger-fabric-network/blob/main/src/network.ts#L353-L365. Specifically the nodes can completely set themselves up in their constructor and not require a subsequent call, and the permissions can be moved out of network.ts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.