app

package
v1.0.1-rc11 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 68 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FmtCannotStart = "cannot start %q"
)

Variables

View Source
var (
	ErrStartTimeout    = errors.New("start timeout")
	ErrShutdownTimeout = errors.New("shutdown timeout")
)

Functions

func MakeEncodingConfig

func MakeEncodingConfig() (codec.Codec, *codec.AminoCodec)

MakeEncodingConfig creates an EncodingConfig to properly handle and marshal all messages

func MakeSDKConfig added in v1.0.0

func MakeSDKConfig(cfg Config, sdkConfig *sdk.Config)

MakeSDKConfig represents a handy implementation of SdkConfigSetup that simply setups the prefix inside the configuration

Types

type App

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

func New

func New(cfg Config, version string, l zerolog.Logger) *App

func (*App) GetStartTimeout

func (a *App) GetStartTimeout() time.Duration

func (*App) GetStopTimeout

func (a *App) GetStopTimeout() time.Duration

func (*App) Start

func (a *App) Start(ctx context.Context) error

func (*App) Stop

func (a *App) Stop(ctx context.Context) error

type Config

type Config struct {
	ChainPrefix    string `env:"CHAIN_PREFIX"`
	DefaultDenom   string `env:"DEFAULT_DENOM" envDefault:"uatom"`
	LogLevel       string `env:"LOG_LEVEL" envDefault:"info"`
	Server         server.Config
	Modules        []string `env:"MODULES" required:"true"`
	GRPCConfig     grpc.Config
	RPCConfig      rpc.Config
	BrokerConfig   broker.Config
	StorageConfig  storage.Config
	WorkerConfig   worker.Config
	StartTimeout   time.Duration `env:"START_TIMEOUT"`
	StopTimeout    time.Duration `env:"STOP_TIMEOUT"`
	MetricsEnabled bool          `env:"METRICS_ENABLED" envDefault:"false"`
}

Jump to

Keyboard shortcuts

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