github.com/lino-network/lino@v0.6.11/client/flags.go (about) 1 package client 2 3 import ( 4 "github.com/spf13/cobra" 5 ) 6 7 // nolint 8 const ( 9 FlagOffline = "offline" 10 FlagChainID = "chain-id" 11 FlagNode = "node" 12 FlagHeight = "height" 13 FlagTrustNode = "trust-node" 14 FlagName = "name" 15 FlagSequence = "sequence" 16 FlagPrivKey = "priv-key" 17 FlagPubKey = "pub-key" 18 FlagFees = "fees" 19 20 // Infra 21 FlagProvider = "provider" 22 FlagUsage = "usage" 23 ) 24 25 // PostCommands adds common flags for commands to post tx 26 func PostCommands(cmds ...*cobra.Command) []*cobra.Command { 27 for _, c := range cmds { 28 c.Flags().Int64(FlagSequence, -1, "Sequence number to sign the tx") 29 c.Flags().String(FlagChainID, "", "Chain ID of tendermint node") 30 c.Flags().String(FlagPrivKey, "", "Hex-encoded private key or encrypted file path(starting with @) to sign the transaction") 31 c.Flags().String(FlagNode, "tcp://localhost:26657", "<host>:<port> to tendermint rpc interface for this chain") 32 c.Flags().String(FlagFees, "", "Fees to pay along with transaction; eg: 1linocoin") 33 c.Flags().Bool(FlagOffline, false, "Print Tx to stdout only") 34 } 35 return cmds 36 }