Пример #1
0
 def send_install_proposal(self, tx_context, peers, scheduler=None):
     """ Send install proposal
     Args:
         tx_context: transaction context
         peers: peers
         scheduler: rx scheduler
     Returns: A set of proposal_response
     """
     return utils.send_install_proposal(tx_context, peers, scheduler)
Пример #2
0
    async def install(self,
                      requestor,
                      peers,
                      cc_path,
                      cc_version,
                      cc_type=CC_TYPE_GOLANG,
                      packaged_cc=None,
                      transient_map=None):
        """
        Install chaincode to given peers by requestor role

        :param requestor: User role who issue the request
        :param peers: List of  peer name and/or Peer to install
        :param cc_path: chaincode path
        :param cc_version: chaincode version
        :param cc_type: language type of the chaincode
        :param packaged_cc: packaged chaincode
        :param transient_map: transient map
        :return: True or False
        """
        target_peers = self._client.get_target_peers(peers)

        tran_prop_req = create_tx_prop_req(CC_INSTALL,
                                           cc_path,
                                           cc_type,
                                           self._name,
                                           cc_version,
                                           packaged_cc=packaged_cc,
                                           transient_map=transient_map)
        tx_context = create_tx_context(requestor, requestor.cryptoSuite,
                                       tran_prop_req)

        responses, proposal, header = utils.send_install_proposal(
            tx_context, target_peers)
        res = await asyncio.gather(*responses)
        return res