Create a Blockchain

Create a blockchain on the P-Chain.

Now that we have the genesis file created, we can add a chain to the Subnet that you've created earlier. You will do this by issuing a CreateChainTx on the P-Chain. This will create the P-Chain record for your blockchain and associate it with the Subnet. The CreateChainTx transaction has the following parameters:

  • name: The name of the chain
  • subnetID: The ID of the Subnet you want to add the chain to
  • vmID: The ID of the Virtual Machine that will be used to run the chain
  • genesisData: The genesis configuration of the chain

The blockchain will be uniquely identified by the transaction hash of the CreateChainTx transaction.

Virtual Machine (VM) Configuration

When creating your blockchain, you'll need to specify the appropriate Virtual Machine ID:

  • For standard Subnet-EVM chains, use the default VM ID: srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
  • If you're deploying a custom VM (such as subnet-evm with custom precompiles or a hypersdk-based chain), you must specify the correct custom VM ID

Creating Your Blockchain

Use the interactive tool below to complete the blockchain creation process:

Create Chain

⚠️Please generate genesis data first usingthe Genesis Builder tool.

When the transaction was submitted successfully, you can head to the P-Chain Explorer for the Fuji testnet and search for the transaction hash to verify the creation of the blockchain.

An endpoint to query the blockchain details via the Avalanche API will be available shortly.

Is this guide helpful?

On this page