server

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0, Apache-2.0 Imports: 66 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagEvmExportMode = "evm-export-mode"
	FlagEvmExportPath = "evm-export-path"
)
View Source
const (
	FlagMinGasPrices       = "minimum-gas-prices"
	FlagHaltHeight         = "halt-height"
	FlagHaltTime           = "halt-time"
	FlagInterBlockCache    = "inter-block-cache"
	FlagUnsafeSkipUpgrades = "unsafe-skip-upgrades"
	FlagTrace              = "trace"

	FlagPruning           = "pruning"
	FlagPruningKeepRecent = "pruning-keep-recent"
	FlagPruningKeepEvery  = "pruning-keep-every"
	FlagPruningInterval   = "pruning-interval"
	FlagLocalRpcPort      = "local-rpc-port"
	FlagPortMonitor       = "netstat"
	FlagEvmImportPath     = "evm-import-path"
	FlagEvmImportMode     = "evm-import-mode"
	FlagGoroutineNum      = "goroutine-num"

	FlagPruningMaxWsNum = "pruning-max-worldstate-num"
	FlagExportKeystore  = "export-keystore"
	FlagLogServerUrl    = "log-server"

	FlagActiveViewChange = "active-view-change"
	FlagCommitGapHeight  = "commit-gap-height"

	FlagBlockPartSizeBytes = "block-part-size"

	FlagFastSyncGap = "fastsync-gap"

	FlagEventBlockTime    = "event-block-time"
	FlagStartFromSnapshot = "start-from-snapshot"
)

Tendermint full-node start flags

View Source
const (
	FlagListenAddr         = "rest.laddr"
	FlagUlockKey           = "rest.unlock_key"
	FlagUlockKeyHome       = "rest.unlock_key_home"
	FlagRestPathPrefix     = "rest.path_prefix"
	FlagCORS               = "cors"
	FlagMaxOpenConnections = "max-open"
	FlagHookstartInProcess = "startInProcess"
	FlagWsMaxConnections   = "ws.max_connections"
	FlagWsSubChannelLength = "ws.sub_channel_length"
)

exchain full-node start flags

View Source
const FlagGops = "gops"

Variables

View Source
var (
	ChainID = "exchain-66"
)

Functions

func AddCommands

func AddCommands(
	ctx *Context, cdc *codec.CodecProxy,
	registry jsonpb.AnyResolver,
	rootCmd *cobra.Command,
	appCreator AppCreator, appStop AppStop, appExport AppExporter,
	registerRouters func(rs *lcd.RestServer),
	registerAppFlagFn func(cmd *cobra.Command),
	appPreRun func(ctx *Context, cmd *cobra.Command) error,
	subFunc func(logger log.Logger) log.Subscriber)

add server commands

func ExportCmd

func ExportCmd(ctx *Context, cdc *codec.Codec, appExporter AppExporter) *cobra.Command

ExportCmd dumps app state to JSON.

func ExternalIP

func ExternalIP() (string, error)

https://stackoverflow.com/questions/23558425/how-do-i-get-the-local-ip-address-in-go TODO there must be a better way to get external IP

func FreeTCPAddr

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

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

func GenerateCoinKey

func GenerateCoinKey() (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 keys.Keybase, keyName, keyPass string, overwrite bool, mnemonicInput string) (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() (types.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 InsertKeyJSON

func InsertKeyJSON(cdc *codec.Codec, baseJSON []byte, key string, value json.RawMessage) ([]byte, error)

InsertKeyJSON inserts a new JSON field/key with a given value to an existing JSON message. An error is returned if any serialization operation fails.

NOTE: The ordering of the keys returned as the resulting JSON message is non-deterministic, so the client should not rely on key ordering.

func InstallHookEx

func InstallHookEx(flag string, hooker fnHookstartInProcess)

func PersistentPreRunEFn

func PersistentPreRunEFn(context *Context) func(*cobra.Command, []string) error

PersistentPreRunEFn returns a PersistentPreRunE function for cobra that initailizes the passed in context with a properly configured logger and config object.

func RegisterServerFlags added in v1.1.10

func RegisterServerFlags(cmd *cobra.Command) *cobra.Command

RegisterServerFlags registers the flags required for rest server

func SetExternalPackageValue added in v1.1.10

func SetExternalPackageValue(cmd *cobra.Command)

Use SetExternalPackageValue to set external package config value.

func SetupViper

func SetupViper(t *testing.T) func()

SetupViper creates a homedir to run inside, and returns a cleanup function to defer

func ShowAddressCmd

func ShowAddressCmd(ctx *Context) *cobra.Command

ShowAddressCmd - show this node's validator address

func ShowNodeIDCmd

func ShowNodeIDCmd(ctx *Context) *cobra.Command

ShowNodeIDCmd - ported from Tendermint, dump node ID to stdout

func ShowValidatorCmd

func ShowValidatorCmd(ctx *Context) *cobra.Command

ShowValidator - ported from Tendermint, show this node's validator info

func StartCmd

func StartCmd(ctx *Context,
	cdc *codec.CodecProxy,
	registry jsonpb.AnyResolver,
	appCreator AppCreator,
	appStop AppStop,
	registerRoutesFn func(restServer *lcd.RestServer),
	registerAppFlagFn func(cmd *cobra.Command),
	appPreRun func(ctx *Context, cmd *cobra.Command) error,
	subFunc func(logger log.Logger) log.Subscriber,
) *cobra.Command

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

func StartRestWithNode added in v1.6.2

func StartRestWithNode(ctx *Context, cdc *codec.CodecProxy, blockStoreDir string,
	registry jsonpb.AnyResolver, appCreator AppCreator,
	registerRoutesFn func(restServer *lcd.RestServer)) (*node.Node, error)

func Stop

func Stop()

func StopCmd

func StopCmd(ctx *Context) *cobra.Command

StopCmd stop the node gracefully Tendermint.

func TrapSignal

func TrapSignal(cleanupFunc func())

TrapSignal traps SIGINT and SIGTERM and terminates the server correctly.

func UnsafeResetAllCmd

func UnsafeResetAllCmd(ctx *Context) *cobra.Command

UnsafeResetAllCmd - extension of the tendermint command, resets initialization

func VersionCmd

func VersionCmd(ctx *Context) *cobra.Command

VersionCmd prints tendermint and ABCI version numbers.

Types

type AppCreator

type AppCreator func(log.Logger, dbm.DB, io.Writer) abci.Application

AppCreator is a function that allows us to lazily initialize an application using various configurations.

type AppExporter

AppExporter is a function that dumps all app state to JSON-serializable structure and returns the current validator set.

type AppStop

type AppStop func(app abci.Application)

type Context

type Context struct {
	Config *cfg.Config
	Logger log.Logger
}

server context

func NewContext

func NewContext(config *cfg.Config, logger log.Logger) *Context

func NewDefaultContext

func NewDefaultContext() *Context

Directories

Path Synopsis
gogoreflection
Package gogoreflection implements gRPC reflection for gogoproto consumers the normal reflection library does not work as it points to a different singleton registry.
Package gogoreflection implements gRPC reflection for gogoproto consumers the normal reflection library does not work as it points to a different singleton registry.
reflection/v2alpha1
Package v2alpha1 is a reverse proxy.
Package v2alpha1 is a reverse proxy.
nolint
nolint

Jump to

Keyboard shortcuts

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