-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add pypi files, update README, set version to 1.0.0 * fix package typo * add build files to gitignore
- Loading branch information
1 parent
08dd94c
commit dde4a7d
Showing
5 changed files
with
111 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
__pycache__ | ||
*.pyc | ||
.idea | ||
build/ | ||
dist/ | ||
flashbots.egg-info/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Metadata-Version: 2.1 | ||
Name: flashbots | ||
Version: 1.0.0 | ||
Summary: flashbots client | ||
Author: Georgios Konstantopoulos | ||
Author-email: [email protected] | ||
Requires-Python: >=3.9,<4.0 | ||
Classifier: Programming Language :: Python :: 3 | ||
Classifier: Programming Language :: Python :: 3.9 | ||
Requires-Dist: web3 (>=5.22.0,<6) | ||
Description-Content-Type: text/markdown | ||
|
||
This library works by injecting 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 FlashbotProvider which injects the correct header on post. | ||
|
||
## Example | ||
|
||
```python | ||
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_SIGNATURE_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 | ||
|
||
# Development and testing | ||
|
||
Setup and run (mev-)geth with Websocket support: | ||
|
||
```sh | ||
geth --http --http.api eth,net,web3,txpool --syncmode full | ||
``` | ||
|
||
Install [poetry](https://python-poetry.org/) | ||
|
||
Poetry will automatically fix your venv and all packages needed | ||
|
||
```sh | ||
poetry install | ||
``` | ||
|
||
Tips: PyCharm has a poetry plugin | ||
|
||
## Linting | ||
|
||
It's advisable to run black with default rules for linting | ||
|
||
```sh | ||
sudo pip install black # Black should be installed with a global entrypoint | ||
black . | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[tool.poetry] | ||
authors = ["Georgios Konstantopoulos <[email protected]>", "Nikolas Papaioannou <[email protected]>"] | ||
name = "flashbots" | ||
version = "1.0.1" | ||
version = "1.0.0" | ||
description = "" | ||
readme = "README.md" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -*- coding: utf-8 -*- | ||
from setuptools import setup | ||
|
||
packages = \ | ||
['flashbots'] | ||
|
||
package_data = \ | ||
{'': ['*']} | ||
|
||
install_requires = \ | ||
['web3>=5.22.0,<6'] | ||
|
||
setup_kwargs = { | ||
'name': 'flashbots', | ||
'version': '1.0.0', | ||
'description': 'web3-flashbots.py', | ||
'long_description': '\nThis library works by injecting a new module in the Web3.py instance, which allows\nsubmitting "bundles" of transactions directly to miners. This is done by also creating\na middleware which captures calls to `eth_sendBundle` and `eth_callBundle`, and sends\nthem to an RPC endpoint which you have specified, which corresponds to `mev-geth`. \nTo apply correct headers we use FlashbotProvider which injects the correct header on post \n\n## Example\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` for usage examples\n\n# Development and testing\n\nSetup and run (mev-)geth with Websocket support:\n```\ngeth --http --http.api eth,net,web3,txpool --syncmode full\n```\n\nInstall [poetry](https://python-poetry.org/)\n\nPoetry will automatically fix your venv and all packages needed\n```\npoetry install\n```\nTips: PyCharm has a poetry plugin\n\n\n## Linting\nIt\'s advisable to run black with default rules for linting\n\n```\nsudo pip install black # Black should be installed with a global entrypoint\nblack .\n```\n\n', | ||
'long_description_content_type': 'text/markdown', | ||
'author': 'Georgios Konstantopoulos', | ||
'author_email': '[email protected]', | ||
'maintainer': None, | ||
'maintainer_email': None, | ||
'url': None, | ||
'packages': packages, | ||
'package_data': package_data, | ||
'install_requires': install_requires, | ||
'python_requires': '>=3.9,<4.0', | ||
} | ||
|
||
|
||
setup(**setup_kwargs) |