applications.app_deployer
Attributes
Section titled “Attributes”APP_DEPLOY_NOTE_DAPP |
|---|
Classes
Section titled “Classes”AppDeploymentMetaData | Metadata about an application stored in a transaction note during creation. |
|---|---|
ApplicationReference | Information about an Algorand app |
ApplicationMetaData | Complete metadata about a deployed app |
ApplicationLookup | Cache of {py:class}`ApplicationMetaData` for a specific creator |
AppDeployParams | Parameters for deploying an app |
AppDeployResult | The result of a deployment |
AppDeployer | Manages deployment and deployment metadata of applications |
Module Contents
Section titled “Module Contents”algokit*utils.applications.app_deployer.APP_DEPLOY_NOTE_DAPP *: str_ = ‘ALGOKIT_DEPLOYER’
Section titled “algokit*utils.applications.app_deployer.APP_DEPLOY_NOTE_DAPP *: str_ = ‘ALGOKIT_DEPLOYER’”class algokit_utils.applications.app_deployer.AppDeploymentMetaData
Section titled “class algokit_utils.applications.app_deployer.AppDeploymentMetaData”Metadata about an application stored in a transaction note during creation.
name : str
Section titled “name : str”version : str
Section titled “version : str”deletable : bool | None
Section titled “deletable : bool | None”updatable : bool | None
Section titled “updatable : bool | None”dictify() → dict[str, str | bool]
Section titled “dictify() → dict[str, str | bool]”class algokit_utils.applications.app_deployer.ApplicationReference
Section titled “class algokit_utils.applications.app_deployer.ApplicationReference”Information about an Algorand app
app*id *: int_
Section titled “app*id *: int_”app*address *: str_
Section titled “app*address *: str_”class algokit_utils.applications.app_deployer.ApplicationMetaData
Section titled “class algokit_utils.applications.app_deployer.ApplicationMetaData”Complete metadata about a deployed app
deploy*metadata *: AppDeploymentMetaData_
Section titled “deploy*metadata *: AppDeploymentMetaData_”created*round *: int_
Section titled “created*round *: int_”updated*round *: int_
Section titled “updated*round *: int_”deleted : bool = False
Section titled “deleted : bool = False”property app*id *: int_
Section titled “property app*id *: int_”property app*address *: str_
Section titled “property app*address *: str_”property name : str
Section titled “property name : str”property version : str
Section titled “property version : str”property deletable : bool | None
Section titled “property deletable : bool | None”property updatable : bool | None
Section titled “property updatable : bool | None”class algokit_utils.applications.app_deployer.ApplicationLookup
Section titled “class algokit_utils.applications.app_deployer.ApplicationLookup”Cache of {py:class}`ApplicationMetaData` for a specific creator
Can be used as an argument to {py:class}`ApplicationClient` to reduce the number of calls when deploying multiple apps or discovering multiple app_ids
creator : str
Section titled “creator : str”class algokit_utils.applications.app_deployer.AppDeployParams
Section titled “class algokit_utils.applications.app_deployer.AppDeployParams”Parameters for deploying an app
The deployment metadata
deploytime_params : algokitutils.models.state.TealTemplateParams | None = None
Section titled “deploytime_params : algokitutils.models.state.TealTemplateParams | None = None”Optional template parameters to use during compilation
on*schema_break *: Literal[‘replace’, ‘fail’, ‘append’] | algokit_utils.applications.enums.OnSchemaBreak | None_ = None
Section titled “on*schema_break *: Literal[‘replace’, ‘fail’, ‘append’] | algokit_utils.applications.enums.OnSchemaBreak | None_ = None”Optional on schema break action
on*update *: Literal[‘update’, ‘replace’, ‘fail’, ‘append’] | algokit_utils.applications.enums.OnUpdate | None_ = None
Section titled “on*update *: Literal[‘update’, ‘replace’, ‘fail’, ‘append’] | algokit_utils.applications.enums.OnUpdate | None_ = None”Optional on update action
create*params *: algokit_utils.transactions.transaction_composer.AppCreateParams | algokit_utils.transactions.transaction_composer.AppCreateMethodCallParams_
Section titled “create*params *: algokit_utils.transactions.transaction_composer.AppCreateParams | algokit_utils.transactions.transaction_composer.AppCreateMethodCallParams_”The creation parameters
update*params *: algokit_utils.transactions.transaction_composer.AppUpdateParams | algokit_utils.transactions.transaction_composer.AppUpdateMethodCallParams_
Section titled “update*params *: algokit_utils.transactions.transaction_composer.AppUpdateParams | algokit_utils.transactions.transaction_composer.AppUpdateMethodCallParams_”The update parameters
delete*params *: algokit_utils.transactions.transaction_composer.AppDeleteParams | algokit_utils.transactions.transaction_composer.AppDeleteMethodCallParams_
Section titled “delete*params *: algokit_utils.transactions.transaction_composer.AppDeleteParams | algokit_utils.transactions.transaction_composer.AppDeleteMethodCallParams_”The deletion parameters
existing*deployments *: ApplicationLookup | None_ = None
Section titled “existing*deployments *: ApplicationLookup | None_ = None”Optional existing deployments
ignore*cache *: bool_ = False
Section titled “ignore*cache *: bool_ = False”Whether to ignore the cache
max*fee *: int | None_ = None
Section titled “max*fee *: int | None_ = None”Optional maximum fee
send*params *: algokit_utils.models.transaction.SendParams | None_ = None
Section titled “send*params *: algokit_utils.models.transaction.SendParams | None_ = None”Optional send parameters
class algokit_utils.applications.app_deployer.AppDeployResult
Section titled “class algokit_utils.applications.app_deployer.AppDeployResult”The result of a deployment
The application metadata
operation*performed *: algokit_utils.applications.enums.OperationPerformed_
Section titled “operation*performed *: algokit_utils.applications.enums.OperationPerformed_”The operation performed
create*result *: algokit_utils.transactions.transaction_sender.SendAppCreateTransactionResult[algokit_utils.applications.abi.ABIReturn] | None_ = None
Section titled “create*result *: algokit_utils.transactions.transaction_sender.SendAppCreateTransactionResult[algokit_utils.applications.abi.ABIReturn] | None_ = None”The create result
update*result *: algokit_utils.transactions.transaction_sender.SendAppUpdateTransactionResult[algokit_utils.applications.abi.ABIReturn] | None_ = None
Section titled “update*result *: algokit_utils.transactions.transaction_sender.SendAppUpdateTransactionResult[algokit_utils.applications.abi.ABIReturn] | None_ = None”The update result
delete*result *: algokit_utils.transactions.transaction_sender.SendAppTransactionResult[algokit_utils.applications.abi.ABIReturn] | None_ = None
Section titled “delete*result *: algokit_utils.transactions.transaction_sender.SendAppTransactionResult[algokit_utils.applications.abi.ABIReturn] | None_ = None”The delete result
class algokit_utils.applications.app_deployer.AppDeployer(app_manager: algokit_utils.applications.app_manager.AppManager, transaction_sender: algokit_utils.transactions.transaction_sender.AlgorandClientTransactionSender, indexer: algosdk.v2client.indexer.IndexerClient | None = None)
Section titled “class algokit_utils.applications.app_deployer.AppDeployer(app_manager: algokit_utils.applications.app_manager.AppManager, transaction_sender: algokit_utils.transactions.transaction_sender.AlgorandClientTransactionSender, indexer: algosdk.v2client.indexer.IndexerClient | None = None)”Manages deployment and deployment metadata of applications
- Parameters:
- app_manager – The app manager to use
- transaction_sender – The transaction sender to use
- indexer – The indexer to use
- Example:
deployer = AppDeployer(app_manager, transaction_sender, indexer)
deploy(deployment: AppDeployParams) → AppDeployResult
Section titled “deploy(deployment: AppDeployParams) → AppDeployResult”Idempotently deploy (create if not exists, update if changed) an app against the given name for the given creator account, including deploy-time TEAL template placeholder substitutions (if specified).
To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
Note: When using the return from this function be sure to check operation_performed to get access to return properties like transaction, confirmation and delete_result.
Note: if there is a breaking state schema change to an existing app (and on_schema_break is set to ‘replace’) the existing app will be deleted and re-created.
Note: if there is an update (different TEAL code) to an existing app (and on_update is set to ‘replace’) the existing app will be deleted and re-created.
- Parameters: deployment – The arguments to control the app deployment
- Returns: The result of the deployment
- Raises: ValueError – If the app spec format is invalid
- Example:
deployer.deploy(AppDeployParams(create_params=AppCreateParams(sender='SENDER_ADDRESS',approval_program='APPROVAL PROGRAM',clear_state_program='CLEAR PROGRAM',schema={'global_byte_slices': 0,'global_ints': 0,'local_byte_slices': 0,'local_ints': 0}),update_params=AppUpdateParams(sender='SENDER_ADDRESS'),delete_params=AppDeleteParams(sender='SENDER_ADDRESS'),metadata=AppDeploymentMetaData(name='my_app',version='2.0',updatable=False,deletable=False),on_schema_break=OnSchemaBreak.AppendApp,on_update=OnUpdate.AppendApp))
get_creator_apps_by_name(*, creator_address: str, ignore_cache: bool = False) → ApplicationLookup
Section titled “get_creator_apps_by_name(*, creator_address: str, ignore_cache: bool = False) → ApplicationLookup”Returns a lookup of name => app metadata (id, address, …metadata) for all apps created by the given account that have an ARC-2 AppDeployNote as the transaction note of the app creation transaction.
This function caches the result for the given creator account so that subsequent calls won’t require an indexer lookup.
If the AppManager instance wasn’t created with an indexer client, this function will throw an error.
- Parameters:
- creator_address – The address of the account that is the creator of the apps you want to search for
- ignore_cache – Whether or not to ignore the cache and force a lookup, default: use the cache
- Returns: A name-based lookup of the app metadata
- Raises: ValueError – If the app spec format is invalid
- Example:
result = await deployer.get_creator_apps_by_name(creator)