def __init__(self, config): self._config = config self._eth_client = EthereumWrapper(config) tcf_home = os.environ.get("TCF_HOME", "../../") worker_reg_contract_file = tcf_home + "/" + \ config["ethereum"]["worker_registry_contract_file"] worker_reg_contract_address = \ config["ethereum"]["worker_registry_contract_address"] self._worker_reg_contract_instance,\ self._worker_reg_contract_instance_evt = self._eth_client\ .get_contract_instance( worker_reg_contract_file, worker_reg_contract_address) self._worker_registry = EthereumWorkerRegistryImpl(config) work_order_contract_file = tcf_home + "/" + \ config["ethereum"]["work_order_contract_file"] work_order_contract_address = \ config["ethereum"]["work_order_contract_address"] self._work_order_contract_instance,\ self._work_order_contract_instance_evt = self._eth_client\ .get_contract_instance( work_order_contract_file, work_order_contract_address) self._work_order_proxy = EthereumWorkOrderProxyImpl(config)
def __initialize(self, config): """ Initialize the parameters from config to instance variables. """ self.__eth_client = EthereumWrapper(config) tcf_home = environ.get("TCF_HOME", "../../../") contract_file_name = tcf_home + "/" + \ config["ethereum"]["direct_registry_contract_file"] contract_address = \ config["ethereum"]["direct_registry_contract_address"] self.__contract_instance = self.__eth_client.get_contract_instance( contract_file_name, contract_address)
def __initialize(self, config): """ Initialize the parameters from config to instance variables. Parameters: config Ethereum-specific configuration parameters to initialize """ self.__eth_client = EthereumWrapper(config) tcf_home = environ.get("TCF_HOME", "../../../") contract_file_name = tcf_home + "/" + \ config["ethereum"]["proxy_worker_registry_contract_file"] contract_address = \ config["ethereum"]["proxy_worker_registry_contract_address"] self.__contract_instance, self.__contract_instance_evt = \ self.__eth_client.get_contract_instance( contract_file_name, contract_address )