fasteth is an asynchronous python abstraction layer for the Ethereum
JSON RPC. It biases towards using native python types and dataclasses to represent
Ethereum data, whilst remaining lightweight and making minimal assumptions.
The motivation for creating this is to provide fast, asynchronous, native python, access to the Ethereum JSON RPC. Extant python libraries are synchronous and provide additional abstraction which may not always be needed. This library favors speed and asynchronicity.
This project is still a work in progress.
TODO(These should be links)
This project aims to make it easy to make async requests and get responses back from the Ethereum JSON RPC. Here is a simple example:
pip install fastethimport asyncio
from fasteth import AsyncEthereumJSONRPC
async def do_requests():
async with AsyncEthereumJSONRPC() as rpc:
print(await rpc.network_version())
asyncio.run(do_requests())See the fastapi docs for a
great explanation of
async/concurrency. As an aside, fastapi was the inspiration for the name
fasteth.
PR your changes :).
You'll need poetry.
poetry install
poetry shellYou'll also need a running instance of ganache-cli and in should be started
with the argument --networkId 1337
Initial setup:
pre-commit install
pre-commit install --hook-type pre-pushThen:
pre-commit run --all-filesThis will run:
During commit
- Check if there are merge conflicts.
- Check if there are debug statements, we don't want those in checked in code
- Lint with
flake8. - Use
blackto format the code, modifies files in-place if the code in the changeset is not already black compliant and fails the hook.
During push
- All of the above runs also
pytestwith verbose flag (if any python files have changed).
poetry buildIt's that simple.