The subnet command suite provides a collection of tools for developing and deploying Subnets.
To get started, use the blockchain create command wizard to walk through the configuration of your very first Subnet. Then, go ahead and deploy it with the blockchain deploy command. You can use the rest of the commands to manage your Subnet configurations and live deployments.
The blockchain addValidator command whitelists a primary network validator to validate the provided deployed Subnet.
To add the validator to the Subnet's allow list, you first need to provide the subnetName and the validator's unique NodeID. The command then prompts for the validation start time, duration, and stake weight. You can bypass these prompts by providing the values with flags.
This command currently only works on Subnets deployed to either the Fuji Testnet or Mainnet.
AvalancheGo nodes support several different configuration files. Subnets have their own Subnet config which applies to all chains/VMs in the Subnet. Each chain within the Subnet can have its own chain config. This command allows you to set both config files.
The blockchain create command builds a new genesis file to configure your Subnet. By default, the command runs an interactive wizard. It walks you through all the steps you need to create your first Subnet.
The tool supports deploying Subnet-EVM and custom VMs. You can create a custom, user-generated genesis with a custom VM by providing the path to your genesis and VM binaries with the --genesis and --vm flags.
By default, running the command with a subnetName that already exists causes the command to fail. If you'd like to overwrite an existing configuration, pass the -f flag.
The blockchain deploy command deploys your Subnet configuration locally, to Fuji Testnet, or to Mainnet.
At the end of the call, the command prints the RPC URL you can use to interact with the Subnet.
Avalanche-CLI only supports deploying an individual Subnet once per network. Subsequent attempts to deploy the same Subnet to the same network (local, Fuji, Mainnet) aren't allowed. If you'd like to redeploy a Subnet locally for testing, you must first call avalanche network clean to reset all deployed chain state. Subsequent local deploys redeploy the chain with fresh state. You can deploy the same Subnet to multiple networks, so you can take your locally tested Subnet and deploy it on Fuji or Mainnet.
The blockchain describe command prints the details of a Subnet configuration to the console. By default, the command prints a summary of the configuration. By providing the --genesis flag, the command instead prints out the raw genesis file.
The blockchain import command imports configurations into Avalanche-CLI.
This command supports importing from a file created on another computer, or importing from Subnets running public networks (for example, created manually or with the deprecated Subnet-CLI)
To import from a file, you can optionally provide the path as a command-line argument. Alternatively, running the command without any arguments triggers an interactive wizard. To import from a repository, go through the wizard. By default, an imported Subnet doesn't overwrite an existing Subnet with the same name. To allow overwrites, provide the --force flag.
The blockchain import public command imports a Subnet configuration from a running network.
The genesis file should be available from the disk for this to work. By default, an imported Subnet doesn't overwrite an existing Subnet with the same name. To allow overwrites, provide the --force flag.
The blockchain join command configures your validator node to begin validating a new Subnet.
To complete this process, you must have access to the machine running your validator. If the CLI is running on the same machine as your validator, it can generate or update your node's config file automatically. Alternatively, the command can print the necessary instructions to update your node manually. To complete the validation process, the Subnet's admins must add the NodeID of your validator to the Subnet's allow list by calling addValidator with your NodeID.
After you update your validator's config, you need to restart your validator manually. If you provide the --avalanchego-config flag, this command attempts to edit the config file at that path.
This command currently only supports Subnets deployed on the Fuji Testnet and Mainnet.
The blockchain list command prints the names of all created Subnet configurations. Without any flags, it prints some general, static information about the Subnet. With the --deployed flag, the command shows additional information including the VMID, BlockchainID and SubnetID.
Apply generated upgrade bytes to running Subnet nodes to trigger a network upgrade.
For public networks (Fuji Testnet or Mainnet), to complete this process, you must have access to the machine running your validator. If the CLI is running on the same machine as your validator, it can manipulate your node's configuration automatically. Alternatively, the command can print the necessary instructions to upgrade your node manually.
After you update your validator's configuration, you need to restart your validator manually. If you provide the --avalanchego-chain-config-dir flag, this command attempts to write the upgrade file at that path. Refer to this doc for related documentation.
The blockchain upgrade generate command builds a new upgrade.json file to customize your Subnet. It guides the user through the process using an interactive wizard.
The blockchain upgrade vm command enables the user to upgrade their Subnet's VM binary. The command can upgrade both local Subnets and publicly deployed Subnets on Fuji and Mainnet.
The command walks the user through an interactive wizard. The user can skip the wizard by providing command line flags.
The node command suite provides a collection of tools for creating and maintaining validators on the Avalanche Network.
To get started, use the node create command wizard to walk through the configuration to make your node a primary validator on Avalanche public network. You can use the rest of the commands to maintain your node and make your node a Subnet Validator.
(ALPHA Warning) This command is currently in experimental mode.
The node create command sets up a validator on a cloud server of your choice. The validator will be validating the Avalanche Primary Network and Subnet of your choice. By default, the command runs an interactive wizard. It walks you through all the steps you need to set up a validator. Validators can be deployed in multiple regions/zones simultaneously. Once this command is run, you will have to wait for the validator to finish bootstrapping on the primary network before running further commands on it, for example validating a Subnet. You can check the bootstrapping status by running avalanche node status.
The created node will be part of group of validators called <clusterName> and users can call node commands with <clusterName> so that the command will apply to all nodes in the cluster.
(ALPHA Warning) This command is currently in experimental mode.
The node devnet command suite provides a collection of commands related to devnets. You can check the updated status by calling avalanche node status <clusterName>
The node devnet deploy command deploys a Subnet into a devnet cluster, creating Subnet and blockchain TXs for it. It saves the deploy info both locally and remotely.
(ALPHA Warning) This command is currently in experimental mode.
The node ssh command execute a given command using ssh on all nodes in the cluster. If no command is given, just prints the ssh command line to be used to connect to each node.
(ALPHA Warning) This command is currently in experimental mode.
The node status command gets the bootstrap status of all nodes in a cluster with the Primary Network. If no cluster is given, defaults to node list behaviour.
To get the bootstrap status of a node with a Subnet, use the --subnet flag.
(ALPHA Warning) This command is currently in experimental mode.
The node sync command enables all nodes in a cluster to be bootstrapped to a Subnet. You can check the Subnet bootstrap status by calling avalanche node status <clusterName> --subnet <blockchainName>
(ALPHA Warning) This command is currently in experimental mode.
The node update command suite provides a collection of commands for nodes to update their AvalancheGo version or VM version/config. You can check the status after update by running avalanche node status
(ALPHA Warning) This command is currently in experimental mode.
The node update subnet command updates all nodes in a cluster with latest Subnet configuration and You can check the updated Subnet bootstrap status by calling avalanche node status <clusterName> --subnet <blockchainName>
(ALPHA Warning) This command is currently in experimental mode.
The node validate command suite provides a collection of commands for nodes to join the Primary Network and Subnets as validators. If any of the commands is run before the nodes are bootstrapped on the Primary Network, the command will fail.
You can check the bootstrap status by running avalanche node status <clusterName>.
(ALPHA Warning) This command is currently in experimental mode.
The node validate subnet command enables all nodes in a cluster to be validators of a Subnet. If the command is run before the nodes are Primary Network validators, the command will first make the nodes Primary Network validators before making them Subnet validators. If The command is run before the nodes are bootstrapped on the Primary Network, the command will fail. You can check the bootstrap status by calling avalanche node status <clusterName>. If The command is run before the nodes are synced to the Subnet, the command will fail. You can check the Subnet sync status by calling avalanche node status <clusterName> --subnet <blockchainName>.
(ALPHA Warning) This command is currently in experimental mode.
The node whitelist command suite provides a collection of tools for granting access to the cluster.
Nodes created by Avalanche-CLI are protected by Cloud Security Group and only defined IP addresses are allowed to access. User IP is whitelisted automatically when cluster is created, but this command can be used in case of IP address changes or granting access to additional IPs. This command detects user current IP address automatically if no IP address is provided.
Secure SSH protocol is used to communicate with cloud instances. node whitelist command authorizes SSH public key on all nodes in the cluster if --ssh params is specified. Please keep your SSH private keys safe and secure, only share public keys to grant shell access to cloud instances running avalanchego.
(ALPHA Warning) This command is currently in experimental mode.
The node export command exports cluster configuration including their nodes to a text file. If no file is specified, the configuration is printed to the stdout. Use --include-secrets to include keys in the export. In this case this command can be used to backup your cluster configuration. Please keep the file secure as it contains sensitive information.
Exported cluster configuration without secrets it can be imported by another user using node import command.
(ALPHA Warning) This command is currently in experimental mode.
The node import command imports cluster configuration and cluster nodes from a text file. This file should be created using the node export command.
This command is useful with node whitelist command. With your SSH public key and IP whitelisted by cluster owner you will be able to execute commands and use avalanche-cli to manage this cluster. Please note, that this imported cluster will be considered as EXTERNAL by avalanche-cli so some commands affecting cloud nodes like node create or node destroy will be not applicable for it.
(ALPHA Warning) This command is currently in experimental mode.
The node resize command can be used to resize cluster instance size and/or size of the cloud persistent storage attached to the instance. In another words, it can change amount of CPU, memory and disk space available for the cluster nodes.
Please note that disk resize operation can affect disk performance during cloud operation to resize it. Please note that instance resize operation will replace cluster instances one by one, which might affect cluster stability.
The network command suite provides a collection of tools for managing local Subnet deployments.
When you deploy a Subnet locally, it runs on a local, multi-node Avalanche network. The blockchain deploy command starts this network in the background. This command suite allows you to shutdown, restart, and clear that network.
This network currently supports multiple, concurrently deployed Subnets.
The network clean command shuts down your local, multi-node network. All deployed Subnets shutdown and delete their state. You can restart the network by deploying a new Subnet configuration.
The network start command starts a local, multi-node Avalanche network on your machine.
By default, the command loads the default snapshot. If you provide the --snapshot-name flag, the network loads that snapshot instead. The command fails if the local network is already running.
The network stop command shuts down your local, multi-node network.
All deployed Subnets shutdown gracefully and save their state. If you provide the --snapshot-name flag, the network saves its state under this named snapshot. You can reload this snapshot with network start --snapshot-name <snapshotName>. Otherwise, the network saves to the default snapshot, overwriting any existing state. You can reload the default snapshot with network start.
The key command suite provides a collection of tools for creating and managing signing keys. You can use these keys to deploy Subnets to the Fuji Testnet, but these keys are NOT suitable to use in production environments. DO NOT use these keys on Mainnet.
The key create command generates a new private key to use for creating and controlling test Subnets. Keys generated by this command are NOT cryptographically secure enough to use in production environments. DO NOT use these keys on Mainnet.
The command works by generating a secp256 key and storing it with the provided keyName. You can use this key in other commands by providing this keyName.
If you'd like to import an existing key instead of generating one from scratch, provide the --file flag.
The key delete command deletes an existing signing key.
To delete a key, provide the keyName. The command prompts for confirmation before deleting the key. To skip the confirmation, provide the --force flag.
The key export command exports a created signing key. You can use an exported key in other applications or import it into another instance of Avalanche-CLI.
By default, the tool writes the hex encoded key to stdout. If you provide the --output flag, the command writes the key to a file of your choosing.