Python wrapper around https://github.com/bluealloy/revm/ using PyO3
Python wrapper around https://github.com/bluealloy/revm/ using PyO3
pyrevm
Blazing-fast Python bindings to revm
make install
make testHere we show how you can fork from Ethereum mainnet and simulate
a transaction from vitalik.eth.
…There is also support for tracing:
from pyrevm import EVM
EVM(tracing=True)There is support for checkpoints:
from pyrevm import EVM
evm = EVM()
checkpoint = evm.snapshot()
evm.message_call(
caller=...,
to=...,
value=...,
)
evm.revert(checkpoint) # or: evm.commit() to clear all checkpointsNote: in contrast to the Rust library, the Python library does not automatically commit to database.
See more usage examples in the pytests.
We use Poetry for virtual environment management and Maturin as our Rust <> Python FFI build system. The Rust bindings are auto-generated from the macros provided by PyO3.
To build the library, run make build. To run the tests, run make test.
Note: If building for production, use make build-prod, else performance will be degraded.
To release to pypi, create a new github release. This will run the .github/workflows/release.yml action and publish source+binary wheels to pypi.
TODO
No open issues yet, or sync has not completed.