# Quick Start
Ganache network provider plugin for Ape. Ganache is a tool for creating a local blockchain for fast Ethereum development.
## Dependencies
- [python3](https://www.python.org/downloads) version 3.8 up to 3.11.
- Node.js, NPM, and Ganache. See Ganache's [Installation](https://github.com/trufflesuite/ganache#command-line-use%3E) documentation for steps.
## Installation
### via `pip`
You can install the latest release via [pip](https://pypi.org/project/pip/):
```bash
pip install ape-ganache
```
### 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/ape-ganache.git
cd ape-ganache
python3 setup.py install
```
## Quick Usage
To use the plugin, first install Ganache locally into your Ape project directory:
```bash
cd your-ape-project
npm install --global ganache
```
After that, you can use the `--network ethereum:local:ganache` command line flag to use the ganache network (if it's not already configured as the default).
This network provider takes additional Ganache-specific configuration options.
To use them, add these configs in your project's `ape-config.yaml`:
```yaml
ganache:
server:
port: 8555
```
To select a random port, use a value of "auto":
```yaml
ganache:
server:
port: auto
```
This is useful for multiprocessing and starting up multiple providers.
## Mainnet Fork
The `ape-ganache` plugin also includes a mainnet fork provider. It requires using another provider that has access to mainnet.
Use it in most commands like this:
```bash
ape console --network :mainnet-fork:ganache
```
Specify the upstream archive-data provider in your `ape-config.yaml`:
```yaml
ganache:
fork:
ethereum:
mainnet:
upstream_provider: infura
```
Otherwise, it defaults to the default mainnet provider plugin.
You can also specify a `block_number`.
**NOTE**: Make sure you have the upstream provider plugin installed for ape.
```bash
ape plugins add infura
```
## Unlocking Accounts
You can unlock / impersonate accounts at genesis time using Ganache.
To do this, add the accounts to your config like this:
```yaml
ganache:
wallet:
unlocked_accounts:
- 0x04029baca527b69247dbe9243dfc9b5d12c7ba60
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ApeWorX/ape-ganache",
"name": "ape-ganache",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4",
"maintainer_email": "",
"keywords": "ethereum",
"author": "ApeWorX Ltd.",
"author_email": "admin@apeworx.io",
"download_url": "https://files.pythonhosted.org/packages/a3/bc/f68efebf2c1a46079b69ed010ae0e4cfeb8d68dfb23f001cf6a4f12b4d17/ape-ganache-0.7.0.tar.gz",
"platform": null,
"description": "# Quick Start\n\nGanache network provider plugin for Ape. Ganache is a tool for creating a local blockchain for fast Ethereum development.\n\n## Dependencies\n\n- [python3](https://www.python.org/downloads) version 3.8 up to 3.11.\n- Node.js, NPM, and Ganache. See Ganache's [Installation](https://github.com/trufflesuite/ganache#command-line-use%3E) documentation for steps.\n\n## Installation\n\n### via `pip`\n\nYou can install the latest release via [pip](https://pypi.org/project/pip/):\n\n```bash\npip install ape-ganache\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/ape-ganache.git\ncd ape-ganache\npython3 setup.py install\n```\n\n## Quick Usage\n\nTo use the plugin, first install Ganache locally into your Ape project directory:\n\n```bash\ncd your-ape-project\nnpm install --global ganache\n```\n\nAfter that, you can use the `--network ethereum:local:ganache` command line flag to use the ganache network (if it's not already configured as the default).\n\nThis network provider takes additional Ganache-specific configuration options.\nTo use them, add these configs in your project's `ape-config.yaml`:\n\n```yaml\nganache:\n server:\n port: 8555\n```\n\nTo select a random port, use a value of \"auto\":\n\n```yaml\nganache:\n server:\n port: auto\n```\n\nThis is useful for multiprocessing and starting up multiple providers.\n\n## Mainnet Fork\n\nThe `ape-ganache` plugin also includes a mainnet fork provider. It requires using another provider that has access to mainnet.\n\nUse it in most commands like this:\n\n```bash\nape console --network :mainnet-fork:ganache\n```\n\nSpecify the upstream archive-data provider in your `ape-config.yaml`:\n\n```yaml\nganache:\n fork:\n ethereum:\n mainnet:\n upstream_provider: infura\n```\n\nOtherwise, it defaults to the default mainnet provider plugin.\nYou can also specify a `block_number`.\n\n**NOTE**: Make sure you have the upstream provider plugin installed for ape.\n\n```bash\nape plugins add infura\n```\n\n## Unlocking Accounts\n\nYou can unlock / impersonate accounts at genesis time using Ganache.\nTo do this, add the accounts to your config like this:\n\n```yaml\nganache:\n wallet:\n unlocked_accounts:\n - 0x04029baca527b69247dbe9243dfc9b5d12c7ba60\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "ape-ganache: Ape network provider for Ganache",
"version": "0.7.0",
"project_urls": {
"Homepage": "https://github.com/ApeWorX/ape-ganache"
},
"split_keywords": [
"ethereum"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "13bf297fca9e76814b9103de20deded761248b824afdc485f65df39609178288",
"md5": "8a885c47b10e06dcf6f55d6e155c50a6",
"sha256": "0ff40b66fcbd1c55de70791b6142cdea38bc0b2208eb902e33c88c643f0aa13f"
},
"downloads": -1,
"filename": "ape_ganache-0.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8a885c47b10e06dcf6f55d6e155c50a6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4",
"size": 14479,
"upload_time": "2023-12-19T03:00:16",
"upload_time_iso_8601": "2023-12-19T03:00:16.047473Z",
"url": "https://files.pythonhosted.org/packages/13/bf/297fca9e76814b9103de20deded761248b824afdc485f65df39609178288/ape_ganache-0.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a3bcf68efebf2c1a46079b69ed010ae0e4cfeb8d68dfb23f001cf6a4f12b4d17",
"md5": "28981f83fdb41055b2fbdbe19b6963f1",
"sha256": "573baa99c072c0cb6cf0df9bbf3e7740a07a9d14ce038903e6ab181fc3cc7606"
},
"downloads": -1,
"filename": "ape-ganache-0.7.0.tar.gz",
"has_sig": false,
"md5_digest": "28981f83fdb41055b2fbdbe19b6963f1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4",
"size": 84649,
"upload_time": "2023-12-19T03:00:18",
"upload_time_iso_8601": "2023-12-19T03:00:18.259305Z",
"url": "https://files.pythonhosted.org/packages/a3/bc/f68efebf2c1a46079b69ed010ae0e4cfeb8d68dfb23f001cf6a4f12b4d17/ape-ganache-0.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-19 03:00:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ApeWorX",
"github_project": "ape-ganache",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ape-ganache"
}