def chaincode_install(self, peer_name, cc_name):
     peer = find_node(self.orgs_map, peer_name)
     support = api_support.cli_api_support(peer.Org.admin(),
                                           self.api_cache_dir)
     cc = self.chaincode(cc_name)
     if support.peer(peer).install_chaincode(cc) is None:
         print("Chaincode: %s.%s has already on node: %s" %
               (cc.Name, cc.Version, peer_name))
    def __init__(self, orgs_map, **config):
        super(SystemChannel, self).__init__()
        self.update(config)

        self.Orgs = [orgs_map[name] for name in self.Organizations]
        self.Ords = [find_node(orgs_map, orderer) for orderer in self.Orderers]
Exemple #3
0
 def __get_node__(self, name):
     return find_node(self.Orgs, name)
 def chaincode_package_id(self, peer_name, cc_name, cc_version):
     peer = find_node(self.orgs_map, peer_name)
     support = api_support.cli_api_support(peer.Org.admin(),
                                           self.api_cache_dir)
     return support.peer(peer).query_chaincode_package_id(
         cc_name, cc_version)
 def channel_list(self, peer_name):
     peer = find_node(self.orgs_map, peer_name)
     support = api_support.cli_api_support(peer.Org.admin(),
                                           self.api_cache_dir)
     support.peer(peer).list_channels()
 def chaincode_list_installed(self, peer_name):
     peer = find_node(self.orgs_map, peer_name)
     support = api_support.cli_api_support(peer.Org.admin(),
                                           self.api_cache_dir)
     support.peer(peer).list_installed_chaincodes()
 def status(self, node_name=None):
     if node_name is None:
         self.sys_channel.status()
     else:
         node = find_node(self.orgs_map, node_name)
         node.deploy_handler.display()
 def chaincode_package(self, peer_name, cc_name):
     peer = find_node(self.orgs_map, peer_name)
     support = api_support.cli_api_support(peer.Org.admin(),
                                           self.api_cache_dir)
     support.peer(peer.deploy_handler.Address).chaincode_package(
         self.chaincodes[cc_name], self.chaincode_cache_dir)
 def chaincode_list_installed(self, peer_name):
     peer = find_node(self.orgs_map, peer_name)
     support = api_support.cli_api_support(peer.Org.admin(),
                                           self.api_cache_dir)
     support.peer(peer.deploy_handler.Address).chaincode_installed()
 def channel_join(self, ch_name, peer_name, orderer_name):
     peer = find_node(self.orgs_map, peer_name)
     orderer = find_node(self.orgs_map, orderer_name)
     support = api_support.cli_api_support(
         peer.Org.admin(), self.__channel_cache_dir__(ch_name))
     self.__channel__(ch_name).join(support, peer, orderer)
 def channel_create(self, ch_name, orderer_name):
     orderer = find_node(self.orgs_map, orderer_name)
     support = api_support.cli_api_support(
         orderer.Org.admin(), self.__channel_cache_dir__(ch_name))
     self.__channel__(ch_name).create(support, orderer)