Python 是一个使用 PyO3 封装的 https://GitHub.com/bluealloy/revm/
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
暂无开放 Issues,或尚未同步最近议题。