'Adding member to existing hyperledger Fabric 1.2 network on amazonmanaged blockchain

I am exploring amazon managed blockchain. Network (Hyperledger Fabric 1.2) is created, first member is added, peer node is added and VPC Service endpoint is also created. A sample chainnode is invoked and I am also able to query the chain node. Now I want to add another member in the existing network, but I am unable to do so. Instead of using amazon managed blockchain dashboard, I am using AWS CLI and using below command.

Using username "ec2-user".
Authenticating with public key "imported-openssh-key"
       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|
https://aws.amazon.com/amazon-linux-2/
aws managedblockchain create-network --network-configuration Name='nmynetwork, Description=mynetwork, Framework=HYPERLEDGER_FABRIC,FrameworkVersion=1.2' --member-configuration 'Name=mynetworkmember2, Description=mynetworkmember2, FrameworkConfiguration={Fabric={AdminUsername=adminxxxx, AdminPassword=Adminxxxx}}'

But CLI is showing below error.

An error occurred (ResourceLimitExceededException) when calling the CreateNetwork operation (reached max retries: 4): You cannot create a new network. You at any given time.

Then I tried to add member in a new network. But error is similar.

aws managedblockchain create-network --network-configuration Name='newnetwork, Description=mynetwork, Framework=HYPERLEDGER_FABRIC,FrameworkVersion=1.2' --member-configuration 'Name=mynetworkmember2, Description=mynetworkmember2, FrameworkConfiguration={Fabric={AdminUsername=adminxxx, AdminPassword=Adminxxx}}'

Result

An error occurred (ResourceLimitExceededException) when calling the CreateNetwork operation (reached max retries: 4): You cannot create a new network. You at any given time.

I have also checked AWS documentation, they have also mentioned same "create-network" command to create a network and add member in the network.

When you create the network, you also must create the first member in the network using the --member-configuration option. Because Managed Blockchain creates a certificate authority (CA) with each member that handles authenticating users, you must provide a user name and password for the administrator. You specify these using the AdminUsername and AdminPassword properties. The password you use must be a minimum of 8 characters, and contain at least one number and one capital letter. Remember the user name and password. You need them later any time you create users and resources that need to authenticate.

Create the network using an AWS CLI command similar to the following:

aws managedblockchain create-network

Can anyone assist me in this regard? Thanks in advance.



Solution 1:[1]

You know that amazon managed block chain is in preview at this stage and only available in 1 region us-east-1. AWS is only allowing one network per AWS account. See limitations highlighted by AWS. known-issues-limits

Availability is limited to us-east-1.
Hyperledger Fabric is the only supported blockchain framework.
The maximum number of networks per AWS account is 1.
The maximum number of networks that an AWS account can be a member of is 1.
The maximum number of members per network is 5.
The maximum number of peer nodes per member is 1.
Peer nodes are limited to the bc.t3.small instance type.

Instead of using create-network(as you can not create more than one network in one AWS account), you need to use create-member command in AWS CLI. Here is the SYNOPSIS of create-member command.

NAME
       create-member -    
DESCRIPTION
       Creates a member within the blockchain network.
       See also: AWS API Documentation    
       See 'aws help' for descriptions of global parameters.    
SYNOPSIS
            create-member
          [--client-request-token <value>]
          --network-id <value>
          --member-configuration <value>
          [--cli-input-json <value>]
          [--generate-cli-skeleton <value>]    
OPTIONS
       --client-request-token (string)
          An idempotency token. Set to an arbitrary unique value.    
       --network-id (string)
          The unique identifier of the network in which the member is created.    
       --member-configuration (structure)
          Member configuration parameters.    
       Shorthand Syntax:    
          Name=string,Description=string,FrameworkConfiguration={Fabric={AdminUsername=string,AdminPassword=string}}    
       JSON Syntax:    
          {
            "Name": "string",
            "Description": "string",
            "FrameworkConfiguration": {
              "Fabric": {
                "AdminUsername": "string",
                "AdminPassword": "string"
              }
            }
          }    
       --cli-input-json  (string) Performs service operation based on the JSON
       string provided. The JSON string follows the format provided by  --gen-
       erate-cli-skeleton.  If  other  arguments  are  provided on the command
       line, the CLI values will override the JSON-provided values. It is  not
       possible to pass arbitrary binary values using a JSON-provided value as
       the string will be taken literally.    
       --generate-cli-skeleton (string) Prints a  JSON  skeleton  to  standard
       output without sending an API request. If provided with no value or the
       value input, prints a sample input JSON that can be used as an argument
       for  --cli-input-json.  If provided with the value output, it validates
       the command inputs and returns a sample output JSON for that command.    
       See 'aws help' for descriptions of global parameters.    
OUTPUT
       MemberId -> (string)
          The unique identifier of the member.

Alternatively, you can use aws managed blockchain dashboard to add member in existing network. See attached screenshot. enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pang