flags

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 1

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
	GasFlagAuto          = "auto"

	// DefaultKeyringBackend
	DefaultKeyringBackend = keys.BackendTest
)

nolint

View Source
const (
	// BroadcastBlock defines a tx broadcasting mode where the client waits for
	// the tx to be committed in a block.
	BroadcastBlock = "block"
	// BroadcastSync defines a tx broadcasting mode where the client waits for
	// a CheckTx execution response only.
	BroadcastSync = "sync"
	// BroadcastAsync defines a tx broadcasting mode where the client returns
	// immediately.
	BroadcastAsync = "async"
)
View Source
const (
	FlagHome               = tmcli.HomeFlag
	FlagUseLedger          = "ledger"
	FlagChainID            = "chain-id"
	FlagNode               = "node"
	FlagHeight             = "height"
	FlagGasAdjustment      = "gas-adjustment"
	FlagTrustNode          = "trust-node"
	FlagFrom               = "from"
	FlagName               = "name"
	FlagAccountNumber      = "account-number"
	FlagSequence           = "sequence"
	FlagMemo               = "memo"
	FlagFees               = "fees"
	FlagGasPrices          = "gas-prices"
	FlagBroadcastMode      = "broadcast-mode"
	FlagDryRun             = "dry-run"
	FlagGenerateOnly       = "generate-only"
	FlagIndentResponse     = "indent"
	FlagListenAddr         = "laddr"
	FlagMaxOpenConnections = "max-open"
	FlagRPCReadTimeout     = "read-timeout"
	FlagRPCWriteTimeout    = "write-timeout"
	FlagMaxBodyBytes       = "max-body-bytes"
	FlagOutputDocument     = "output-document" // inspired by wget -O
	FlagSkipConfirmation   = "yes"
	FlagProve              = "prove"
	FlagKeyringBackend     = "keyring-backend"
	FlagPage               = "page"
	FlagLimit              = "limit"
	FlagUnsafeCORS         = "unsafe-cors"
	FlagNodeIndex          = "node-index"

	TrustNodeUsage = `` /* 237-byte string literal not displayed */

)

List of CLI flags

View Source
const (
	FlagPageKey       = "page-key"
	FlagOffset        = "offset"
	FlagTimeoutHeight = "timeout-height"
	FlagCountTotal    = "count-total"

	DefaultMaxBodyBytes = 1000 * 1000
)

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 AddPaginationFlagsToCmd

func AddPaginationFlagsToCmd(cmd *cobra.Command, query string)

AddPaginationFlagsToCmd adds common pagination flags to cmd

func AddQueryFlagsToCmd

func AddQueryFlagsToCmd(cmd *cobra.Command)

AddQueryFlagsToCmd adds common flags to a module query command.

func AddTxFlagsToCmd

func AddTxFlagsToCmd(cmd *cobra.Command)

AddTxFlagsToCmd adds common flags to a module tx command.

func GetCommands

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

GetCommands adds common flags to query commands

func NewCompletionCmd

func NewCompletionCmd(rootCmd *cobra.Command, hidden bool) *cobra.Command

NewCompletionCmd builds a cobra.Command that generate bash completion scripts for the given root command. If hidden is true, the command will not show up in the root command's list of available commands.

func ParseGas

func ParseGas(gasStr string) (simulateAndExecute bool, gas uint64, err error)

ParseGas parses the value of the gas option.

func PostCommands

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

PostCommands adds common flags for commands to post tx

func RegisterRestServerFlags

func RegisterRestServerFlags(cmd *cobra.Command) *cobra.Command

RegisterRestServerFlags registers the flags required for rest server

Types

type GasSetting

type GasSetting struct {
	Simulate bool
	Gas      uint64
}

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

func (*GasSetting) Set

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

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

func (*GasSetting) String

func (v *GasSetting) String() string

func (*GasSetting) Type

func (v *GasSetting) Type() string

Type returns the flag's value type.

Jump to

Keyboard shortcuts

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