Learn how to use Avalanche Network Runner to spin up your own EVM blockchain.
In the following commands, make sure to substitute the name of your Subnet for <subnetName> (including the <>). You can choose whatever name you want, but I recommend using mysubnet as the name to avoid the need for some manual configuration.
To create a Subnet configuration run the following command
For example:
You will be prompted a Wizard to set the Subnet config. For now, follow the default options where possible, except when asked for the Airdrop. Select the ewoq address for the airdrop. This address is the default address for the Avalanche test environments and is used for testing purposes.
For convenience, the private key 56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027 of the default ewoq address is stored in the environment variable $PK.
PLACEHOLDER VIDEO subnet create
After the finishing, you should see something like this:
This command creates the config files genesis.json and sidecar.json inside: ~/.avalanche-cli/subnets/<subnetName>. If you want, you can retrieve the current config with the following command:
Now that we created our Subnet config, we need a network that will host that Subnet. The following command will launch 5 nodes running locally:
The result should be something like this:
You can check at any time if the network is running by issuing the following command:
If you don't start your network manually it will be automatically started when you deploy your first Subnet with the avalanche subnet deploy <subnetName> command.
When prompted select Local Network to deploy on. After the deployment your should see something like this:
This output includes the endpoints of your 5 nodes where you can connect to interact with your Subnet. You're running a Subnet-EVM, this means you can use those RPC URLs to connect to EVM compatible wallet or tools.
Since the Avalanche Network is running in a Github Codespace the localhost (127.0.0.1) will only be accessible from inside the Codespace. Connecting your wallet using the localhost RPC URL will not work, since your wallet will be running on your computer, and not the local environment where the network is running (the Codespace cloud).
Therefore, we need to make the RPC-Endpoint publicly accessible. Click on the little antenna icon in the bottom bar of the Codespace:
There select the row with the port 9650 and right-click to open the port: