def print_service_metadata_from_registry(self): rez = self._get_service_registration() metadata_hash = bytesuri_to_hash(rez[2]) metadata = get_from_ipfs_and_checkhash(self._get_ipfs_client(), metadata_hash) metadata = metadata.decode("utf-8") metadata = mpe_service_metadata_from_json(metadata) self._printout(metadata.get_json_pretty())
def _get_service_metadata_from_registry(self): rez = self._get_service_registration() metadata_hash = bytesuri_to_hash(rez["metadataURI"]) metadata = get_from_ipfs_and_checkhash(self._get_ipfs_client(), metadata_hash) metadata = metadata.decode("utf-8") metadata = mpe_service_metadata_from_json(metadata) return metadata
def _get_service_metadata_from_registry(self): params = [ type_converter("bytes32")(self.args.organization), type_converter("bytes32")(self.args.service) ] rez = self.call_contract_command("Registry", "getServiceRegistrationByName", params) if (rez[0] == False): raise Exception("Cannot find Service %s in Organization %s" % (self.args.service, self.args.organization)) metadata_hash = bytesuri_to_hash(rez[2]) metadata_json = get_from_ipfs_and_checkhash(self._get_ipfs_client(), metadata_hash) metadata = mpe_service_metadata_from_json(metadata_json) return metadata