Documentation
¶
Index ¶
- Constants
- func GetKeyBase(ctx context.CLIContext) (keys.Keybase, error)
- func GetKeyBaseFromDir(ctx context.CLIContext, rootDir string) (keys.Keybase, error)
- func GetKeyInfo(ctx context.CLIContext, name string) (keys.Info, error)
- func GetPassphrase(ctx context.CLIContext, name string) (string, error)
- func KeysCommand(cdc *go_amino.Codec) *cobra.Command
- func ReadPassphraseFromStdin(name string) (string, error)
- type KeyOutput
Constants ¶
const KeyDBName = "keys"
KeyDBName is the directory under root where we store the keys
Variables ¶
This section is empty.
Functions ¶
func GetKeyBase ¶
func GetKeyBase(ctx context.CLIContext) (keys.Keybase, error)
GetKeyBase initializes a read-only KeyBase based on the configuration.
func GetKeyBaseFromDir ¶
GetKeyBaseFromDir initializes a read-only keybase at a particular dir.
func GetKeyInfo ¶
GetKeyInfo returns key info for a given name. An error is returned if the keybase cannot be retrieved or getting the info fails.
func GetPassphrase ¶
func GetPassphrase(ctx context.CLIContext, name string) (string, error)
GetPassphrase returns a passphrase for a given name. It will first retrieve the key info for that name if the type is local, it'll fetch input from STDIN. Otherwise, an empty passphrase is returned. An error is returned if the key info cannot be fetched or reading from STDIN fails.
func ReadPassphraseFromStdin ¶
ReadPassphraseFromStdin attempts to read a passphrase from STDIN return an error upon failure.
Types ¶
type KeyOutput ¶
type KeyOutput struct { Name string `json:"name"` Type string `json:"type"` Address string `json:"address"` PubKey string `json:"pub_key"` Seed string `json:"seed,omitempty"` }
used for outputting keys.Info over REST
func Bech32KeyOutput ¶
create a KeyOutput in bech32 format
func Bech32KeysOutput ¶
create a list of KeyOutput in bech32 format