aioethereum¶
-
class
aioethereum.
AsyncIOHTTPClient
(host='127.0.0.1', port=8545, tls=False, timeout=60, *, loop=None)¶ Bases:
aioethereum.client.BaseAsyncIOClient
,aioethereum.management.RpcMixin
Creates AsyncIOHTTPClient client to communicate via HTTP(s).
Parameters: - host (str) – Host on ethereum node
- port (int) – Port on ethereum node
- tls (bool) – Use SSL connection
- timeout (int) – Total time of timeout call
- loop (EventLoop) – An optional event loop instance
(uses
asyncio.get_event_loop()
if not specified).
Returns: AsyncIOHTTPClient
instance.
-
class
aioethereum.
AsyncIOIPCClient
(reader, writer, unix_path, timeout=60, *, loop=None)¶ Bases:
aioethereum.client.BaseAsyncIOClient
,aioethereum.management.RpcMixin
Creates AsyncIOIPCClient client to communicate via IPC.
Parameters: - reader (
asyncio.streams.StreamReader
) – Instance of the stream reader - writer (
asyncio.streams.StreamWriter
) – Instance of the stream writer - unix_path (str) – Unix domain path
- timeout (int) – An optional total time of timeout call
- loop (EventLoop) – An optional event loop instance
(uses
asyncio.get_event_loop()
if not specified).
Returns: AsyncIOIPCClient
instance.- reader (
-
class
aioethereum.
BaseAsyncIOClient
¶ Bases:
abc.ABC
Abstract class for creating client.
-
rpc_call
(method, params=None, id_=None)¶ Implements RPC 2.0 call to node server.
Parameters: - method (str) – RPC node method
- params (list) – Input params for method
- id (str or int) – ID of current request
Returns: Response from RPC
-
-
coroutine
aioethereum.
create_ethereum_client
(uri, timeout=60, *, loop=None)¶ Create client to ethereum node based on schema.
Parameters: - uri (str) – Host on ethereum node
- timeout (int) – An optional total time of timeout call
- loop (EventLoop) – An optional event loop instance
(uses
asyncio.get_event_loop()
if not specified).
Returns: BaseAsyncIOClient
instance.