Skip to main content

Ape Ethereum Framework

Project description

Overview

Ape Framework is an easy-to-use Web3 development tool. Users can compile, test, and interact with smart contracts all in one command line session. With our modular plugin system, Ape supports multiple contract languages and chains.

Ape is built by ApeWorX LTD.

Join our ApeWorX Discord server to stay up to date on new releases, plugins and tutorials.

If you want to just get started, jump down to the Playing with Ape

Documentation

Read our technical documentation to get a deeper understanding of our open source Framework.

Read our academic platform will help you master Ape Framework with tutorials and challenges.

Prerequisite

In the latest release, Ape requires:

  • Linux or macOS
  • Python 3.8 or later
  • Windows: Install Windows Subsystem Linux (WSL) with Python 3.8 or later

Check your python version in a terminal with python3 --version

Installation

There are three ways to install ape: pipx, pip, or Docker.

Considerations for Installing:

  • We advise installing in a virtualenv or venv to avoid interfering with OS-level site packages.

  • We advise installing ape with recommended plugins pip install eth-ape'[recommended-plugins]'

  • We advise for macOS users to install virtual env via homebrew

via pipx or pip

  1. Install pipx via their installation instructions or pip via their installation instructions

  2. Install ape via pipx install eth-ape or pip install eth-ape

via docker

Ape can also run in a docker contianer.

Please visit our Dockerhub for more details on using Ape with Docker.

docker run \
--volume $HOME/.ape:/home/harambe/.ape \
--volume $HOME/.vvm:/home/harambe/.vvm \
--volume $HOME/.solcx:/home/harambe/.solcx \
--volume $PWD:/home/harambe/project \
--workdir /home/harambe/project \
apeworx/ape compile

Playing with Ape

After you installed Ape, you can run ape --version to make sure it works and it is the latest version.

There are two ways to interact with Ape:

Ape is both a CLI tool and a Python SDK.

The CLI tool contains all the Ape commands and the Python SDK contains the classes and types needed to compose scripts, console actions, and tests.

Ape Modular Plugin System:

Our list of plugins is the best way to have the most interoperable experience with Web3.

NOTE: If a plugin does not originate from the ApeWorX GitHub Organization, you will get a warning about installing 3rd-party plugins.

Install 3rd party plugins at your own risk.

Additionally, plugins that come bundled with ape in the core installation cannot be removed and are part of the ape core software.

Accounts

In Ape, you will need accounts to make transactions. You can import or generate accounts using the core accounts plugin:

ape accounts import acc0   # Will prompt for a private key
ape accounts generate acc1

List all your accounts with the list command.

ape accounts list

Learn more about accounts in Ape by following the accounts guide.

Plugins

Add any plugins you may need, such as vyper.

ape plugins list -a
ape plugins install vyper
ape plugins list -a

Projects

When using Ape, you generally will work with a project.

Learn more about smart-contract projects from this projects guide.

Compiling

You can compile contracts within the contracts/ directory of your project. The --size option will display you the size of the contract.

ape compile --size

Learn more about compiling in Ape by following the compile guide.

Testing

Use Ape to test your smart-contract projects. Provide the same arguments to pytest as you would to the ape test command.

For example:

ape test -k test_only_one_thing

Visit the testing guide to learn more about testing using Ape.

Console

Ape provides an IPython interactive console with useful pre-defined locals to interact with your project. To interact with a deployed contract in a local environment, start by opening the console:

ape console --network ethereum:mainnet:infura

Visit Ape Console to learn how to use Ape Console.

Scripts

If you want to run specific files in a scripts/ directory, you can do it using the ape run command.

# This command will run a file named deploy in the scripts/ directory
$ ape run deploy

Learn more about scripting using Ape by following the scripting guide.

Logging

To enable debug logging, run your command with the --verbosity flag using DEBUG as the value:

ape --verbosity DEBUG run

Networks

You can work with registered networks, providers, and blockchain ecosystems (like Ethereum):

from ape import networks
with networks.ethereum.mainnet.use_provider("infura"):
    ...  # Work with the infura provider here

To learn more about networks in Ape, see this guide.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eth-ape-0.6.3.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

eth_ape-0.6.3-py3-none-any.whl (215.8 kB view details)

Uploaded Python 3

File details

Details for the file eth-ape-0.6.3.tar.gz.

File metadata

  • Download URL: eth-ape-0.6.3.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.16

File hashes

Hashes for eth-ape-0.6.3.tar.gz
Algorithm Hash digest
SHA256 60bd8870424b272946ef5c27ffd839ac12e45ca3a1229a876279920431082559
MD5 ae80e61b67970608e55b1220e5d6ca16
BLAKE2b-256 4e4e67f1f773011e1e0bb625b3f4c4d81469eedbeb5c9620179416834c864dee

See more details on using hashes here.

File details

Details for the file eth_ape-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: eth_ape-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 215.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.16

File hashes

Hashes for eth_ape-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c3e87832475d6e5dce53df156e3b5bb350ecab52f4ed05735a373d2a4c7e1384
MD5 2a2bb189ee69e36551b6db2ed5e5e9e1
BLAKE2b-256 4cffe8d4413ec1a4284373d1fa69ef715daeacc8c1fc4074b17a502a881a9cfe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page