Skip to content
This new developer portal is under construction. For complete documentation, please refer to the old developer portal.

Getting Started with AlgoKit

Hello, Developer! Welcome to Algorand!

This quick start guide will help you set up your development environment, create your first Algorand project with AlgoKit, and deploy your first Algorand smart contract. By the end of this guide, you’ll be ready to build your own decentralized application on the Algorand blockchain.

AlgoKit is a comprehensive toolkit that allows developers to quickly and easily build and launch secure, automated, production-ready decentralized applications on the Algorand protocol. With AlgoKit 2.0, you can now write Algorand smart contracts using Python, one of the world’s most popular programming languages.

In addition, AlgoKit features:

  • A library of smart contract templates to kickstart your project.
  • Local application infrastructure setup.
  • Toolchain integrations for popular languages like Python and TypeScript.
  • A simplified frontend design experience.

Let’s get started!

Development Environment Setup

Let’s first set up your development environment to start building on Algorand. Follow the instructions below and install all of the prerequisites and AlgoKit.

Prerequisites

Install AlgoKit

  1. To install AlgoKit, run the following command from a terminal.

    Terminal window
    pipx install algokit
  2. If you used AlgoKit before, update it with pipx:

    Terminal window
    pipx upgrade algokit
  3. After the installation completes, restart the terminal.

If you want to learn about AlgoKit features, AlgoKit videos are available on the @AlgoDevs YouTube channel.

Verify the Installation

To verify AlgoKit installed correctly run the following.

Terminal window
algokit --version

Output similar to the following should be displayed:

Terminal window
algokit, version 2.1.2

Start a LocalNet

When building smart contracts, start by testing on a local Algorand blockchain running on your computer. Deploying and calling smart contracts on mainnet (the live public blockchain for production) costs real money. Deploying on testnet (a replica of mainnet for testing) can be cumbersome. Therefore, it is recommended to first test on the local blockchain. Once everything works, move to testnet for final testing, and then deploy to mainnet to launch your application.

AlgoKit supports using a local version of the Algorand blockchain. To start an instance of this LocalNet first open Docker Desktop on your computer and then run the following command from the terminal:

Terminal window
algokit localnet start

This should start an instance of the LocalNet within docker. If you go to the Docker Desktop application you should see something similar to the following:

Image of Docker Desktop after launching localnet

Create an AlgoKit Project

Now, let’s create an Algorand project with AlgoKit. We will refer to these projects as “AlgoKit projects.” AlgoKit provides a series of templates for you to use depending on the type of project you want to create.

  1. To create a new AlgoKit project you can easily do so by running:

    Terminal window
    algokit init

    This will launch a guided menu system to create a specific project tailored to your needs. You will first be prompted to select the type of project you want to create. For this quick start guide, we will use the Python smart contract template, so select the “Smart Contracts” option.

    AlgoKit Init #1
  2. Next, AlgoKit will ask you what programming language you want to use for the smart contract. With AlgoKit 2.0, you can now write Algorand smart contracts with native Python. Let’s select “Python” as our smart contract language by pressing enter.AlgoKit Init #2

  3. Then AlgoKit will ask you for the name of the project. Let’s name it “hello-algorand”, but if you want to name it differently, feel free to do so! After writing the name, press enter to continue.AlgoKit Init #3

  4. Next you can set the name of the smart contract. We will keep it as it is for now.AlgoKit Init #4

  5. Next, you can select the template preset. The “Starter” preset is for quickly implementing and testing certain features whereas the “Production” preset is for production-ready applications. For this guide, let’s select “Starter”.AlgoKit Init #5

  6. Next, AlgoKit will ask you what language you want to use for contract deployment. After writing your smart contract you need to deploy and call the contract either from your frontend or backend. Since most frontend frameworks are in TypeScript, let’s select TypeScript for this guide.AlgoKit Init #6

  7. Next, AlgoKit will ask you if you want to run the algokit project bootstrap command to install the necessary dependencies. Say yes by pressing “y” This process can take a few minutes.AlgoKit Init #7

  8. Finally, AlgoKit will ask you if you want to initialize a git repository. Let’s say yes by pressing “y” so that we can easily push our AlgoKit project to Github.AlgoKit Init #8

  9. Once finished, (if you have it installed) VS Code should automatically be opened with the initialized project and you will be prompted to install appropriate VS Code extensions.AlgoKit Init #9

  10. This starter app will contain one smart contract built with Python named contract.py, in the smart_contracts/hello_world folder, with one method hello that takes a String and returns a String.AlgoKit Init #10

Run the Demo Application

Once the starter project is created, you will notice in the smart_contracts/hello_world folder a file named deploy_config.ts which is a simple example of using AlgoKit to deploy and make a call to the contract.py smart contract on the LocalNet instance started earlier.

Now there are two ways to run the deploy-config.ts file to deploy and call the smart contract:

  1. By hitting F5 it will start LocalNet, build the smart contract, deploy and call the smart contract contract.py by running the deploy-config.ts file. The output should look similar to the following:

    Terminal window
    === Deploying HelloWorld === Idempotently
    deploying app "HelloWorld" from creator
    3TKAAPLBGRDCFF2M35X7TCZFMSSEAKV6WHJWOVO6C7LTFG2OAMJ5AA72AM using 85 bytes of
    teal code and 4 bytes of teal code App HelloWorld not found in apps created by
    3TKAAPLBGRDCFF2M35X7TCZFMSSEAKV6WHJWOVO6C7LTFG2OAMJ5AA72AM; deploying app with
    version 1.0. Created app 1002 from creator
    3TKAAPLBGRDCFF2M35X7TCZFMSSEAKV6WHJWOVO6C7LTFG2OAMJ5AA72AM Called hello on
    HelloWorld (1002) with name = world, received: Hello, world
  2. Alternatively, you can run the following commands from the terminal to build and run the deploy-config.ts file:

    Terminal window
    algokit project run build
    algokit project deploy localnet

    The output should look similar to the following:

    AlgoKit Build and Deploy with CLI

The App ID of of the deployed contract and its Algorand address is displayed, followed by the message returned from the smart contract call Hello, world.

Additionally, you can find the native TEAL smart contract code and the appropriate smart contract manifest JSON files automatically generated in the artifacts folder.

Next steps