Skip to main content
The 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:
This creates:
  • ~/.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:
You can then edit the config and use --from-config to create the genesis.

5. With Faucet

Create genesis with faucet configuration:
This generates:
  • Standard genesis files
  • sui.keystore with faucet keypair
  • Faucet configuration for use with sui start --with-faucet

6. Custom Epoch Duration

Set a specific epoch duration:
Default: Determined by network configuration

7. Benchmark Genesis

Generate a genesis suitable for benchmarking:
Creates a network configuration with validators at the specified IP addresses.

8. Custom Committee Size

Set the number of validators:

Generated Files

After running sui genesis, the working directory contains:
With --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:
This will delete all existing genesis data, validator configurations, and network state. Use with caution.

Genesis Blob

The genesis.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
This file must be available to all validators and fullnodes to start the network.

Validator Configuration

Each validator directory contains:

node.yaml

Validator node configuration:

Key Files

  • protocol.key - BLS12-381 protocol keypair
  • network.key - Network identity keypair
  • worker.key - Narwhal worker keypair
  • account.key - Account keypair for rewards

Network Configuration

The network.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:
Custom protocol config should only be used in development/test networks. Incompatible settings can cause network failures.

Distributed Genesis Ceremony

For production networks with multiple independent validators:
  1. Organizer generates template:
  2. Each validator generates their keys:
  3. Validators submit their validator.info to organizer
  4. Organizer combines all validator info into config Edit genesis-template.yaml to include all validator information
  5. Organizer generates genesis:
  6. Distribute genesis.blob and 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

Examples

Quick Local Network

Development Network with Custom Parameters

Production Template