Documentation

Create Avalanche L1

This page demonstrates how to create an Avalanche L1 using Avalanche-CLI.

This tutorial walks you through the process of using Avalanche-CLI to create an Avalanche L1, deploy it to a local network, and connect to it with Core wallet.

The first step of learning Avalanche L1 development is learning to use Avalanche-CLI.

Installation

The fastest way to install the latest Avalanche-CLI binary is by running the install script:

curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh | sh -s

The binary installs inside the ~/bin directory. If the directory doesn't exist, it will be created.

You can run all of the commands in this tutorial by calling ~/bin/avalanche.

You can also add the command to your system path by running:

export PATH=~/bin:$PATH

To make this change permanent, add this line to your shell’s initialization file (e.g., ~/.bashrc or ~/.zshrc). For example:

echo 'export PATH=~/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Once you add it to your path, you should be able to call the program anywhere with just: avalanche

For more detailed installation instructions, see Avalanche-CLI Installation.

Create Your Avalanche L1 Configuration

This tutorial teaches you how to create an Ethereum Virtual Machine (EVM) based Avalanche L1. To do so, you use Subnet-EVM, Avalanche's L1 fork of the EVM. It supports airdrops, custom fee tokens, configurable gas parameters, and multiple stateful precompiles. To learn more, take a look at Subnet-EVM. The goal of your first command is to create a Subnet-EVM configuration.

The avalanche-cli command suite provides a collection of tools for developing and deploying Avalanche L1s.

The Creation Wizard walks you through the process of creating your Avalanche L1. To get started, first pick a name for your Avalanche L1. This tutorial uses myblockchain, but feel free to substitute that with any name you like. Once you've picked your name, run:

avalanche blockchain create myblockchain

The following sections walk through each question in the wizard.

Choose Your VM

? Which Virtual Machine would you like to use?: 
 Subnet-EVM
    Custom VM
    Explain the difference

Select Subnet-EVM.

Choose Validator Manager

? Which validator management type would you like to use in your blockchain?: 
  ▸ Proof Of Authority
    Proof Of Stake
    Explain the difference

Select Proof Of Authority.

? Which address do you want to enable as controller of ValidatorManager contract?: 
  ▸ Get address from an existing stored key (created from avalanche key create or avalanche key import)
    Custom

Select Get address from an existing stored key.

? Which stored key should be used enable as controller of ValidatorManager contract?: 
  ▸ ewoq
    cli-awm-relayer
    cli-teleporter-deployer

Select ewoq.

This key is used to manage (add/remove) the validator set.

Do not use EWOQ key in a testnet or production setup. The EWOQ private key is publicly exposed.

To learn more about different validator management types, see PoA vs PoS.

Choose Blockchain Configuration

? Do you want to use default values for the Blockchain configuration?: 
  ▸ I want to use defaults for a test environment
    I want to use defaults for a production environment
    I don't want to use default values
    Explain the difference

Select I want to use defaults for a test environment. This will automatically setup the configuration for a test environment, including an airdrop to the EWOQ key and Avalanche ICM.

Enter Your Avalanche L1's ChainID

✗ Chain ID: 

Choose a positive integer for your EVM-style ChainID.

In production environments, this ChainID needs to be unique and not shared with any other chain. You can visit chainlist to verify that your selection is unique. Because this is a development Avalanche L1, feel free to pick any number. Stay away from well-known ChainIDs such as 1 (Ethereum) or 43114 (Avalanche C-Chain) as those may cause issues with other tools.

Token Symbol

✗ Token Symbol: 

Enter a string to name your Avalanche L1's native token. The token symbol doesn't necessarily need to be unique. Example token symbols are AVAX, JOE, and BTC.

Wrapping Up

If all worked successfully, the command prints:

 Successfully created blockchain configuration

You've successfully created your first Avalanche L1 configuration. Now it's time to deploy it.

Edit on GitHub

Last updated on

On this page