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

If you add it to your path, you should be able to call the program anywhere with just avalanche. To add it to your path permanently, add an export command to your shell initialization script (ex: .bashrc or .zshrc).

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

Create Your Avalanche L1 Configuration

This tutorials teaches you how to create an Ethereum Virtual Machine (EVM) based Avalanche L1. To do so, you use Subnet-EVM, Avalanche's Avalanche 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 L1 command suite provides a collection of tools for developing and deploying Avalanche L1s.

The Avalanche L1 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

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

Select Subnet-EVM.

Choose Your Validator Manager Contract

Choose either Proof of Authority (PoA) or Proof of Stake (PoS) as your consensus mechanism.

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

For this tutorial, select Proof of Authority (PoA).

For more info, reference the Validator Manager Contracts.

Enter Owner Address for Validator Manager Contract

This address will be able to add and remove validators from your Avalanche L1. You can either use an existing key or create a new one.

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

In addition to being the PoA owner, this address will also be the owner of the ProxyAdmin contract of the Validator Manager's TransparentUpgradeableProxy. This address will be able to upgrade the Validator Manager implementation through upgrading the proxy.

Enter EVM Configuration

The CLI provides some default values to help you get started. You can choose to use these defaults or customize them. These values include things such as airdrop amount, gas fees, and gas limits.

? 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

For this tutorial, select I want to use defaults for a test environment.

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