createNetwork method

Future<CreateNetworkOutput> createNetwork({
  1. required Framework framework,
  2. required String frameworkVersion,
  3. required MemberConfiguration memberConfiguration,
  4. required String name,
  5. required VotingPolicy votingPolicy,
  6. String? clientRequestToken,
  7. String? description,
  8. NetworkFrameworkConfiguration? frameworkConfiguration,
  9. Map<String, String>? tags,
})

Creates a new blockchain network using Amazon Managed Blockchain.

Applies only to Hyperledger Fabric.

May throw AccessDeniedException. May throw InternalServiceErrorException. May throw InvalidRequestException. May throw ResourceAlreadyExistsException. May throw ResourceLimitExceededException. May throw ThrottlingException. May throw TooManyTagsException.

Parameter framework : The blockchain framework that the network uses.

Parameter frameworkVersion : The version of the blockchain framework that the network uses.

Parameter memberConfiguration : Configuration properties for the first member within the network.

Parameter name : The name of the network.

Parameter votingPolicy : The voting rules used by the network to determine if a proposal is approved.

Parameter clientRequestToken : This is a unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than once. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the Amazon Web Services CLI.

Parameter description : An optional description for the network.

Parameter frameworkConfiguration : Configuration properties of the blockchain framework relevant to the network configuration.

Parameter tags : Tags to assign to the network.

Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.

For more information about tags, see Tagging Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide.

Implementation

Future<CreateNetworkOutput> createNetwork({
  required Framework framework,
  required String frameworkVersion,
  required MemberConfiguration memberConfiguration,
  required String name,
  required VotingPolicy votingPolicy,
  String? clientRequestToken,
  String? description,
  NetworkFrameworkConfiguration? frameworkConfiguration,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'Framework': framework.value,
    'FrameworkVersion': frameworkVersion,
    'MemberConfiguration': memberConfiguration,
    'Name': name,
    'VotingPolicy': votingPolicy,
    'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'Description': description,
    if (frameworkConfiguration != null)
      'FrameworkConfiguration': frameworkConfiguration,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/networks',
    exceptionFnMap: _exceptionFns,
  );
  return CreateNetworkOutput.fromJson(response);
}