Skip to content

Commit d69f57b

Browse files
authored
Release/2.0.0 (#95)
* update readme to reflect new testnet * update PKG-INFO version to 1.2.0 * change version to 2.0.0, fix error in setup.py, add release script * remove PoA middleware (prev. used for goerli) * update long_description in setup.py
1 parent 7892c87 commit d69f57b

5 files changed

Lines changed: 57 additions & 7 deletions

File tree

PKG-INFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Metadata-Version: 2.1
22
Name: flashbots
3-
Version: 1.1.1
3+
Version: 2.0.0
44
Summary: flashbots client
55
Author: Georgios Konstantopoulos
6-
Author-email: me@gakonst.com
6+
Author-email: <me@gakonst.com>
77
Requires-Python: >=3.9,<4.0
88
Classifier: Programming Language :: Python :: 3
99
Classifier: Programming Language :: Python :: 3.9

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ poetry install
4242

4343
Tips: PyCharm has a poetry plugin
4444

45-
## Simple Goerli Example
45+
## Simple Testnet Example
4646

4747
See [examples/simple.py](./examples/simple.py) for environment variable definitions.
4848

4949
```sh
5050
poetry shell
5151
ETH_SENDER_KEY=<sender_private_key> \
52-
PROVIDER_URL=https://eth-goerli.alchemyapi.io/v2/<alchemy_key> \
52+
PROVIDER_URL=https://eth-holesky.g.alchemy.com/v2/<alchemy_key> \
5353
ETH_SIGNER_KEY=<signer_private_key> \
5454
python examples/simple.py
5555
```

flashbots/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def flashbot(
4848
"""
4949

5050
flashbots_provider = FlashbotProvider(signature_account, endpoint_uri)
51-
5251
flash_middleware = construct_flashbots_middleware(flashbots_provider)
5352
w3.middleware_onion.add(flash_middleware)
5453

release.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# make sure this is running in a poetry shell
4+
if [ -z "$VIRTUAL_ENV" ]; then
5+
echo "This script should be run from a poetry shell. Run 'poetry shell' and try again."
6+
echo "
7+
Alternatively, if you don't want to use poetry and know that you have python and dependencies configured correctly,
8+
set VIRTUAL_ENV in your shell to override this check."
9+
exit 1
10+
fi
11+
12+
# ensure twine and wheel are installed
13+
echo "Checking build requirements..."
14+
pip install twine wheel 1>/dev/null
15+
16+
# build the package
17+
python setup.py sdist bdist_wheel
18+
if [ $? -ne 0 ]; then
19+
echo "Failed to build package"
20+
exit 1
21+
fi
22+
echo "*********************************************************************"
23+
echo "Build successful."
24+
25+
# pick last two files in dist/ in case there are previous builds present
26+
files=(dist/*)
27+
files=("${files[@]: -2}")
28+
echo "Prepared files for upload:"
29+
for file in "${files[@]}"; do
30+
echo -e " - $file"
31+
done
32+
33+
# parse the version number from the first element of files
34+
libname="flashbots"
35+
version=$(echo "$files" | grep -oP "$libname-\d+\.\d+\.\d+")
36+
version=${version#"$libname-"}
37+
38+
# draw some lines to alert the user to their one last chance to exit
39+
for i in $(seq 1 69); do
40+
printf '*'
41+
sleep 0.013
42+
done; echo
43+
44+
echo "This is the point of no return."
45+
echo -e " package:\t$libname"
46+
echo -e " version:\t$version"
47+
echo "Press Enter to upload the package to PyPI."
48+
read -rs dummy
49+
50+
# upload the package
51+
twine upload "${files[@]}"

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
package_data = {"": ["*"]}
77

8-
install_requires = ["web3>=6,7"]
8+
install_requires = ["web3>=6,<7"]
99

1010
setup_kwargs = {
1111
"name": "flashbots",
1212
"version": "2.0.0",
1313
"description": "web3-flashbots.py",
14-
"long_description": '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`.\n\nTo apply correct headers we use the `flashbot` method which injects the correct header on POST.\n\n## Quickstart\n\n```python\nfrom eth_account.signers.local import LocalAccount\nfrom web3 import Web3, HTTPProvider\nfrom flashbots import flashbot\nfrom eth_account.account import Account\nimport os\n\nETH_ACCOUNT_SIGNATURE: LocalAccount = Account.from_key(os.environ.get("ETH_SIGNATURE_KEY"))\n\n\nw3 = Web3(HTTPProvider("http://localhost:8545"))\nflashbot(w3, ETH_ACCOUNT_SIGNATURE)\n```\n\nNow the `w3.flashbots.sendBundle` method should be available to you. Look in [examples/simple.py](./examples/simple.py) for usage examples.\n\n### Goerli\n\nTo use goerli, add the goerli relay RPC to the `flashbot` function arguments.\n\n```python\nflashbot(w3, ETH_ACCOUNT_SIGNATURE, "https://relay-goerli.flashbots.net")\n```\n\n## Development and testing\n\nInstall [poetry](https://python-poetry.org/)\n\nPoetry will automatically fix your venv and all packages needed.\n\n```sh\npoetry install\n```\n\nTips: PyCharm has a poetry plugin\n\n## Simple Goerli Example\n\nSee [examples/simple.py](./examples/simple.py) for environment variable definitions.\n\n```sh\npoetry shell\nETH_SENDER_KEY=<sender_private_key> \\nPROVIDER_URL=https://eth-goerli.alchemyapi.io/v2/<alchemy_key> \\nETH_SIGNER_KEY=<signer_private_key> \\npython examples/simple.py\n```\n\n## Linting\n\nIt\'s advisable to run black with default rules for linting\n\n```sh\nsudo pip install black # Black should be installed with a global entrypoint\nblack .\n```',
14+
"long_description": '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`.\n\nTo apply correct headers we use the `flashbot` method which injects the correct header on POST.\n\n## Quickstart\n\n```python\nfrom eth_account.signers.local import LocalAccount\nfrom web3 import Web3, HTTPProvider\nfrom flashbots import flashbot\nfrom eth_account.account import Account\nimport os\n\nETH_ACCOUNT_SIGNATURE: LocalAccount = Account.from_key(os.environ.get("ETH_SIGNATURE_KEY"))\n\n\nw3 = Web3(HTTPProvider("http://localhost:8545"))\nflashbot(w3, ETH_ACCOUNT_SIGNATURE)\n```\n\nNow the `w3.flashbots.sendBundle` method should be available to you. Look in [examples/simple.py](./examples/simple.py) for usage examples.\n\n### Testnet\n\nTo use an ethereum testnet, add the appropriate testnet relay RPC to the `flashbot` function arguments.\n\n```python\nflashbot(w3, ETH_ACCOUNT_SIGNATURE, "https://relay-holesky.flashbots.net")\n```\nCheck [flashbots docs](https://docs.flashbots.net/flashbots-auction/advanced/testnets#bundle-relay-urls) for up-to-date URLs.\n\n## Development and testing\n\nInstall [poetry](https://python-poetry.org/)\n\nPoetry will automatically fix your venv and all packages needed.\n\n```sh\npoetry install\n```\n\nTips: PyCharm has a poetry plugin\n\n## Simple Testnet Example\n\nSee [examples/simple.py](./examples/simple.py) for environment variable definitions.\n\n```sh\npoetry shell\nETH_SENDER_KEY=<sender_private_key> \\nPROVIDER_URL=https://eth-holesky.alchemyapi.io/v2/<alchemy_key> \\nETH_SIGNER_KEY=<signer_private_key> \\npython examples/simple.py\n```\n\n## Linting\n\nIt\'s advisable to run black with default rules for linting\n\n```sh\nsudo pip install black # Black should be installed with a global entrypoint\nblack .\n```',
1515
"long_description_content_type": "text/markdown",
1616
"author": "Georgios Konstantopoulos",
1717
"author_email": "me@gakonst.com",

0 commit comments

Comments
 (0)