Skip to main content

Ethereum RPC client library for Python asyncio (PEP 3156)

Project description

Latest version released on PyPi Travis CI status Test coverage Documentation status

aioethereum

Ethereum RPC client library for the PEP 3156 Python event loop.

Features

ujson support Yes
uvloop support Yes
High-level APIs Yes
HTTP support Yes
Unix domain socket (IPC) support Yes
SSL/TLS support Yes
Tested CPython versions 3.4, 3.5, 3.6
Tested Geth versions 1.7.0
Implemented RPC apis admin, db, debug, eth, miner, net, personal, shh, txpool, web3

Usage examples

Simple high-level interface (through HTTP):

import asyncio
import aioethereum

loop = asyncio.get_event_loop()

async def go():
    client = await aioethereum.create_ethereum_client(
        'http://localhost:8545', loop=loop)
    val = await client.web3_clientVersion()
    print(val)

loop.run_until_complete(go())
# will print like 'Geth/v1.7.0-stable-6c6c7b2a/darwin-amd64/go1.9'

or via IPC

import asyncio
import aioethereum

loop = asyncio.get_event_loop()

async def go():
    client = await aioethereum.create_ethereum_client(
        'ipc://<path_to_unix_socket>', loop=loop)
    val = await client.web3_clientVersion()
    print(val)

loop.run_until_complete(go())
# will print like 'Geth/v1.7.0-stable-6c6c7b2a/darwin-amd64/go1.9'

Requirements

Note

ujson is preferred requirement. Pure C JSON encoder and decoder is implemented as well and can be used automatically when installed.

License

The aioethereum is offered under MIT license.

0.2.2 (2018-04-10)

0.2.1 (2017-10-08)

  • Add admin and debug management apis;
  • Add new tests;
  • Add uvloop support (python 3.5+ required);

0.2.0 (2017-10-05)

  • Add more docstrings to the code;
  • Add tests for all rpc methods;
  • Add admin and debug;
  • Fix error for unixsocket retring;
  • Fix unixsocket invalid loop for Python 3.4;
  • BaseAsyncIOClient._rpc marked as deprecated and will be removed in 0.3.0;

0.1.1 (2017-10-01)

  • Add sphinx docs;

0.1.0 (2017-09-30)

  • Initial release;
  • Ethereum client implemented;
  • WIP on RPC management.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
aioethereum-0.2.2-py3-none-any.whl (19.3 kB) Copy SHA256 hash SHA256 Wheel 3.4
aioethereum-0.2.2.tar.gz (12.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page