cosmos-sdk: Index | Files | Directories

package server

import ""


Package Files

export.go init.go pruning.go start.go test_helpers.go tm_cmds.go util.go


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"

Tendermint full-node start flags

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

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

func AddCommands Uses

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

add server commands

func ExportCmd Uses

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

ExportCmd dumps app state to JSON.

func ExternalIP Uses

func ExternalIP() (string, error) TODO there must be a better way to get external IP

func FreeTCPAddr Uses

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

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

func GenerateCoinKey Uses

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 Uses

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 Uses

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 InsertKeyJSON Uses

func InsertKeyJSON(cdc codec.JSONMarshaler, 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 InterceptConfigsPreRunHandler Uses

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 Tendermint configuration will either be read and parsed or created and saved to disk, where the server Context is updated to reflect the Tendermint configuration. The Viper literal is used to read and parse the application configuration. Command handlers can fetch the server Context to get the Tendermint configuration or to get access to Viper.

func SetCmdServerContext Uses

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

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

func ShowAddressCmd Uses

func ShowAddressCmd() *cobra.Command

ShowAddressCmd - show this node's validator address

func ShowNodeIDCmd Uses

func ShowNodeIDCmd() *cobra.Command

ShowNodeIDCmd - ported from Tendermint, dump node ID to stdout

func ShowValidatorCmd Uses

func ShowValidatorCmd() *cobra.Command

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

func StartCmd Uses

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

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

func TrapSignal Uses

func TrapSignal(cleanupFunc func())

TrapSignal traps SIGINT and SIGTERM and terminates the server correctly.

func UnsafeResetAllCmd Uses

func UnsafeResetAllCmd() *cobra.Command

UnsafeResetAllCmd - extension of the tendermint command, resets initialization

func VersionCmd Uses

func VersionCmd() *cobra.Command

VersionCmd prints tendermint and ABCI version numbers.

type Context Uses

type Context struct {
    Viper  *viper.Viper
    Config *tmcfg.Config
    Logger log.Logger

server context

func GetServerContextFromCmd Uses

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 Uses

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

func NewDefaultContext Uses

func NewDefaultContext() *Context



Package server imports 46 packages (graph) and is imported by 29 packages. Updated 2020-08-13. Refresh now. Tools for package owners.