Beispiel #1
0
 def __update_organization_in_blockchain(self, org_id, metadata_uri):
     method_name = "changeOrganizationMetadataURI"
     positional_inputs = (web3.Web3.toHex(text=org_id),
                          ipfsuri_to_bytesuri(metadata_uri))
     transaction_hash = self.__make_trasaction(*positional_inputs,
                                               method_name=method_name)
     logger.info(
         f"transaction hash {transaction_hash} generated while registering organization "
         f"{org_id} in {self.__env_type} blockchain environment.")
     return transaction_hash
 def register_service_in_blockchain(self, org_id, service_id, metadata_uri):
     method_name = "createServiceRegistration"
     positional_inputs = (web3.Web3.toHex(text=org_id),
                          web3.Web3.toHex(text=service_id),
                          ipfsuri_to_bytesuri(metadata_uri))
     transaction_hash = self.__make_trasaction(*positional_inputs,
                                               method_name=method_name)
     logger.info(
         f"transaction hash {transaction_hash} generated while registering service {service_id} "
         f"in {self.__env_type} blockchain environment.")
     return transaction_hash