Documentation
¶
Index ¶
Constants ¶
View Source
const ChainIDFlag = "chain_id"
Variables ¶
View Source
var ErrGenesisExists = fmt.Errorf("genesis file already exists")
Functions ¶
func CreateGenesis ¶
func CreateGenesis(homePath string, chainID string, initialHeight uint64, proposerAddress []byte) error
CreateGenesis creates and saves a genesis file with the given app state. If the genesis file already exists, it skips the creation and returns ErrGenesisExists. The genesis file is saved in the config directory of the specified home path. It should only be used when the application is NOT handling the genesis creation.
func GenesisPath ¶
GenesisPath returns the genesis file path from a home directory.
Types ¶
type Genesis ¶
type Genesis struct {
ChainID string `json:"chain_id"`
StartTime time.Time `json:"start_time"`
InitialHeight uint64 `json:"initial_height"`
ProposerAddress []byte `json:"proposer_address"`
DAStartHeight uint64 `json:"da_start_height"`
}
Genesis represents the genesis state of the blockchain. This genesis struct only contains the fields required by evolve. The app state or other fields are not included here.
func LoadGenesis ¶
LoadGenesis loads the genesis state from the specified file path.
func NewGenesis ¶
func NewGenesis( chainID string, initialHeight uint64, startTime time.Time, proposerAddress []byte, ) Genesis
NewGenesis creates a new Genesis instance.
Click to show internal directories.
Click to hide internal directories.