You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ This repository is a template for creating new AlgoKit projects. It includes a b
12
12
Ensure localnet is running by executing `algokit localnet reset`.
13
13
14
14
```bash
15
-
poetry run pytest -n auto
15
+
poetry run pytest
16
16
```
17
17
18
18
This will regenerate the tests for default `starter` and `production` presets as well as default tests for `generators` available on the template.
@@ -22,20 +22,20 @@ This will regenerate the tests for default `starter` and `production` presets as
22
22
### Manual
23
23
24
24
```bash
25
-
poetry run copier copy ..playground --vcs-ref=HEAD --trust
25
+
poetry run copier copy . playground --vcs-ref=HEAD --trust
26
26
```
27
27
28
-
To generate a dummy project into the `.playground` folder. This is useful for testing the template to quickly preview the output of the template before testing via `pytest`.
28
+
To generate a dummy project into the `playground` folder. This is useful for testing the template to quickly preview the output of the template before testing via `pytest`.
29
29
30
30
### Using VSCode Tasks
31
31
32
32
In VSCode IDE, you can find the tasks in the `.vscode/tasks.json` file. To run them:
33
33
34
34
1. Open the command palette (`Cmd+Shift+P` on macOS, `Ctrl+Shift+P` on Windows/Linux) and type `> Run Task`
35
35
2. Select the task you want to run
36
-
3. It will be generated for you under the .playground folder
36
+
3. It will be generated for you under the playground folder
37
37
38
-
To cleanup the .playground folder run dedicated cleanup task.
38
+
To cleanup the playground folder run dedicated cleanup task.
Copy file name to clipboardexpand all lines: examples/generators/production_python_smart_contract_python/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2
Copy file name to clipboardexpand all lines: examples/generators/production_python_smart_contract_python/.tours/getting-started-with-your-algokit-project.tour
+5-10
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@
13
13
"line": 9
14
14
},
15
15
{
16
-
"file": "smart_contracts/__main__.py",
17
-
"description": "This is the main entry point for building your smart contracts. The default template includes a starter 'Hello World' contract that is deployed via the `algokit-utils` package (either `ts` or `py`, depending on your choice). To create a new smart contract, you can use the [`algokit generate`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md) command and invoke a pre-bundled generator template by running `algokit generate smart-contract`. This action will create a new folder in the `smart_contracts` directory, named after your project. Each folder contains a `contract.py` file, which is the entry point for your contract implementation, and `deploy_config.py` | `deployConfig.ts` files (depending on the language chosen for the template), that perform the deployment of the contract.",
18
-
"line": 26
16
+
"file": ".algokit.toml",
17
+
"description": "This is the main configuration file used by algokit-cli to manage the project. The default template includes a starter 'Hello World' contract that is deployed via the `algokit-utils` package (either `ts` or `py`, depending on your choice). To create a new smart contract, you can use the [`algokit generate`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md) command and invoke a pre-bundled generator template by running `algokit generate smart-contract` (see how it is defined in the `.algokit.toml`, you can create your own generators if needed). This action will create a new folder in the `smart_contracts` directory, named after your project. Each folder contains a `contract.py` file, which is the entry point for your contract implementation, and `deploy_config.py` | `deployConfig.ts` files (depending on the language chosen for the template), that perform the deployment of the contract. Additionally you can define custom commands to run (similar to `npm` scripts), see definitions under `[project]` section in `.algokit.toml`.",
"description": "The default deployment scripts invoke a sample method on the starter contract that demonstrates how to interact with your deployed Algorand on-chain applications using the [`AlgoKit Typed Clients`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md#1-typed-clients) feature.",
22
+
"description": "The default deployment scripts invoke a sample method on the starter contract that demonstrates how to interact with your deployed Algorand on-chain applications using the [`AlgoKit Typed Clients`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md#1-typed-clients) feature. The invocation if deploy is aliased in `.algokit.toml` file, allowing simple deployments via `algokit project deploy` command.",
23
23
"line": 32
24
24
},
25
25
{
@@ -32,14 +32,9 @@
32
32
"description": "Environment files are a crucial mechanism that allows you to set up the [`algokit deploy`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/deploy.md) feature to simplify deploying your contracts in CI/CD environments (please note we still recommend careful evaluation when it comes to deployment to MainNet). Clone the file and remove the `.template` suffix to apply the changes to deployment scripts and launch configurations. The network prefix `localnet|testnet|mainnet` is primarily optimized for `algokit deploy`. The order of loading the variables is `.env.{network}` < `.env`.",
33
33
"line": 2
34
34
},
35
-
{
36
-
"file": ".algokit.toml",
37
-
"description": "This is the configuration file used by AlgoKit to determine version requirements, `algokit deploy` settings, and references to custom generators.",
38
-
"line": 5
39
-
},
40
35
{
41
36
"file": ".vscode/launch.json",
42
-
"description": "Refer to the pre-bundled Visual Studio launch configurations, offering various options on how to execute the build and deployment of your smart contracts.",
37
+
"description": "Refer to the pre-bundled Visual Studio launch configurations, offering various options on how to execute the build and deployment of your smart contracts. Alternatively execute `algokit project run` to see list of available custom commands.",
Copy file name to clipboardexpand all lines: examples/generators/production_python_smart_contract_python/README.md
+13-7
Original file line number
Diff line number
Diff line change
@@ -9,19 +9,25 @@ This project has been generated using AlgoKit. See below for default getting sta
9
9
-[Python 3.12](https://www.python.org/downloads/) or later
10
10
-[Docker](https://www.docker.com/) (only required for LocalNet)
11
11
12
+
> For interactive tour over the codebase, download [vsls-contrib.codetour](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) extension for VS Code, then open the [`.codetour.json`](./.tours/getting-started-with-your-algokit-project.tour) file in code tour extension.
13
+
12
14
### Initial setup
13
15
14
16
1. Clone this repository locally
15
17
2. Install pre-requisites:
16
18
- Make sure to have [Docker](https://www.docker.com/) installed and running on your machine.
17
-
- Install `AlgoKit` - [Link](https://github.com/algorandfoundation/algokit-cli#install): The recommended version is `1.7.3`. Ensure you can execute `algokit --version` and get `1.7.1` or later.
19
+
- Install `AlgoKit` - [Link](https://github.com/algorandfoundation/algokit-cli#install): The recommended version is the latest available. Ensure you can execute `algokit --version` and get `2.0.0` or later.
18
20
- Bootstrap your local environment; run `algokit bootstrap all` within this folder, which will:
19
21
- Install `Poetry` - [Link](https://python-poetry.org/docs/#installation): The minimum required version is `^1.7`. Ensure you can execute `poetry -V` and get `1.2`+
20
22
- Run `poetry install` in the root directory, which will set up a `.venv` folder with a Python virtual environment and also install all Python dependencies
21
23
- Copy `.env.template` to `.env`
22
24
- Run `algokit localnet start` to start a local Algorand network in Docker. If you are using VS Code launch configurations provided by the template, this will be done automatically for you.
25
+
- Run `algokit project bootstrap all` to install all project dependencies (unless executed during `algokit init`).
23
26
3. Open the project and start debugging / developing via:
24
-
- VS Code
27
+
- Terminal
28
+
1. Run `algokit project run build` to build all contracts in the project
29
+
2. Run `algokit project deploy localnet` to deploy all contracts to the local Algorand network.
30
+
- VS Code (Launch Configurations)
25
31
1. Open the repository root in VS Code
26
32
2. Install recommended extensions
27
33
3. Hit F5 (or whatever you have debug mapped to) and it should start running with breakpoint debugging.
@@ -34,10 +40,6 @@ This project has been generated using AlgoKit. See below for default getting sta
34
40
1. Open the repository root in the IDE
35
41
2. It should automatically detect it's a Poetry project and set up a Python interpreter and virtual environment.
36
42
3. Hit Shift+F10|Ctrl+R (or whatever you have debug mapped to) and it should start running with breakpoint debugging. Please note, JetBrains IDEs on Windows have a known bug that in some cases may prevent executing shell scripts as pre-launch tasks, for workarounds refer to [JetBrains forums](https://youtrack.jetbrains.com/issue/IDEA-277486/Shell-script-configuration-cannot-run-as-before-launch-task).
37
-
- Other
38
-
1. Open the repository root in your text editor of choice
39
-
2. In a terminal run `poetry shell`
40
-
3. Run `python -m smart_contracts` through your debugger of choice
41
43
42
44
### Subsequently
43
45
@@ -50,6 +52,10 @@ This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-gith
50
52
51
53
> Please note, if you instantiated the project with --workspace flag in `algokit init` it will automatically attempt to move the contents of the `.github` folder to the root of the workspace.
52
54
55
+
### AlgoKit Workspaces
56
+
57
+
To define custom `algokit project run` commands refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md). This allows orchestration of commands spanning across multiple projects within an algokit workspace based project (monorepo).
58
+
53
59
### Debugging Smart Contracts
54
60
55
61
This project is optimized to work with AlgoKit AVM Debugger extension. To activate it:
@@ -109,6 +115,6 @@ This project makes use of Algorand Python to build Algorand smart contracts. The
109
115
-[mypy](https://mypy-lang.org/): Static type checker.
-[pip-audit](https://pypi.org/project/pip-audit/): Tool for scanning Python environments for packages with known vulnerabilities.
112
-
-[pre-commit](https://pre-commit.com/): A framework for managing and maintaining multi-language pre-commit hooks, to enable pre-commit you need to run `pre-commit install` in the root of the repository. This will install the pre-commit hooks and run them against modified files when committing. If any of the hooks fail, the commit will be aborted. To run the hooks on all files, use `pre-commit run --all-files`.
118
+
-[pre-commit](https://pre-commit.com/): A framework for managing and maintaining multi-language pre-commit hooks, to enable pre-commit you need to run `pre-commit install` in the root of the repository. This will install the pre-commit hooks and run them against modified files when committing. If any of the hooks fail, the commit will be aborted. To run the hooks on all files, use `pre-commit run --all-files`.
113
119
It has also been configured to have a productive dev experience out of the box in [VS Code](https://code.visualstudio.com/), see the [.vscode](./.vscode) folder.
Copy file name to clipboardexpand all lines: examples/generators/production_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/contract.py.j2
Copy file name to clipboardexpand all lines: examples/generators/production_python_smart_contract_typescript/.tours/getting-started-with-your-algokit-project.tour
+5-15
Original file line number
Diff line number
Diff line change
@@ -13,33 +13,23 @@
13
13
"line": 9
14
14
},
15
15
{
16
-
"file": "smart_contracts/__main__.py",
17
-
"description": "This is the main entry point for building your smart contracts. The default template includes a starter 'Hello World' contract that is deployed via the `algokit-utils` package (either `ts` or `py`, depending on your choice). To create a new smart contract, you can use the [`algokit generate`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md) command and invoke a pre-bundled generator template by running `algokit generate smart-contract`. This action will create a new folder in the `smart_contracts` directory, named after your project. Each folder contains a `contract.py` file, which is the entry point for your contract implementation, and `deploy_config.py` | `deployConfig.ts` files (depending on the language chosen for the template), that perform the deployment of the contract.",
18
-
"line": 26
16
+
"file": ".algokit.toml",
17
+
"description": "This is the main configuration file used by algokit-cli to manage the project. The default template includes a starter 'Hello World' contract that is deployed via the `algokit-utils` package (either `ts` or `py`, depending on your choice). To create a new smart contract, you can use the [`algokit generate`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md) command and invoke a pre-bundled generator template by running `algokit generate smart-contract` (see how it is defined in the `.algokit.toml`, you can create your own generators if needed). This action will create a new folder in the `smart_contracts` directory, named after your project. Each folder contains a `contract.py` file, which is the entry point for your contract implementation, and `deploy_config.py` | `deployConfig.ts` files (depending on the language chosen for the template), that perform the deployment of the contract. Additionally you can define custom commands to run (similar to `npm` scripts), see definitions under `[project]` section in `.algokit.toml`.",
"description": "The default deployment scripts invoke a sample method on the starter contract that demonstrates how to interact with your deployed Algorand on-chain applications using the [`AlgoKit Typed Clients`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md#1-typed-clients) feature.",
22
+
"description": "The default deployment scripts invoke a sample method on the starter contract that demonstrates how to interact with your deployed Algorand on-chain applications using the [`AlgoKit Typed Clients`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md#1-typed-clients) feature. The invocation if deploy is aliased in `.algokit.toml` file, allowing simple deployments via `algokit project deploy` command.",
23
23
"line": 32
24
24
},
25
-
{
26
-
"file": "tests/hello-world.spec.ts",
27
-
"description": "If you opted to include unit tests, the default tests provided demonstrate an example of mocking, setting up fixtures, and testing smart contract calls on an AlgoKit typed client.",
28
-
"line": 39
29
-
},
30
25
{
31
26
"file": ".env.localnet.template",
32
27
"description": "Environment files are a crucial mechanism that allows you to set up the [`algokit deploy`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/deploy.md) feature to simplify deploying your contracts in CI/CD environments (please note we still recommend careful evaluation when it comes to deployment to MainNet). Clone the file and remove the `.template` suffix to apply the changes to deployment scripts and launch configurations. The network prefix `localnet|testnet|mainnet` is primarily optimized for `algokit deploy`. The order of loading the variables is `.env.{network}` < `.env`.",
33
28
"line": 2
34
29
},
35
-
{
36
-
"file": ".algokit.toml",
37
-
"description": "This is the configuration file used by AlgoKit to determine version requirements, `algokit deploy` settings, and references to custom generators.",
38
-
"line": 5
39
-
},
40
30
{
41
31
"file": ".vscode/launch.json",
42
-
"description": "Refer to the pre-bundled Visual Studio launch configurations, offering various options on how to execute the build and deployment of your smart contracts.",
32
+
"description": "Refer to the pre-bundled Visual Studio launch configurations, offering various options on how to execute the build and deployment of your smart contracts. Alternatively execute `algokit project run` to see list of available custom commands.",
0 commit comments