Skip to content

Managed Blockchain

CloudMock emulates Amazon Managed Blockchain, supporting network creation, member and node management, and proposal voting.

OperationStatusNotes
CreateNetworkSupportedCreates a blockchain network
GetNetworkSupportedReturns network details
ListNetworksSupportedLists all networks
GetMemberSupportedReturns member details
ListMembersSupportedLists members of a network
CreateNodeSupportedCreates a peer node
GetNodeSupportedReturns node details
ListNodesSupportedLists nodes in a network
DeleteNodeSupportedDeletes a node
CreateProposalSupportedCreates a governance proposal
GetProposalSupportedReturns proposal details
VoteOnProposalSupportedCasts a vote on a proposal
ListProposalsSupportedLists proposals for a network
import { ManagedBlockchainClient, CreateNetworkCommand } from '@aws-sdk/client-managedblockchain';
const client = new ManagedBlockchainClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
const { NetworkId, MemberId } = await client.send(new CreateNetworkCommand({
Name: 'my-network',
Framework: 'HYPERLEDGER_FABRIC',
FrameworkVersion: '2.2',
VotingPolicy: { ApprovalThresholdPolicy: { ThresholdPercentage: 50, ProposalDurationInHours: 24, ThresholdComparator: 'GREATER_THAN' } },
MemberConfiguration: { Name: 'my-member', FrameworkConfiguration: { Fabric: { AdminUsername: 'admin', AdminPassword: 'Password123' } } },
}));
console.log(NetworkId);
import boto3
client = boto3.client('managedblockchain',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
response = client.create_network(
Name='my-network',
Framework='HYPERLEDGER_FABRIC',
FrameworkVersion='2.2',
VotingPolicy={'ApprovalThresholdPolicy': {'ThresholdPercentage': 50, 'ProposalDurationInHours': 24, 'ThresholdComparator': 'GREATER_THAN'}},
MemberConfiguration={'Name': 'my-member', 'FrameworkConfiguration': {'Fabric': {'AdminUsername': 'admin', 'AdminPassword': 'Password123'}}})
print(response['NetworkId'])
cloudmock.yml
services:
managedblockchain:
enabled: true
  • No actual blockchain network is provisioned
  • Nodes do not run Hyperledger Fabric or Ethereum
  • Proposal voting is tracked but does not trigger real governance actions