flashbots/web3-flashbots
flashbots/web3-flashbots has 430 GitHub stars and 212 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-21 01:18 UTC. Last push 2024-07-31.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
Web3.py plugin for using Flashbots' bundle APIs
웹 및 앱README.md
Originalweb3-flashbots
This library works by injecting flashbots as a new module in the Web3.py instance, which allows submitting "bundles" of transactions directly to miners. This is done by also creating a middleware which captures calls to eth_sendBundle and eth_callBundle, and sends them to an RPC endpoint which you have specified, which corresponds to mev-geth.
To apply correct headers we use the flashbot method which injects the correct header on POST.
Quickstart
from eth_account.signers.local import LocalAccount
from web3 import Web3, HTTPProvider
from flashbots import flashbot
from eth_account.account import Account
import os
ETH_ACCOUNT_SIGNATURE: LocalAccount = Account.from_key(os.environ.get("ETH_SIGNER_KEY"))
w3 = Web3(HTTPProvider("http://localhost:8545"))
flashbot(w3, ETH_ACCOUNT_SIGNATURE)
Now the w3.flashbots.sendBundle method should be available to you. Look in examples/simple.py for usage examples.
Goerli
To use goerli, add the goerli relay RPC to the flashbot function arguments.
flashbot(w3, ETH_ACCOUNT_SIGNATURE, "https://relay-goerli.flashbots.net")
Development and testing
Install poetry
Poetry will automatically fix your venv and all packages needed.
poetry install
Tips: PyCharm has a poetry plugin
Simple Testnet Example
See examples/simple.py for environment variable definitions.
poetry shell
ETH_SENDER_KEY=<sender_private_key> \
PROVIDER_URL=https://eth-holesky.g.alchemy.com/v2/<alchemy_key> \
ETH_SIGNER_KEY=<signer_private_key> \
python examples/simple.py
Linting
It's advisable to run black with default rules for linting
sudo pip install black # Black should be installed with a global entrypoint
black .