Algorand
April 13, 2023 ยท View on GitHub
This project has been generated using AlgoKit. See below for default getting started instructions.
Setup
Initial setup
- Clone this repository locally
- Install pre-requisites:
- Install
AlgoKit- Link: Ensure you can executealgokit --version. - Bootstrap your local environment; run
algokit bootstrap allwithin this folder, which will:- Install
Poetry- Link: The minimum required version is1.2. Ensure you can executepoetry -Vand get1.2+ - Run
poetry installin the root directory, which will set up a.venvfolder with a Python virtual environment and also install all Python dependencies - Copy
.env.templateto.env - Run
npm installinsmart_contractsto install NPM packages
- Install
- Install
- Open the project and start debugging / developing via:
- VS Code
- Open the repository root in VS Code
- Install recommended extensions
- Hit F5 (or whatever you have debug mapped to) and it should start running with breakpoint debugging.
Note If using Windows: Before running for the first time you will need to select the Python Interpreter.
- Open the command palette (Ctrl/Cmd + Shift + P)
- Search for
Python: Select Interpreter - Select
./.venv/Scripts/python.exe
- IDEA (e.g. PyCharm)
- Open the repository root in the IDE
- It should automatically detect it's a Poetry project and set up a Python interpreter and virtual environment.
- Hit Shift+F9 (or whatever you have debug mapped to) and it should start running with breakpoint debugging.
- Other
- Open the repository root in your text editor of choice
- In a terminal run
poetry shell - Run
python -m smart_contractsthrough your debugger of choice
- VS Code
Subsequently
- If you update to the latest source code and there are new dependencies you will need to run
poetry installagain - Follow step 3 above
Tools
This project makes use of Python to build Algorand smart contracts. The following tools are in use:
- Poetry: Python packaging and dependency management.
- Black: A Python code formatter.
- Ruff: An extremely fast Python linter.
- mypy: Static type checker.
It has also been configured to have a productive dev experience out of the box in VS Code, see the .vscode folder.