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, 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.
Swap insights and ask questions about “Build on Algorand”.
Ask a question or share your thoughts about this lesson.