diff --git a/gateway/gateway.py b/gateway/gateway.py index a363acd7f2a428f00d63f1fb1eb384f860af317e..2b6fe3111bc3d8ebea27902554a4d158a5effcbb 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)