Running the node
By default, running the node without any subcommand starts the node in normal mode:Commands overview
All commands are invoked using the following pattern:benchmark
Performance benchmarking utilities
try-runtime
Test commands against runtime state
key
Key management and generation
verify
Verify message signatures
vanity
Generate vanity addresses
sign
Sign messages with keys
build-spec
Build chain specifications
check-block
Validate block integrity
export-blocks
Export blockchain data
export-state
Export state snapshots
import-blocks
Import blockchain data
purge-chain
Remove chain data
revert
Revert to previous state
chain-info
Display database information
benchmark
Sub-commands for performance benchmarking. The pallet benchmarking functionality is available under thepallet sub-command.
Benchmarking commands are primarily used during development and testing to measure the performance characteristics of pallets and runtime components.
Common benchmark subcommands
Thebenchmark command includes several subcommands:
pallet- Benchmark pallet execution timesstorage- Benchmark storage operationsoverhead- Benchmark block and extrinsic overheadblock- Benchmark block executionmachine- Benchmark hardware capabilities
Example
try-runtime
Execute commands against runtime state for testing and debugging purposes.Use cases
- Testing runtime upgrades before deployment
- Debugging runtime behavior
- Validating state migrations
- Simulating transactions
Example
key
Key management utilities for generating, inspecting, and managing cryptographic keys.Subcommands
generate
Generate a new secret key and output the corresponding public key and account ID.inspect
Inspect a secret URI and display the associated public key and account ID.insert
Insert a key into the keystore.inspect-key
Inspect a key in the keystore.Common options
--scheme- Cryptographic scheme (Sr25519, Ed25519, Ecdsa)--network- Network address format--output-type- Output format (Json, Text)
verify
Verify a signature for a message provided on STDIN with a given public or secret key.Example
The message is read from standard input (STDIN), while the public key and signature are provided as arguments.
vanity
Generate a seed that produces a vanity address matching a specific pattern.Example
sign
Sign a message with a given secret key.Example
The message is read from standard input (STDIN). The signature is output to STDOUT.
build-spec
Build and export a chain specification file.Common options
--chain <CHAIN_SPEC>- Source chain specification--raw- Output as raw (runtime-compatible) format--disable-default-bootnode- Disable default bootnodes
Examples
Raw chain specs are required for production networks. They contain the compiled runtime and cannot be easily modified.
check-block
Validate blocks from the database or imported from files.Options
--block-hash <HASH>- Block hash to check--default-heap-pages <COUNT>- Default heap pages for Wasm execution
Example
export-blocks
Export blocks to a file.Options
--from <BLOCK>- Starting block number (default: 1)--to <BLOCK>- Ending block number--binary- Export in binary format instead of JSON
Examples
export-state
Export the state of a given block into a chain specification.Options
--block <BLOCK>- Block hash or number to export state from--chain <CHAIN_SPEC>- Source chain specification
Example
Exported state can be used to bootstrap new networks or create fork chains for testing.
import-blocks
Import blocks from a file.Options
--default-heap-pages <COUNT>- Default heap pages for Wasm execution--execution <STRATEGY>- Execution strategy for block import--binary- Import binary format instead of JSON
Example
purge-chain
Remove the entire chain database.Options
--chain <CHAIN_SPEC>- Chain specification--base-path <PATH>- Base path for chain data-y- Skip confirmation prompt
Example
This command permanently deletes all blockchain data including blocks, state, and keys. This action cannot be undone. Always ensure you have backups before running this command.
revert
Revert the chain to a previous state by removing recent blocks.Options
--num <BLOCKS>- Number of blocks to revert (default: 256)
Example
chain-info
Display database metadata and column information.Example
Help and version
Get help
Display help information for any command:Check version
Next steps
Flags reference
Complete list of CLI flags and options
Running a node
Learn how to run an Avail node