Deploying Contract with BP Ap
Contracts can be deployed or updated via two methods: aelf explorer or aelf-command. Ensure npm and aelf-command are installed before starting. Follow the Deployment Environment guide if needed.
Overview#
In these cases, BP approval is needed for contract updates:
System contracts can only be deployed in the Genesis block. After launch, only updates are supported. This guide focuses on contract deployment on aelf Mainnet with ContractDeploymentAuthorityRequired set to true.
Deploy / Update through aelf Explorer#
To deploy/update contracts on AElf Mainnet with ContractDeploymentAuthorityRequired true, create an AElf wallet and have around 100 ELF. When ContractDeploymentAuthorityRequired is false, use DeploySmartContract and UpdateSmartContract in Contract Zero.
Learn how to deploy contracts through aelf Explorer
Deploy / Update through aelf-command #
Contracts Deployment/Update Procedure#
Developer: ProposeNewContract / ProposeUpdateContract
Contract Deployment
Contract Update
BP: Parliament.Approve
BPs approve the ProposeContractCodeCheck proposal:
Developer: ReleaseApprovedContract
If 2/3 (rounding down) + 1 BPs approve, the developer initiates ReleaseApprovedContract to release the proposal, creating a CodeCheck proposal for automatic code check.
BP: Parliament.ApproveMultiProposals (Automatic)
BPs complete the code check. If it passes, an ApproveMultiProposals transaction is initiated automatically, approving the CodeCheck proposal. If it fails, the process stops.
Developer: ReleaseCodeCheckedContract
The developer initiates ReleaseCodeCheckedContract to release the CodeCheck proposal. The DeploySmartContract or UpdateSmartContract method is executed, completing the deployment/update.
Edited on: 16 July 2024 05:39:50 GMT+0