Documentation ¶
Overview ¶
Package common implements common oasis-node command options and utilities.
Index ¶
- Constants
- Variables
- func DataDir() string
- func DataDirOrPwd() (string, error)
- func EarlyLogAndExit(err error)
- func ExportEntity(signerBackend, entityDir string) error
- func GetInputReader(cmd *cobra.Command, cfg string) (io.ReadCloser, bool, error)
- func GetOutputWriter(cmd *cobra.Command, cfg string) (io.WriteCloser, bool, error)
- func GetUserConfirmation(prompt string) bool
- func Init() error
- func InitConfig()
- func IsNodeCmd() bool
- func Isatty(fd uintptr) bool
- func LoadEntity(signerBackend, entityDir string) (*entity.Entity, signature.Signer, error)
- func Logger() *logging.Logger
- func SetIsNodeCmd(v bool)
Constants ¶
const ( // CfgDebugAllowTestKeys is the command line flag to enable the debug test // keys. CfgDebugAllowTestKeys = "debug.allow_test_keys" // CfgDebugRlimit is the command flag to set RLIMIT_NOFILE on launch. CfgDebugRlimit = "debug.rlimit" CfgDataDir = "datadir" )
Variables ¶
var ( // RootFlags has the flags that are common across all commands. RootFlags = flag.NewFlagSet("", flag.ContinueOnError) )
Functions ¶
func DataDirOrPwd ¶
DataDirOrPwd returns the data directory iff one is set, pwd otherwise.
func EarlyLogAndExit ¶
func EarlyLogAndExit(err error)
EarlyLogAndExit logs the error and exits.
Note: This routine should only be used prior to the logging system being initialized.
func ExportEntity ¶
ExportEntity creates an empty entity from the public key of the signer generated with the specified backend, and writes it to a file in entityDir.
func GetInputReader ¶
GetInputReader will open a file if the config string is set, and otherwise return os.Stdin.
func GetOutputWriter ¶
GetOutputWriter will create a file if the config string is set, and otherwise return os.Stdout.
func GetUserConfirmation ¶
GetUserConfirmation displays the prompt, and scans the input for the user's confirmation, until the user either explicitly confirms or rejects the prompt.
Note: If standard input is not a tty, this will omit displaying the prompt, and assume the user entered yes.
func InitConfig ¶
func InitConfig()
InitConfig initializes the command configuration.
WARNING: This is exposed for the benefit of tests and the interface is not guaranteed to be stable.
func IsNodeCmd ¶
func IsNodeCmd() bool
IsNodeCmd returns true iff the current command is the ekiden node.
func LoadEntity ¶
LoadEntity loads the entity and it's signer.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package background implements utilities for managing background services.
|
Package background implements utilities for managing background services. |
Package consensus contains common consensus-related flags.
|
Package consensus contains common consensus-related flags. |
Package flags implements common flags used across multiple commands and backends.
|
Package flags implements common flags used across multiple commands and backends. |
Package genesis implements common genesis document manipulation routines.
|
Package genesis implements common genesis document manipulation routines. |
Package grpc implements common gRPC command-line flags.
|
Package grpc implements common gRPC command-line flags. |
Package metrics implements a prometheus metrics service.
|
Package metrics implements a prometheus metrics service. |
Package pprof implements a pprof profiling service.
|
Package pprof implements a pprof profiling service. |
Package signer implements helpers for configuring the signer.
|
Package signer implements helpers for configuring the signer. |
Package tracing implements a tracing service.
|
Package tracing implements a tracing service. |