Skip to content

Latest commit

 

History

History
82 lines (52 loc) · 3.36 KB

INSTALL.md

File metadata and controls

82 lines (52 loc) · 3.36 KB

Install -- overview

Elf-simulations is currently supported only for Python 3.10.

1. Install Pyenv

Follow Pyenv install instructions.

2. Clone Elf-simulations repo

Clone the repo into a <repo_location> of your choice.

git clone https://github.com/delvtech/elf-simulations.git <repo_location>

3. Set up virtual environment

Here we use venv which is part of the built-in standard Python library. You can use another virtual environment package if you prefer, like pyenv-virtualenv.

cd <repo_location>
pyenv install 3.10
pyenv local 3.10
python -m venv .venv
source .venv/bin/activate

4. Install Elf-simulations

python -m pip install --upgrade pip
python -m pip install --upgrade -e ".[with-dependencies]"

The dependencies includes postgresql, which is required to work with files in elfpy/data. If you intend to improve the documentation, then you must also install the packages:

python -m pip install --upgrade -e ".[with-dependencies,docs]"

An explanation of what the above steps do:

  • pyenv install 3.10 You should now see the correct version when you run pyenv versions.
  • pyenv local 3.10 This command creates a .python-version file in your current directory. If you have pyenv active in your environment, this file will automatically activate this version for you.
  • python -m venv .venv This will create a .venv folder in your repo directory that stores the local python build & packages. After this command you should be able to type which python and see that it points to an executable inside .venv/.
  • python -m pip install --upgrade -e ".[with-dependencies]" This installs elfpy locally such that the install updates automatically any time you change the source code. This also installs all dependencies defined in pyproject.toml.

Working with smart contracts (optional)

We run several tests and offer utilities that depend on executing Hyperdrive solidity contracts. This is not required to use elfpy.

NOTE: The Hyperdrive solidity implementation is currently under security review, and thus is not available publicly. The following instructions will not work for anyone who is not a member of Delv.

5. Set up smart contracts

Clone the hyperdrive repo, then create a sym link at hyperdrive_solidity/ pointing to the repo location.

git clone https://github.com/delvtech/hyperdrive.git ../hyperdrive
ln -s ../hyperdrive hyperdrive_solidity

6. Install Hyperdrive pre-requisites

Complete the steps in Hyperdrive's Pre-requisites section.

7. Install ape plugins

Install Ape plugins with python -m pip install --upgrade -e ".[ape]"

Notes

You can test that everything is working by calling: python -m pytest .

You can test against a local testnet node using Anvil with anvil.

We use Docker for building images.

NOTE: pip might complain about dependency incompatibility between eth-ape and some plugins. This discrepancy comes from apeworx, although our examples should run without dealing with the incompatibility.