# Quick Start
Silverback lets you create and deploy your own Python bots that respond to on-chain events.
The Silverback library leverages the [Ape](https://docs.apeworx.io/ape/stable/userguides/quickstart) development framework as well as it's ecosystem of plugins and packages to enable you to develop simple-yet-sophisticated automated bots that can listen and respond to live chain data.
Silverback bots are excellent for use cases that involve continuously monitoring and responding to on-chain events, such as newly confirmed blocks or contract event logs.
Some examples of these types of bots:
- Monitoring new pool creations, and depositing liquidity
- Measuring trading activity of popular pools
- Listening for large swaps to update a telegram group
## Documentation
Please read the [development userguide](https://docs.apeworx.io/silverback/stable/userguides/development.html) for more information on how to develop a bot.
## Dependencies
- [python3](https://www.python.org/downloads) version 3.10 or greater, python3-dev
## Installation
Silverback relies heavily on the Ape development framework, so it's worth it to familarize yourself with how to install Ape and it's plugins using the [Ape installation userguide](https://docs.apeworx.io/ape/latest/userguides/quickstart#installation).
```{note}
It is suggested that you use a virtual environment of your choosing, and then install the Silverback package via one of the following options.
```
### via `pip`
You can install the latest release via [`pip`](https://pypi.org/project/pip/):
```bash
pip install silverback
```
### via `setuptools`
You can clone the repository and use [`setuptools`](https://github.com/pypa/setuptools) for the most up-to-date version:
```bash
git clone https://github.com/ApeWorX/silverback.git silverback
cd silverback
python3 setup.py install
```
## Quick Usage
Checkout [the example](https://github.com/ApeWorX/silverback/blob/main/bots/example.py) to see how to use the library.
```{note}
The example makes use of the [Ape Tokens](https://github.com/ApeWorX/ape-tokens) plugin.
Be sure to properly configure your environment for the USDC and YFI tokens on Ethereum mainnet.
```
To run your bot against a live network, this SDK includes a simple bot command you can use via:
```sh
$ silverback run example --network :mainnet:alchemy
```
```{note}
This bot uses an in-memory task broker by default.
If you want to learn more about what that means, please visit the [development userguide](https://docs.apeworx.io/silverback/stable/userguides/development.html).
```
```{note}
It is suggested that you create a bots/ folder in the root of your project.
Silverback will automatically register files in this folder as separate bots that can be run via the `silverback run` command.
```
```{note}
It is also suggested that you treat this as a scripts folder, and do not include an __init__.py
If you have a complicated project, follow the previous example to ensure you run the bot correctly.
```
```{note}
A final suggestion would be to name your `SilverbackBot` object `bot`. Silverback automatically searches
for this object name when running. If you do not do so, once again, ensure you replace `example` with
`example:<name-of-object>` the previous example.
```
To auto-generate Dockerfiles for your bots, from the root of your project, you can run:
```bash
silverback build --generate
```
This will place the generated dockerfiles in a special directory in the root of your project.
As an example, if you have a bots directory that looks like:
```
bots/
├── botA.py
├── botB.py
├── botC.py
```
This method will generate 3 Dockerfiles:
```
.silverback-images/
├── Dockerfile.botA
├── Dockerfile.botB
├── Dockerfile.botC
```
These Dockerfiles can be deployed with the `docker push` command documented in the next section so you can use it in cloud-based deployments.
```{note}
As an aside, if your bots/ directory is a python package, you will cause conflicts with the dockerfile generation feature. This method will warn you that you are generating bots for a python package, but will not stop you from doing so. If you choose to generate dockerfiles, the user should be aware that it will only copy each individual file into the Dockerfile, and will not include any supporting python functionality. Each python file is expected to run independently. If you require more complex bots, you will have to build a custom docker image.
```
## Docker Usage
```sh
$ docker run -it apeworx/silverback-example:latest run --network :mainnet
```
```{note}
The Docker image we publish uses Python 3.11.
```
## Development
This project is under active development in preparation of the release of the [Silverback Platform](https://silverback.apeworx.io).
Things might not be in their final state and breaking changes may occur.
Comments, questions, criticisms and pull requests are welcomed.
See [Contributing](https://github.com/ApeWorX/silverback/blob/main/CONTRIBUTING.md) for more information.
Raw data
{
"_id": null,
"home_page": "https://github.com/ApeWorX/silverback",
"name": "silverback",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.10",
"maintainer_email": null,
"keywords": "ethereum",
"author": "ApeWorX Ltd.",
"author_email": "admin@apeworx.io",
"download_url": "https://files.pythonhosted.org/packages/a9/4b/cf4ba7d1c8c0fc0f371e67e0f6a9c9708027b3a371ac9920c369462dec16/silverback-0.7.28.tar.gz",
"platform": null,
"description": "# Quick Start\n\nSilverback lets you create and deploy your own Python bots that respond to on-chain events.\nThe Silverback library leverages the [Ape](https://docs.apeworx.io/ape/stable/userguides/quickstart) development framework as well as it's ecosystem of plugins and packages to enable you to develop simple-yet-sophisticated automated bots that can listen and respond to live chain data.\n\nSilverback bots are excellent for use cases that involve continuously monitoring and responding to on-chain events, such as newly confirmed blocks or contract event logs.\n\nSome examples of these types of bots:\n\n- Monitoring new pool creations, and depositing liquidity\n- Measuring trading activity of popular pools\n- Listening for large swaps to update a telegram group\n\n## Documentation\n\nPlease read the [development userguide](https://docs.apeworx.io/silverback/stable/userguides/development.html) for more information on how to develop a bot.\n\n## Dependencies\n\n- [python3](https://www.python.org/downloads) version 3.10 or greater, python3-dev\n\n## Installation\n\nSilverback relies heavily on the Ape development framework, so it's worth it to familarize yourself with how to install Ape and it's plugins using the [Ape installation userguide](https://docs.apeworx.io/ape/latest/userguides/quickstart#installation).\n\n```{note}\nIt is suggested that you use a virtual environment of your choosing, and then install the Silverback package via one of the following options.\n```\n\n### via `pip`\n\nYou can install the latest release via [`pip`](https://pypi.org/project/pip/):\n\n```bash\npip install silverback\n```\n\n### via `setuptools`\n\nYou can clone the repository and use [`setuptools`](https://github.com/pypa/setuptools) for the most up-to-date version:\n\n```bash\ngit clone https://github.com/ApeWorX/silverback.git silverback\ncd silverback\npython3 setup.py install\n```\n\n## Quick Usage\n\nCheckout [the example](https://github.com/ApeWorX/silverback/blob/main/bots/example.py) to see how to use the library.\n\n```{note}\nThe example makes use of the [Ape Tokens](https://github.com/ApeWorX/ape-tokens) plugin.\nBe sure to properly configure your environment for the USDC and YFI tokens on Ethereum mainnet.\n```\n\nTo run your bot against a live network, this SDK includes a simple bot command you can use via:\n\n```sh\n$ silverback run example --network :mainnet:alchemy\n```\n\n```{note}\nThis bot uses an in-memory task broker by default.\nIf you want to learn more about what that means, please visit the [development userguide](https://docs.apeworx.io/silverback/stable/userguides/development.html).\n```\n\n```{note}\nIt is suggested that you create a bots/ folder in the root of your project.\nSilverback will automatically register files in this folder as separate bots that can be run via the `silverback run` command.\n```\n\n```{note}\nIt is also suggested that you treat this as a scripts folder, and do not include an __init__.py\nIf you have a complicated project, follow the previous example to ensure you run the bot correctly.\n```\n\n```{note}\nA final suggestion would be to name your `SilverbackBot` object `bot`. Silverback automatically searches \nfor this object name when running. If you do not do so, once again, ensure you replace `example` with \n`example:<name-of-object>` the previous example.\n```\n\nTo auto-generate Dockerfiles for your bots, from the root of your project, you can run:\n\n```bash\nsilverback build --generate\n```\n\nThis will place the generated dockerfiles in a special directory in the root of your project.\n\nAs an example, if you have a bots directory that looks like:\n\n```\nbots/\n\u251c\u2500\u2500 botA.py\n\u251c\u2500\u2500 botB.py\n\u251c\u2500\u2500 botC.py\n```\n\nThis method will generate 3 Dockerfiles:\n\n```\n.silverback-images/\n\u251c\u2500\u2500 Dockerfile.botA\n\u251c\u2500\u2500 Dockerfile.botB\n\u251c\u2500\u2500 Dockerfile.botC\n```\n\nThese Dockerfiles can be deployed with the `docker push` command documented in the next section so you can use it in cloud-based deployments.\n\n```{note}\nAs an aside, if your bots/ directory is a python package, you will cause conflicts with the dockerfile generation feature. This method will warn you that you are generating bots for a python package, but will not stop you from doing so. If you choose to generate dockerfiles, the user should be aware that it will only copy each individual file into the Dockerfile, and will not include any supporting python functionality. Each python file is expected to run independently. If you require more complex bots, you will have to build a custom docker image.\n```\n\n## Docker Usage\n\n```sh\n$ docker run -it apeworx/silverback-example:latest run --network :mainnet\n```\n\n```{note}\nThe Docker image we publish uses Python 3.11.\n```\n\n## Development\n\nThis project is under active development in preparation of the release of the [Silverback Platform](https://silverback.apeworx.io).\nThings might not be in their final state and breaking changes may occur.\nComments, questions, criticisms and pull requests are welcomed.\n\nSee [Contributing](https://github.com/ApeWorX/silverback/blob/main/CONTRIBUTING.md) for more information.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Ape SDK for the Silverback platform",
"version": "0.7.28",
"project_urls": {
"Homepage": "https://github.com/ApeWorX/silverback"
},
"split_keywords": [
"ethereum"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3f755a1a0b9d0f1a052f1a45bd5a4536cee23d4009577a78e32285d173e25d00",
"md5": "c5bba142efba0846c3e97f949736d980",
"sha256": "4f8e0158c5e283975eb157a7b28fe7e8d56cf08df9c7af94e3afa630fa9db16f"
},
"downloads": -1,
"filename": "silverback-0.7.28-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c5bba142efba0846c3e97f949736d980",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.10",
"size": 69586,
"upload_time": "2025-08-27T19:40:38",
"upload_time_iso_8601": "2025-08-27T19:40:38.542508Z",
"url": "https://files.pythonhosted.org/packages/3f/75/5a1a0b9d0f1a052f1a45bd5a4536cee23d4009577a78e32285d173e25d00/silverback-0.7.28-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a94bcf4ba7d1c8c0fc0f371e67e0f6a9c9708027b3a371ac9920c369462dec16",
"md5": "ddd16766d603c78fa8c51cf1b8962fdf",
"sha256": "bac4d2cbd7ae6bb627f726c6c8c04d4e4b090c1da9708658efa57b18e9635a49"
},
"downloads": -1,
"filename": "silverback-0.7.28.tar.gz",
"has_sig": false,
"md5_digest": "ddd16766d603c78fa8c51cf1b8962fdf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.10",
"size": 91971,
"upload_time": "2025-08-27T19:40:39",
"upload_time_iso_8601": "2025-08-27T19:40:39.840443Z",
"url": "https://files.pythonhosted.org/packages/a9/4b/cf4ba7d1c8c0fc0f371e67e0f6a9c9708027b3a371ac9920c369462dec16/silverback-0.7.28.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-27 19:40:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ApeWorX",
"github_project": "silverback",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "silverback"
}