Skip to content

Commit

Permalink
chore: minor polishing; adding code tours
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Feb 23, 2024
1 parent faa6d61 commit f57b6e6
Show file tree
Hide file tree
Showing 29 changed files with 501 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ description = "Adds new smart contract to existing project"
path = ".algokit/generators/create_contract"

[project]
type = 'backend'
type = 'contract'
name = 'production_puya_smart_contract_python'
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"$schema": "https://aka.ms/codetour-schema",
"title": "Getting Started with Your AlgoKit Project",
"steps": [
{
"file": "README.md",
"description": "Welcome to your brand new AlgoKit template-based project. In this tour, we will guide you through the main features and capabilities included in the template.",
"line": 3
},
{
"file": "README.md",
"description": "Start by ensuring you have followed the setup of pre-requisites.",
"line": 9
},
{
"file": "smart_contracts/__main__.py",
"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.",
"line": 26
},
{
"file": "smart_contracts/hello_world/deploy_config.py",
"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.",
"line": 32
},
{
"file": "tests/hello_world_test.py",
"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.",
"line": 36
},
{
"file": ".env.localnet.template",
"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`.",
"line": 2
},
{
"file": ".algokit.toml",
"description": "This is the configuration file used by AlgoKit to determine version requirements, `algokit deploy` settings, and references to custom generators.",
"line": 5
},
{
"file": ".vscode/launch.json",
"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.",
"line": 5
},
{
"file": ".vscode/extensions.json",
"description": "We highly recommend installing the recommended extensions to get the most out of this template starter project in your VSCode IDE.",
"line": 3
},
{
"file": "smart_contracts/__main__.py",
"description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin available on the [VSCode Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.",
"line": 13
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour",
"algorandfoundation.algokit-avm-vscode-debugger"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ description = "Adds new smart contract to existing project"
path = ".algokit/generators/create_contract"

[project]
type = 'backend'
type = 'contract'
name = 'production_puya_smart_contract_typescript'
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"$schema": "https://aka.ms/codetour-schema",
"title": "Getting Started with Your AlgoKit Project",
"steps": [
{
"file": "README.md",
"description": "Welcome to your brand new AlgoKit template-based project. In this tour, we will guide you through the main features and capabilities included in the template.",
"line": 3
},
{
"file": "README.md",
"description": "Start by ensuring you have followed the setup of pre-requisites.",
"line": 9
},
{
"file": "smart_contracts/__main__.py",
"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.",
"line": 26
},
{
"file": "smart_contracts/hello_world/deploy-config.ts",
"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.",
"line": 32
},
{
"file": "tests/hello-world.spec.ts",
"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.",
"line": 39
},
{
"file": ".env.localnet.template",
"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`.",
"line": 2
},
{
"file": ".algokit.toml",
"description": "This is the configuration file used by AlgoKit to determine version requirements, `algokit deploy` settings, and references to custom generators.",
"line": 5
},
{
"file": ".vscode/launch.json",
"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.",
"line": 5
},
{
"file": ".vscode/extensions.json",
"description": "We highly recommend installing the recommended extensions to get the most out of this template starter project in your VSCode IDE.",
"line": 3
},
{
"file": "smart_contracts/index.ts",
"description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin available on the [VSCode Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.",
"line": 13
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"esbenp.prettier-vscode",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour",
"algorandfoundation.algokit-avm-vscode-debugger"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ description = "Adds new smart contract to existing project"
path = ".algokit/generators/create_contract"

[project]
type = 'backend'
type = 'contract'
name = 'starter_puya_smart_contract_python'
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"$schema": "https://aka.ms/codetour-schema",
"title": "Getting Started with Your AlgoKit Project",
"steps": [
{
"file": "README.md",
"description": "Welcome to your brand new AlgoKit template-based project. In this tour, we will guide you through the main features and capabilities included in the template.",
"line": 3
},
{
"file": "README.md",
"description": "Start by ensuring you have followed the setup of pre-requisites.",
"line": 9
},
{
"file": "smart_contracts/__main__.py",
"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.",
"line": 26
},
{
"file": "smart_contracts/hello_world/deploy_config.py",
"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.",
"line": 32
},
{
"file": "tests/hello_world_test.py",
"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.",
"line": 36
},
{
"file": ".env.localnet.template",
"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`.",
"line": 2
},
{
"file": ".algokit.toml",
"description": "This is the configuration file used by AlgoKit to determine version requirements, `algokit deploy` settings, and references to custom generators.",
"line": 5
},
{
"file": ".vscode/launch.json",
"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.",
"line": 5
},
{
"file": ".vscode/extensions.json",
"description": "We highly recommend installing the recommended extensions to get the most out of this template starter project in your VSCode IDE.",
"line": 3
},
{
"file": "smart_contracts/__main__.py",
"description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin available on the [VSCode Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.",
"line": 13
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"ms-python.black-formatter",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour",
"algorandfoundation.algokit-avm-vscode-debugger"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ description = "Adds new smart contract to existing project"
path = ".algokit/generators/create_contract"

[project]
type = 'backend'
type = 'contract'
name = 'starter_puya_smart_contract_typescript'
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"$schema": "https://aka.ms/codetour-schema",
"title": "Getting Started with Your AlgoKit Project",
"steps": [
{
"file": "README.md",
"description": "Welcome to your brand new AlgoKit template-based project. In this tour, we will guide you through the main features and capabilities included in the template.",
"line": 3
},
{
"file": "README.md",
"description": "Start by ensuring you have followed the setup of pre-requisites.",
"line": 9
},
{
"file": "smart_contracts/__main__.py",
"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.",
"line": 26
},
{
"file": "smart_contracts/hello_world/deploy-config.ts",
"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.",
"line": 32
},
{
"file": "tests/hello-world.spec.ts",
"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.",
"line": 39
},
{
"file": ".env.localnet.template",
"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`.",
"line": 2
},
{
"file": ".algokit.toml",
"description": "This is the configuration file used by AlgoKit to determine version requirements, `algokit deploy` settings, and references to custom generators.",
"line": 5
},
{
"file": ".vscode/launch.json",
"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.",
"line": 5
},
{
"file": ".vscode/extensions.json",
"description": "We highly recommend installing the recommended extensions to get the most out of this template starter project in your VSCode IDE.",
"line": 3
},
{
"file": "smart_contracts/index.ts",
"description": "Uncomment the following lines to enable complementary utilities that will generate artifacts required for the [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) VSCode plugin available on the [VSCode Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). A new folder will be automatically created in the `.algokit` directory with source maps of all TEAL contracts in this workspace, as well as traces that will appear in a folder at the root of the workspace. You can then use the traces as entry points to trigger the debug extension. Make sure to have the `.algokit.toml` file available at the root of the workspace.",
"line": 13
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"esbenp.prettier-vscode",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"vsls-contrib.codetour",
"algorandfoundation.algokit-avm-vscode-debugger"
]
}
2 changes: 1 addition & 1 deletion examples/production_puya/.algokit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ description = "Adds new smart contract to existing project"
path = ".algokit/generators/create_contract"

[project]
type = 'backend'
type = 'contract'
name = 'production_puya'
6 changes: 6 additions & 0 deletions examples/production_puya/.github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ jobs:
- name: Check types with mypy
run: poetry run mypy

- name: Run tests
shell: bash
run: |
set -o pipefail
poetry run pytest --junitxml=pytest-junit.xml
- name: Build smart contracts
run: poetry run python -m smart_contracts build

Expand Down
Loading

0 comments on commit f57b6e6

Please sign in to comment.