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 chainsubnetID
: The ID of the Subnet you want to add the chain tovmID
: The ID of the Virtual Machine that will be used to run the chaingenesisData
: 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 ahypersdk
-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
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?