Documentation ¶
Index ¶
- Constants
- func AddCommands(rootCmd *cobra.Command, appCreator AppCreator, appExport AppExporter)
- func ExportCmd(appExporter AppExporter, defaultNodeHome string) *cobra.Command
- func ExternalIP() (string, error)
- func FreeTCPAddr() (addr, port string, err error)
- func GenerateCoinKey() (sdk.AccAddress, string, error)
- func GenerateSaveCoinKey(keybase keyring.Keyring, keyName, keyPass string, overwrite bool) (sdk.AccAddress, string, error)
- func GetPruningOptionsFromFlags(appOpts AppOptions) (types.PruningOptions, error)
- func InsertKeyJSON(cdc codec.JSONMarshaler, baseJSON []byte, key string, value json.RawMessage) ([]byte, error)
- func InterceptConfigsPreRunHandler(cmd *cobra.Command) error
- func SetCmdServerContext(cmd *cobra.Command, serverCtx *Context) error
- func ShowAddressCmd() *cobra.Command
- func ShowNodeIDCmd() *cobra.Command
- func ShowValidatorCmd() *cobra.Command
- func StartCmd(appCreator AppCreator, defaultNodeHome string) *cobra.Command
- func TrapSignal(cleanupFunc func())
- func UnsafeResetAllCmd() *cobra.Command
- func VersionCmd() *cobra.Command
- type AppCreator
- type AppExporter
- type AppOptions
- type Application
- type Context
Constants ¶
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.
Variables ¶
This section is empty.
Functions ¶
func AddCommands ¶
func AddCommands(rootCmd *cobra.Command, appCreator AppCreator, appExport AppExporter)
add server commands
func ExportCmd ¶
func ExportCmd(appExporter AppExporter, defaultNodeHome string) *cobra.Command
ExportCmd dumps app state to JSON.
func ExternalIP ¶
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 ¶
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 keyring.Keyring, keyName, keyPass string, overwrite bool) (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 AppOptions) (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.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 ¶
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 ¶
SetCmdServerContext sets a command's Context value to the provided argument.
func ShowAddressCmd ¶
ShowAddressCmd - show this node's validator address
func ShowNodeIDCmd ¶
ShowNodeIDCmd - ported from Tendermint, dump node ID to stdout
func ShowValidatorCmd ¶
ShowValidator - ported from Tendermint, show this node's validator info
func StartCmd ¶
func StartCmd(appCreator AppCreator, defaultNodeHome string) *cobra.Command
StartCmd runs the service passed in, either stand-alone or in-process with Tendermint.
func TrapSignal ¶
func TrapSignal(cleanupFunc func())
TrapSignal traps SIGINT and SIGTERM and terminates the server correctly.
func UnsafeResetAllCmd ¶
UnsafeResetAllCmd - extension of the tendermint command, resets initialization
func VersionCmd ¶
VersionCmd prints tendermint and ABCI version numbers.
Types ¶
type AppCreator ¶
type AppCreator func(log.Logger, dbm.DB, io.Writer, AppOptions) Application
AppCreator is a function that allows us to lazily initialize an application using various configurations.
type AppExporter ¶
type AppExporter func(log.Logger, dbm.DB, io.Writer, int64, bool, []string) (json.RawMessage, []tmtypes.GenesisValidator, *abci.ConsensusParams, error)
AppExporter is a function that dumps all app state to JSON-serializable structure and returns the current validator set.
type AppOptions ¶
type AppOptions interface {
Get(string) interface{}
}
AppOptions defines an interface that is passed into an application constructor, typically used to set BaseApp options that are either supplied via config file or through CLI arguments/flags. The underlying implementation is defined by the server package and is typically implemented via a Viper literal defined on the server Context. Note, casting Get calls may not yield the expected types and could result in type assertion errors. It is recommend to either use the cast package or perform manual conversion for safety.
type Application ¶
type Application interface { abci.Application RegisterAPIRoutes(*api.Server) }
Application defines an application interface that wraps abci.Application. The interface defines the necessary contracts to be implemented in order to fully bootstrap and start an application.
type Context ¶
server context
func GetServerContextFromCmd ¶
GetServerContextFromCmd returns a Context from a command or an empty Context if it has not been set.
func NewDefaultContext ¶
func NewDefaultContext() *Context