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 fasteth
import 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 shell
You'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-push
Then:
pre-commit run --all-files
This 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
black
to 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
pytest
with verbose flag (if any python files have changed).
poetry build
It's that simple.