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 corresponds to the height at which the first DA header/data has been published.
// This value is meant to be updated after genesis and shared to all syncing nodes for speeding up syncing via DA.
DAStartHeight uint64 `json:"da_start_height"`
// DaEpochForcedInclusion corresponds to the amount of DA blocks are considered an epoch
// When forced inclusion is enabled, the epoch size determines at what frequency the forced included transactions are executed by the application.
DAEpochForcedInclusion uint64 `json:"da_epoch_forced_inclusion"`
}
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.