gserver

package
v0.0.0-...-eb84680 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Overview

Package gserver contains a Component type satisfying the Cosmos SDK server component interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

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

Component is a server component to be injected into the Cosmos SDK server module.

func NewComponent

func NewComponent(
	rootCtx context.Context,
	log *slog.Logger,
	txc transaction.Codec[transaction.Tx],
	codec codec.Codec,
) (*Component, error)

NewComponent returns a new server component ready to be supplied to the Cosmos SDK server module.

It accepts a *slog.Logger directly to avoid dealing with SDK loggers.

func (*Component) CLICommands

func (c *Component) CLICommands() serverv2.CLIConfig

func (*Component) Init

func (c *Component) Init(app serverv2.AppI[transaction.Tx], cfg map[string]any, log cosmoslog.Logger) error

Init is called early in the SDK server component lifecycle, before Start.

func (*Component) Name

func (c *Component) Name() string

func (*Component) Start

func (c *Component) Start(ctx context.Context) error

Start is called when the SDK is starting server components.

func (*Component) StartCmdFlags

func (c *Component) StartCmdFlags() *pflag.FlagSet

StartCmdFlags satisfies the optional serverv2.HasStartFlags interface, which adds the returned flagset to the flags for "$app start".

The configured values are then available in the config map passed to *Component.Init; the flag names are top level keys in the config map, with values corresponding to the command line flag values.

func (*Component) Stop

func (c *Component) Stop(_ context.Context) error

Stop is called when the SDK is shutting down the server components.

func (*Component) WriteCustomConfigAt

func (c *Component) WriteCustomConfigAt(configPath string) error

WriteCustomConfigAt satisfies an undocumented interface, and here we emulate what Comet does in order to get past some error expecting this file to exist.

Directories

Path Synopsis
internal
gp2papi
Package gp2papi manages the handlers for nodes that choose to serve public gcosmos (Gordian-Cosmos, not plain Cosmos) APIs over libp2p.
Package gp2papi manages the handlers for nodes that choose to serve public gcosmos (Gordian-Cosmos, not plain Cosmos) APIs over libp2p.
gsbd
Package gsbd (short for "Gordian Server Block Data") provides utilities for hosting and retrieving block data out of band from the consensus engine.
Package gsbd (short for "Gordian Server Block Data") provides utilities for hosting and retrieving block data out of band from the consensus engine.
gsi

Jump to

Keyboard shortcuts

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