client

package
v0.10.2-patch Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultGasAdjustment is applied to gas estimates to avoid tx
	// execution failures due to state changes that might
	// occur between the tx simulation and the actual run.
	DefaultGasAdjustment = 1.0
	DefaultGasLimit      = 200000
	GasFlagSimulate      = "simulate"

	FlagUseLedger      = "ledger"
	FlagChainID        = "chain-id"
	FlagNode           = "node"
	FlagHeight         = "height"
	FlagGas            = "gas"
	FlagTrustNode      = "trust-node"
	FlagFrom           = "from"
	FlagFromAddr       = "from-addr"
	FlagAccountNumber  = "account-number"
	FlagSequence       = "sequence"
	FlagMemo           = "memo"
	FlagFee            = "fee"
	FlagAsync          = "async"
	FlagCommit         = "commit"
	FlagJson           = "json"
	FlagPrintResponse  = "print-response"
	FlagGenerateOnly   = "generate-only"
	FlagName           = "name"
	FlagIndentResponse = "indent"
	FlagDryRun         = "dry-run"
	FlagGasAdjustment  = "gas-adjustment"
)

nolint

View Source
const MinPassLength = 8

MinPassLength is the minimum acceptable password length

Variables

View Source
var (
	LineBreak  = &cobra.Command{Run: func(*cobra.Command, []string) {}}
	GasFlagVar = GasSetting{Gas: DefaultGasLimit}
)

LineBreak can be included in a command list to provide a blank line to help with readability

Functions

func BufferStdin added in v0.7.0

func BufferStdin() *bufio.Reader

BufferStdin is used to allow reading prompts for stdin multiple times, when we read from non-tty

func ConfigCmd added in v0.7.0

func ConfigCmd() *cobra.Command

ConfigCmd returns a CLI command to interactively create a IRISCLI config file.

func GetCheckPassword added in v0.7.0

func GetCheckPassword(prompt, prompt2 string, buf *bufio.Reader) (string, error)

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 added in v0.6.0

func GetCommands(cmds ...*cobra.Command) []*cobra.Command

GetCommands adds common flags to query commands

func GetConfirmation added in v0.7.0

func GetConfirmation(prompt string, buf *bufio.Reader) (bool, error)

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 added in v0.8.0

func GetKeyBase(db dbm.DB) keys.Keybase

GetKeyBase initializes a keybase based on the given db. The KeyBase manages all activity requiring access to a key.

func GetPassword added in v0.7.0

func GetPassword(prompt string, buf *bufio.Reader) (pass string, err error)

GetPassword will prompt for a password one-time (to sign a tx) It enforces the password length

func GetSeed added in v0.7.0

func GetSeed(prompt string, buf *bufio.Reader) (string, error)

GetSeed will request a seed phrase from stdin and trims off leading/trailing spaces

func GetString added in v0.7.0

func GetString(prompt string, buf *bufio.Reader) (string, error)

GetString simply returns the trimmed string output of a given reader.

func MockKeyBase added in v0.8.0

func MockKeyBase() keys.Keybase

MockKeyBase generates an in-memory keybase that will be discarded useful for --dry-run to generate a seed phrase without storing the key

func PostCommands added in v0.6.0

func PostCommands(cmds ...*cobra.Command) []*cobra.Command

PostCommands adds common flags for commands to post tx

func PrintPrefixed added in v0.7.0

func PrintPrefixed(msg string)

PrintPrefixed prints a string with > prefixed for use in prompts.

func ReadGasFlag added in v0.7.0

func ReadGasFlag(s string) (simulate bool, gas uint64, err error)

ParseGasFlag parses the value of the --gas flag.

Types

type GasSetting added in v0.7.0

type GasSetting struct {
	Simulate bool
	Gas      uint64
}

GasSetting encapsulates the possible values passed through the --gas flag.

func (*GasSetting) Set added in v0.7.0

func (v *GasSetting) Set(s string) (err error)

Set parses and sets the value of the --gas flag.

func (*GasSetting) String added in v0.7.0

func (v *GasSetting) String() string

func (*GasSetting) Type added in v0.7.0

func (v *GasSetting) Type() string

Type returns the flag's value type.

type StdSignMsg added in v0.9.0

type StdSignMsg struct {
	ChainID       string      `json:"chain_id"`
	AccountNumber uint64      `json:"account_number"`
	Sequence      uint64      `json:"sequence"`
	Fee           auth.StdFee `json:"fee"`
	Msgs          []sdk.Msg   `json:"msgs"`
	Memo          string      `json:"memo"`
}

StdSignMsg is a convenience structure for passing along a Msg with the other requirements for a StdSignDoc before it is signed. For use in the CLI.

func (StdSignMsg) Bytes added in v0.9.0

func (msg StdSignMsg) Bytes() []byte

get message bytes

Directories

Path Synopsis
cli
lcd
cli
nolint
nolint
lcd
gov
cli
lcd
guardian
cli
cli
lcd
cli
lcd
slashing
cli
lcd
cli
lcd
tendermint
rpc
tx
cli
lcd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL