server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagHeight           = "height"
	FlagForZeroHeight    = "for-zero-height"
	FlagJailAllowedAddrs = "jail-allowed-addrs"
)
View Source
const (
	FlagMinGasPrices       = "minimum-gas-prices"
	FlagHaltHeight         = "halt-height"
	FlagHaltTime           = "halt-time"
	FlagInterBlockCache    = "inter-block-cache"
	FlagUnsafeSkipUpgrades = "unsafe-skip-upgrades"
	FlagTrace              = "trace"
	FlagInvCheckPeriod     = "inv-check-period"

	FlagPruning           = "pruning"
	FlagPruningKeepRecent = "pruning-keep-recent"
	FlagPruningKeepEvery  = "pruning-keep-every"
	FlagPruningInterval   = "pruning-interval"
	FlagIndexEvents       = "index-events"
	FlagMinRetainBlocks   = "min-retain-blocks"
)

Augusteum full-node start flags

View Source
const (
	FlagStateSyncSnapshotInterval   = "state-sync.snapshot-interval"
	FlagStateSyncSnapshotKeepRecent = "state-sync.snapshot-keep-recent"
)

State sync-related flags.

View Source
const ServerContextKey = sdk.ContextKey("server.context")

ServerContextKey defines the context key used to retrieve a server.Context from a command's Context.

Variables

This section is empty.

Functions

func AddCommands

func AddCommands(rootCmd *cobra.Command, defaultNodeHome string, appCreator types.AppCreator, appExport types.AppExporter, addStartFlags types.ModuleInitFlags)

add server commands

func ExportCmd

func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Command

ExportCmd dumps app state to JSON.

func ExternalIP

func ExternalIP() (string, error)

func FreeTCPAddr

func FreeTCPAddr() (addr, port string, err error)

Get a free address for a test augusteum server protocol is either tcp, http, etc

func GenerateCoinKey

func GenerateCoinKey(algo keyring.SignatureAlgo) (sdk.AccAddress, string, error)

GenerateCoinKey returns the address of a public key, along with the secret phrase to recover the private key.

func GenerateSaveCoinKey

func GenerateSaveCoinKey(keybase keyring.Keyring, keyName string, overwrite bool, algo keyring.SignatureAlgo) (sdk.AccAddress, string, error)

GenerateSaveCoinKey returns the address of a public key, along with the secret phrase to recover the private key.

func GetPruningOptionsFromFlags

func GetPruningOptionsFromFlags(appOpts types.AppOptions) (storetypes.PruningOptions, error)

GetPruningOptionsFromFlags parses command flags and returns the correct PruningOptions. If a pruning strategy is provided, that will be parsed and returned, otherwise, it is assumed custom pruning options are provided.

func InterceptConfigsPreRunHandler

func InterceptConfigsPreRunHandler(cmd *cobra.Command) error

InterceptConfigsPreRunHandler performs a pre-run function for the root daemon application command. It will create a Viper literal and a default server Context. The server Augusteum configuration will either be read and parsed or created and saved to disk, where the server Context is updated to reflect the Augusteum configuration. The Viper literal is used to read and parse the application configuration. Command handlers can fetch the server Context to get the Augusteum configuration or to get access to Viper.

func SetCmdServerContext

func SetCmdServerContext(cmd *cobra.Command, serverCtx *Context) error

SetCmdServerContext sets a command's Context value to the provided argument.

func ShowAddressCmd

func ShowAddressCmd() *cobra.Command

ShowAddressCmd - show this node's validator address

func ShowNodeIDCmd

func ShowNodeIDCmd() *cobra.Command

ShowNodeIDCmd - ported from Augusteum, dump node ID to stdout

func ShowValidatorCmd

func ShowValidatorCmd() *cobra.Command

ShowValidatorCmd - ported from Augusteum, show this node's validator info

func StartCmd

func StartCmd(appCreator types.AppCreator, defaultNodeHome string) *cobra.Command

StartCmd runs the service passed in, either stand-alone or in-process with Augusteum.

func TrapSignal

func TrapSignal(cleanupFunc func())

TrapSignal traps SIGINT and SIGTERM and terminates the server correctly.

func UnsafeResetAllCmd

func UnsafeResetAllCmd() *cobra.Command

UnsafeResetAllCmd - extension of the augusteum command, resets initialization

func VersionCmd

func VersionCmd() *cobra.Command

VersionCmd prints augusteum and MSM version numbers.

Types

type Context

type Context struct {
	Viper  *viper.Viper
	Config *tmcfg.Config
	Logger tmlog.Logger
}

server context

func GetServerContextFromCmd

func GetServerContextFromCmd(cmd *cobra.Command) *Context

GetServerContextFromCmd returns a Context from a command or an empty Context if it has not been set.

func NewContext

func NewContext(v *viper.Viper, config *tmcfg.Config, logger tmlog.Logger) *Context

func NewDefaultContext

func NewDefaultContext() *Context

type ErrorCode

type ErrorCode struct {
	Code int
}

ErrorCode contains the exit code for server exit.

func WaitForQuitSignals

func WaitForQuitSignals() ErrorCode

WaitForQuitSignals waits for SIGINT and SIGTERM and returns.

func (ErrorCode) Error

func (e ErrorCode) Error() string

type ZeroLogWrapper

type ZeroLogWrapper struct {
	zerolog.Logger
}

ZeroLogWrapper provides a wrapper around a zerolog.Logger instance. It implements Augusteum's Logger interface.

func (ZeroLogWrapper) Debug

func (z ZeroLogWrapper) Debug(msg string, keyVals ...interface{})

Debug implements Augusteum's Logger interface and logs with level DEBUG. A set of key/value tuples may be provided to add context to the log. The number of tuples must be even and the key of the tuple must be a string.

func (ZeroLogWrapper) Error

func (z ZeroLogWrapper) Error(msg string, keyVals ...interface{})

Error implements Augusteum's Logger interface and logs with level ERR. A set of key/value tuples may be provided to add context to the log. The number of tuples must be even and the key of the tuple must be a string.

func (ZeroLogWrapper) Info

func (z ZeroLogWrapper) Info(msg string, keyVals ...interface{})

Info implements Augusteum's Logger interface and logs with level INFO. A set of key/value tuples may be provided to add context to the log. The number of tuples must be even and the key of the tuple must be a string.

func (ZeroLogWrapper) With

func (z ZeroLogWrapper) With(keyVals ...interface{}) tmlog.Logger

With returns a new wrapped logger with additional context provided by a set of key/value tuples. The number of tuples must be even and the key of the tuple must be a string.

Directories

Path Synopsis
nolint
nolint

Jump to

Keyboard shortcuts

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