gserver

package
v0.0.0-...-40b18d3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 59 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 Client

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

func NewClient

func NewClient(
	cmd *cobra.Command,
	grpcAddress string,
	grpcInsecure bool,
) (*Client, error)

func (*Client) ABCIInfo

func (c *Client) ABCIInfo(ctx context.Context) (*coretypes.ResultABCIInfo, error)

func (*Client) ABCIQuery

func (c *Client) ABCIQuery(ctx context.Context, path string, data cmtbytes.HexBytes) (*coretypes.ResultABCIQuery, error)

func (*Client) ABCIQueryWithOptions

func (c *Client) ABCIQueryWithOptions(ctx context.Context, path string, data cmtbytes.HexBytes, opts cmtclient.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)

func (*Client) Block

func (c *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error)

func (*Client) BlockByHash

func (c *Client) BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error)

func (*Client) BlockResults

func (c *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error)

func (*Client) BlockSearch

func (c *Client) BlockSearch(
	ctx context.Context,
	query string,
	page, perPage *int,
	orderBy string,
) (*coretypes.ResultBlockSearch, error)

func (*Client) BlockchainInfo

func (c *Client) BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error)

func (*Client) BroadcastTxAsync

func (c *Client) BroadcastTxAsync(ctx context.Context, tx cmttypes.Tx) (*coretypes.ResultBroadcastTx, error)

func (*Client) BroadcastTxCommit

func (c *Client) BroadcastTxCommit(ctx context.Context, tx cmttypes.Tx) (*coretypes.ResultBroadcastTxCommit, error)

func (*Client) BroadcastTxSync

func (c *Client) BroadcastTxSync(ctx context.Context, tx cmttypes.Tx) (*coretypes.ResultBroadcastTx, error)

func (*Client) Commit

func (c *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error)

func (*Client) Status

func (c *Client) Status(ctx context.Context) (*coretypes.ResultStatus, error)

func (*Client) Tx

func (c *Client) Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error)

func (*Client) TxSearch

func (c *Client) TxSearch(
	ctx context.Context,
	query string,
	prove bool,
	page, perPage *int,
	orderBy string,
) (*coretypes.ResultTxSearch, error)

func (*Client) Validators

func (c *Client) Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error)

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,
	homeDir string,
	txc transaction.Codec[transaction.Tx],
	codec codec.Codec,
	cfg Config,
) (*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) 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.

type Config

type Config struct {
	RootStore  store.RootStore
	AppManager appmanager.AppManager[transaction.Tx]

	ConfigMap coreserver.ConfigMap
}

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