sui genesis command bootstraps and initializes a new Sui network by generating the genesis configuration and validator setup.
Synopsis
Options
path
Start genesis with a given config file
path
Build a genesis config, write it to the specified path, and exit (without creating genesis blob)
path
Working directory for genesis files. Defaults to
~/.sui/sui_config/boolean
Forces overwriting existing configuration
u64
Epoch duration in milliseconds
string[]
List of IP addresses to generate a genesis suitable for benchmarks. Comma-separated
boolean
Creates an extra faucet configuration for sui persisted runs
usize
Set number of validators in the network
Description
The genesis command creates the initial state for a new Sui network. It generates:- Genesis blob containing the initial network state
- Validator configurations
- Network configuration
- Initial objects and system state
- Optionally, faucet configuration
Usage Modes
1. Default Genesis (Fresh Start)
Create a new genesis in the default directory:~/.sui/sui_config/genesis.blob~/.sui/sui_config/network.yaml- Validator configurations
2. Custom Working Directory
Generate genesis in a specific directory:3. From Existing Config
Use a pre-configured genesis config file:4. Write Config Only
Generate a genesis config template without creating the genesis blob:--from-config to create the genesis.
5. With Faucet
Create genesis with faucet configuration:- Standard genesis files
sui.keystorewith faucet keypair- Faucet configuration for use with
sui start --with-faucet
6. Custom Epoch Duration
Set a specific epoch duration:7. Benchmark Genesis
Generate a genesis suitable for benchmarking:8. Custom Committee Size
Set the number of validators:Generated Files
After runningsui genesis, the working directory contains:
--with-faucet:
Genesis Config File Format
When using--write-config, a YAML file is generated with this structure:
Workflow Examples
Local Development Network
Production-Like Network
Benchmark Network
Multi-Validator Local Setup
Force Overwrite
The--force flag allows overwriting an existing configuration:
Genesis Blob
Thegenesis.blob file contains the serialized initial state of the Sui network, including:
- System packages (framework, stdlib)
- Initial validator set
- Genesis objects (coins, system state)
- Protocol configuration
- Network parameters
Validator Configuration
Each validator directory contains:node.yaml
Validator node configuration:Key Files
protocol.key- BLS12-381 protocol keypairnetwork.key- Network identity keypairworker.key- Narwhal worker keypairaccount.key- Account keypair for rewards
Network Configuration
Thenetwork.yaml file contains:
Epoch Duration
The epoch duration determines how frequently the network transitions epochs:- Development: 60000ms (1 minute) for rapid testing
- Staging: 3600000ms (1 hour) for realistic testing
- Production: 86400000ms (24 hours) typical mainnet duration
Advanced: Custom Protocol Config
For advanced users, protocol configuration can be customized via environment variables when generating genesis:Distributed Genesis Ceremony
For production networks with multiple independent validators:-
Organizer generates template:
-
Each validator generates their keys:
-
Validators submit their
validator.infoto organizer -
Organizer combines all validator info into config
Edit
genesis-template.yamlto include all validator information -
Organizer generates genesis:
-
Distribute
genesis.bloband configs to validators
Troubleshooting
Directory Not Empty
Error: Genesis directory contains existing files Solution:Invalid Validator Configuration
Error: Validator info validation failed Solution:- Verify all validator addresses are valid multiaddrs
- Check that protocol keys are properly formatted
- Ensure stake amounts are sufficient
Missing Dependencies
Error: Cannot load system packages Solution:- Ensure Sui binaries are properly installed
- Check that framework packages are available
- Rebuild Sui from source if necessary
See Also
- sui start - Start a Sui network from genesis
- sui validator make-validator-info - Generate validator info
- Genesis ceremony documentation - Production genesis process