How to destroy AppAgent
Intro
Destroying an AppAgent means removing it from the blockchain. This is a complex multi-stage process since an AppAgent is responsible for other addresses and assets on chain. The deletion is started by calling initiate_destroy_app_agent
which changes the status to ready to be deleted. After this, all of the assets and addresses controlled by the AppAgent must be properly cleaned up before an AppAgent can be completely deleted.
AppAgent Destruction Stages
DestroyInitiated: Indicates that the AppAgent has initiated the destruction process. This event marks the beginning of the destruction phase for the AppAgent.
The destruction can be cancelled or reversed at this stage only.
DestroyingOwnAssets: Signifies that the AppAgent is currently in the process of destroying its owned assets.
This could include any resources or properties directly associated with the app agent.
DestroyingAddressPool: Denotes that the AppAgent is in the process of destroying its address pool.
This typically involves deallocating or releasing addresses or identifiers managed by the AppAgent.
DestroyingAppAgent: Indicates that the AppAgent is currently in the process of destroying its storage or internal data structures.
This phase involves clearing out any data or state associated with the AppAgent.
Destroyed: Marks the completion of the destruction process for the AppAgent.
At this stage, the AppAgent has been successfully destroyed, and its resources have been deallocated or released.
Prerequisites
Ensure the caller address is the owner of the AppAgent
Ensure the caller address has sufficient tokens to pay the transaction fees.
Destroy an AppAgent
Re-activate the AppAgent after initiating destruction
β οΈ An AppAgent can only be reactivated when in the DestroyInitiated state within the expiry period.
Last updated