From 74cfb49b6b3e49c4b0c514042866bc0bd126d7df Mon Sep 17 00:00:00 2001 From: adorda <angdmz@gmail.com> Date: Fri, 19 Jul 2019 16:59:35 -0300 Subject: [PATCH] conexion ipc y signers count --- gateway/gateway.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gateway/gateway.py b/gateway/gateway.py index a363acd..2b6fe31 100644 --- a/gateway/gateway.py +++ b/gateway/gateway.py @@ -17,6 +17,11 @@ def generate_http_gateway(url, is_poa): return Gateway(provider_generator, is_poa) +def generate_ipc_gateway(url, is_poa): + provider_generator = IPCProviderGenerator(url) + return Gateway(provider_generator, is_poa) + + class HTTPProviderGenerator: def __init__(self, url): @@ -26,6 +31,15 @@ class HTTPProviderGenerator: return Web3.HTTPProvider(self.url) +class IPCProviderGenerator: + + def __init__(self, ipc_path): + self.ipc_path = ipc_path + + def generate_provider(self): + return Web3.IPCProvider(self.ipc_path) + + class InvalidTransactionException(Exception): pass @@ -154,7 +168,7 @@ class Gateway: return txs def get_signers_count(self): - return 10 + return self.w3.manager.request_blocking("clique_getSigners", []) def get_smart_contract_bytecode(self, smart_contract_address): return self.w3.eth.getCode(smart_contract_address) -- GitLab