Ejemplo n.º 1
0
def createInvokeProposalForBDD(ccSpec, chainID, signersCert, Mspid, type):
	"Returns a deployment proposal of chaincode type"
	lc_chaincode_invocation_spec = chaincode_pb2.ChaincodeInvocationSpec(chaincodeSpec = ccSpec)

	# Create
	ccHdrExt = chaincode_proposal_pb2.ChaincodeHeaderExtension(chaincodeID=ccSpec.chaincodeID)

	ccProposalPayload = chaincode_proposal_pb2.ChaincodeProposalPayload(Input=lc_chaincode_invocation_spec.SerializeToString())

	bootstrapHelper = bootstrap_util.BootstrapHelper(chainId=chainID)

	chainHdr = bootstrapHelper.makeChainHeader(type=common_dot_common_pb2.HeaderType.Value(type),
											   txID=bootstrap_util.GetUUID(), extension=ccHdrExt.SerializeToString())
	serializedIdentity = identities_pb2.SerializedIdentity(Mspid=Mspid, IdBytes=crypto.dump_certificate(crypto.FILETYPE_PEM, signersCert))


	sigHdr = bootstrapHelper.makeSignatureHeader(serializedIdentity.SerializeToString(), bootstrap_util.BootstrapHelper.getNonce())

	header = common_dot_common_pb2.Header(chainHeader=chainHdr, signatureHeader=sigHdr)

	# make proposal
	proposal = proposal_pb2.Proposal(header=header.SerializeToString(), payload=ccProposalPayload.SerializeToString())


	return proposal
Ejemplo n.º 2
0
def step_impl(context, ordererSystemChainId):
    directory = bootstrap_util.getDirectory(context)
    ordererBootstrapAdmin = bootstrap_util.getOrdererBootstrapAdmin(context)
    ordererBootstrapAdmin.setTagValue(ordererSystemChainId, bootstrap_util.GetUUID())
Ejemplo n.º 3
0
def step_impl(context, ordererSystemChainId):
    directory = bootstrap_util.getDirectory(context)
    ordererBootstrapAdmin = bootstrap_util.getOrdererBootstrapAdmin(context)
    ordererBootstrapAdmin.tags[ordererSystemChainId] = bootstrap_util.GetUUID()