Rise In Logo

Build on Algorand

Deploy Smart Contract with AlgoKit

Deploy Smart Contract with AlgoKit

1. Initialize a New AlgoKit Project

Start by creating a new project using the AlgoKit CLI. Open your terminal and run:

algokit init
  • When prompted, select the Smart Contracts option to use a template tailored for smart contract development.
  • Choose your preferred language (for this example, select Python).
  • Provide a consistent name for your project folder and smart contract app (e.g., `hello_world`).
  • Select the Starter preset for a quick setup.

When prompted, you can choose to run the bootstrap process, which installs all required dependencies and sets up your project environment, ensuring your Algorand smart contract project is ready to use immediately; you can also optionally initialize a git repository with an initial commit Getting Started with AlgoKit.


2. Build the Smart Contract

Navigate to your project directory and compile your smart contract source code to generate the required build artifacts:

algokit project run build

This command compiles your contract and prepares the artifacts needed for deployment and interaction. For more information, see Smart Contract Development Lifecycle

3. Deploy to Localnet

First, ensure your local Algorand test network (Localnet) is running:

algokit localnet start

Then, deploy your compiled smart contract to Localnet:

algokit project deploy localnet

At the end of the deployment, you should see an output similar to the following:

INFO   : Called hello on HelloWorld (1002) with name=World, received: Hello, World

This indicates that the contract was deployed and called. For more information, see Run the Demo Application.

4. Interact with the Smart Contract

To interact with your deployed contract, open the `deploy_config.py` file located in the `smart_contracts/hello_world` folder. Here, you can update the value of the `name` variable to test different inputs.

5. Verify Deployment

You can further verify your deployment using a block explorer that supports Algorand Testnet, such as Lora Explorer. Use the following command to open the explorer:

algokit explore

If you click on logs, then UTF-8 you will be able to see the output of your transaction.

For more information, see Run the Demo Application.

Comments

You need to enroll in the course to be able to comment!

Stay in the know

Never miss updates on new programs and opportunities.

Rise In Logo

Rise together in web3!

Disclaimer: The information, programs, and events provided on https://risein.com is strictly for upskilling and networking purposes related to the technical infrastructure of blockchain platforms. We do not provide financial or investment advice, nor do we make any representations regarding the value, profitability, or future price of any blockchain or cryptocurrency. Users are encouraged to conduct their own research and consult with licensed financial professionals before engaging in any investment activities. https://risein.com disclaims any responsibility for financial decisions made by users based on the information provided here.