genesis

package
v0.0.0-...-f6bc33c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 12 Imported by: 0

README

genesis

The genesis package handle loading and dispatching the genesis configuration to the different engine and service. Upon the genesis block of the underlying blockchain, the application state is loaded, and sent through callback to the engine which registered interest.

This package also provide a command line to generate a default genesis state for a zeta application. This can be used using the following command line:

zeta genesis

This command will dump the default state in the standard output, it should then be used in the configuration file of the underlying blockchain. In the case of tendermint, is should be set to the "app_state" field of the genesis.json file.

The command can also update the genesis file directly using the following option:

zeta genesis --in-place=/PATH/TO/.cometbft/config/genesis.json

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Level encoding.LogLevel `long:"log-level"`
}

func NewDefaultConfig

func NewDefaultConfig() Config

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func New

func New(log *logging.Logger, cfg Config) *Handler

func (*Handler) OnGenesis

func (h *Handler) OnGenesis(ctx context.Context, t time.Time, state []byte) error

func (*Handler) OnGenesisAppStateLoaded

func (h *Handler) OnGenesisAppStateLoaded(f ...func(context.Context, []byte) error)

func (*Handler) OnGenesisTimeLoaded

func (h *Handler) OnGenesisTimeLoaded(f ...func(context.Context, time.Time))

func (*Handler) ReloadConf

func (h *Handler) ReloadConf(cfg Config)

ReloadConf update the internal configuration of the positions engine.

type State

type State struct {
	Assets             assets.GenesisState             `json:"assets"`
	Validators         validators.GenesisState         `json:"validators"`
	Network            abci.GenesisState               `json:"network"`
	NetParams          netparams.GenesisState          `json:"network_parameters"`
	NetParamsOverwrite netparams.GenesisStateOverwrite `json:"network_parameters_checkpoint_overwrite"`
	Limits             limits.GenesisState             `json:"network_limits"`
	Checkpoint         checkpoint.GenesisState         `json:"checkpoint"`
}

func DefaultState

func DefaultState() State

func FromJSON

func FromJSON(rawGenesisDoc []byte) (*tmtypes.GenesisDoc, *State, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL