Subnet Creation

A quick review of creating a Subnet on Avalanche - the foundation for our permissioned L1

In the Avalanche Fundamentals course, you learned how to quickly set up an L1 using the Developer Console. This section provides an in depth review of that flow, understanding what comes pre-configured in our genesis, and laying the foundation for what we will need for our Permissioned L1.

Creating a Subnet

Let's create a fresh new Subnet that we can use during this course to test all of the tools and flows for managing Permissioned L1s.

Connect & Fund Core Wallet

  1. Download Core Wallet if not already installed
  2. Connect your wallet and set to Tesnet mode (upper-right toggle button)
  3. Use the faucet button in this wallet component (below your C-chain balance) to claim test AVAX on the C-Chain
  4. Use the same button (but below P-Chain balance) to claim test AVAX on the P-Chain

Create Subnet and Blockchain Records

Create the Subnet by issuing two transactions on the P-Chain (hence the need for test AVAX on the P-chain).

These transactions are:

  1. CreateSubnetTx - Creates a Subnet identified by the transaction hash
  2. CreateChainTx - Adds a blockchain to the Subnet

For this guide, we will create our blockchain as an uncustomized EVM so you just need to rename it (if you want).

On Step 2: Create a Chain select the Genesis JSON tab to the right and skim through it. No need to understand it all but good to get familiar with it before the next section.

Key Parameters:

  • Subnet Owner: P-chain address of your connected wallet
  • Chain Name: Your blockchain's name
  • VM ID: Default value srEX...Dy when creating with an uncustomized VM
  • Genesis Data: Initial blockchain configuration

Set Up Validator Node

Launch a node to track your Subnet using Docker. This node will become a validator for your Subnet, and later will be managed by the Validator Manager contract when we convert to L1.

Builder Console

L1 Node Setup with Docker

This will start a Docker container running an RPC or validator node that tracks your L1.

Set up Instance

Set up a linux server with any cloud provider, like AWS, GCP, Azure, or Digital Ocean. Low specs (e.g. 2 vCPUs, 4GB RAM, 20GB storage) are sufficient for basic tests. For more extensive test and production L1s use a larger instance with appropriate resources (e.g. 8 vCPUs, 16GB RAM, 1 TB storage).

If you do not have access to a server, you can also run a node for educational purposes locally. Simply select the "RPC Node (Local)" option in the next step.

Docker Installation

Make sure you have Docker installed on your system. You can use the following commands to install it:

# Install Docker using convenience script
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
newgrp docker
 
# Test installation
docker run -it --rm hello-world
 

If you do not want to use Docker, you can follow the instructions here.

Select L1

Enter the Avalanche Subnet ID of the L1 you want to run a node for.

Key Takeaways

  • P-Chain Registry: All validators and blockchains are registered on the P-Chain
  • Subnet Foundation: Your Subnet provides the blockchain infrastructure necessary for this course

Is this guide helpful?

Report Issue

On this page