Documentation ¶
Index ¶
- Constants
- Variables
- func BufferStdin() *bufio.Reader
- func GetCheckPassword(prompt, prompt2 string, buf *bufio.Reader) (string, error)
- func GetCommands(cmds ...*cobra.Command) []*cobra.Command
- func GetConfirmation(prompt string, buf *bufio.Reader) (bool, error)
- func GetKeyBase(db dbm.DB) keys.Keybase
- func GetPassword(prompt string, buf *bufio.Reader) (pass string, err error)
- func GetSeed(prompt string, buf *bufio.Reader) (seed string, err error)
- func MockKeyBase() keys.Keybase
- func PostCommands(cmds ...*cobra.Command) []*cobra.Command
Constants ¶
const ( FlagChainID = "chain-id" FlagNode = "node" FlagHeight = "height" FlagGas = "gas" FlagTrustNode = "trust-node" FlagName = "name" FlagSequence = "sequence" FlagFee = "fee" )
nolint
const MinPassLength = 8
MinPassLength is the minimum acceptable password length
Variables ¶
LineBreak can be included in a command list to provide a blank line to help with readability
Functions ¶
func BufferStdin ¶
BufferStdin is used to allow reading prompts for stdin multiple times, when we read from non-tty
func GetCheckPassword ¶
GetCheckPassword will prompt for a password twice to verify they match (for creating a new password). It enforces the password length. Only parses password once if input is piped in.
func GetCommands ¶
GetCommands adds common flags to query commands
func GetConfirmation ¶
GetConfirmation will request user give the confirmation from stdin. "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again.
func GetKeyBase ¶
GetKeyBase initializes a keybase based on the given db. The KeyBase manages all activity requiring access to a key.
func GetPassword ¶
GetPassword will prompt for a password one-time (to sign a tx) It enforces the password length
func MockKeyBase ¶
MockKeyBase generates an in-memory keybase that will be discarded useful for --dry-run to generate a seed phrase without storing the key
Types ¶
This section is empty.