Documentation ¶
Index ¶
- Constants
- func AddCommands(ctx *Context, cdc *go_amino.Codec, rootCmd *cobra.Command, ...)
- func ExternalIP() (string, error)
- func InitCmd(ctx *Context, cdc *go_amino.Codec, genGenesisDocFun CustomGenGenesisDocFunc, ...) *cobra.Command
- func InitializeNodeValidatorFiles(config *cfg.Config) (nodeID string, valPubKey crypto.PubKey, err error)
- func InsertKeyJSON(cdc *go_amino.Codec, baseJSON []byte, key string, value json.RawMessage) ([]byte, error)
- func MarshalJSONIndent(cdc *Codec, obj interface{}) ([]byte, error)
- func PersistentPreRunEFn(context *Context) func(*cobra.Command, []string) error
- func ReadOrCreatePrivValidator(privValFile string) crypto.PubKey
- func RegisterCrypto(cdc *Codec)
- func SaveGenDoc(genFile string, genDoc types.GenesisDoc) error
- func ShowAddressCmd(ctx *Context) *cobra.Command
- func ShowNodeIDCmd(ctx *Context) *cobra.Command
- func ShowValidatorCmd(ctx *Context) *cobra.Command
- func StartCmd(ctx *Context, appCreator AppCreator) *cobra.Command
- func TrapSignal(cleanupFunc func())
- func UnsafeResetAllCmd(ctx *Context) *cobra.Command
- type AppCreator
- type AppExporter
- type Codec
- type Context
- type CustomGenGenesisDocFunc
Constants ¶
const (
FlagJson = "json"
)
Variables ¶
This section is empty.
Functions ¶
func AddCommands ¶
add server commands
func ExternalIP ¶ added in v0.0.10
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 InitCmd ¶
func InitCmd(ctx *Context, cdc *go_amino.Codec, genGenesisDocFun CustomGenGenesisDocFunc, defaultNodeHome string) *cobra.Command
get cmd to initialize all files for tendermint and application nolint
func InitializeNodeValidatorFiles ¶ added in v0.0.10
func InitializeNodeValidatorFiles( config *cfg.Config) (nodeID string, valPubKey crypto.PubKey, err error, )
InitializeNodeValidatorFiles creates private validator and p2p configuration files.
func InsertKeyJSON ¶
func InsertKeyJSON(cdc *go_amino.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 MarshalJSONIndent ¶
func PersistentPreRunEFn ¶
PersistentPreRunEFn returns a PersistentPreRunE function for cobra that initailizes the passed in context with a properly configured logger and config objecy
func ReadOrCreatePrivValidator ¶ added in v0.0.10
read of create the private key file for this config
func RegisterCrypto ¶
func RegisterCrypto(cdc *Codec)
func SaveGenDoc ¶ added in v0.0.10
func SaveGenDoc(genFile string, genDoc types.GenesisDoc) error
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(ctx *Context, appCreator AppCreator) *cobra.Command
StartCmd runs the service passed in, either stand-alone or in-process with Tendermint.
func TrapSignal ¶ added in v0.0.10
func TrapSignal(cleanupFunc func())
TrapSignal traps SIGINT and SIGTERM and terminates the server correctly.
func UnsafeResetAllCmd ¶
UnsafeResetAllCmd - extension of the tendermint command, resets initialization
Types ¶
type AppCreator ¶
AppCreator is a function that allows us to lazily initialize an application using various configurations.
type AppExporter ¶ added in v0.0.10
type AppExporter func(log.Logger, dbm.DB, io.Writer, int64, bool) (json.RawMessage, []tmtypes.GenesisValidator, error)
AppExporter is a function that dumps all app state to JSON-serializable structure and returns the current validator set.