From db25632f3100513a0c5b89f5f7cbee211216a0dc Mon Sep 17 00:00:00 2001 From: Akhil Kumar P <36399231+akhilkumarpilli@users.noreply.github.com> Date: Mon, 4 Jan 2021 16:43:35 +0530 Subject: [PATCH] Add examples to each cmd (#337) --- cmd/chains.go | 27 +++++++++++++++++++ cmd/config.go | 9 +++++++ cmd/dev.go | 20 +++++++++++++- cmd/keys.go | 21 +++++++++++++++ cmd/light.go | 15 +++++++++++ cmd/paths.go | 19 ++++++++++++++ cmd/query.go | 69 ++++++++++++++++++++++++++++++++++++++++++++++++- cmd/raw.go | 45 ++++++++++++++++++++++++++++++++ cmd/root.go | 3 ++- cmd/start.go | 4 +++ cmd/testnets.go | 8 ++++++ cmd/tx.go | 37 ++++++++++++++++++++++++++ cmd/version.go | 4 +++ cmd/xfer.go | 7 +++++ 14 files changed, 285 insertions(+), 3 deletions(-) diff --git a/cmd/chains.go b/cmd/chains.go index 50f588e4a0c..b9ccc90437e 100644 --- a/cmd/chains.go +++ b/cmd/chains.go @@ -9,6 +9,7 @@ import ( "net/url" "os" "path" + "strings" "github.com/spf13/cobra" "gopkg.in/yaml.v2" @@ -47,6 +48,9 @@ func chainsAddrCmd() *cobra.Command { Aliases: []string{"addr"}, Short: "Returns a chain's configured key's address", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s chains address ibc-0 +$ %s ch addr ibc-0`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -72,6 +76,11 @@ func chainsShowCmd() *cobra.Command { Aliases: []string{"s"}, Short: "Returns a chain's configuration data", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s chains show ibc-0 --json +$ %s chains show ibc-0 --yaml +$ %s ch s ibc-0 --json +$ %s ch s ibc-0 --yaml`, appName, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, err := config.Chains.Get(args[0]) if err != nil { @@ -122,6 +131,9 @@ func chainsEditCmd() *cobra.Command { Aliases: []string{"e"}, Short: "Returns chain configuration data", Args: cobra.ExactArgs(3), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s chains edit ibc-0 trusting-period 32h +$ %s ch e ibc-0 trusting-period 32h`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -149,6 +161,9 @@ func chainsDeleteCmd() *cobra.Command { Aliases: []string{"d"}, Short: "Returns chain configuration data", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s chains delete ibc-0 +$ %s ch d ibc-0`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { return overWriteConfig(cmd, config.DeleteChain(args[0])) }, @@ -161,6 +176,9 @@ func chainsListCmd() *cobra.Command { Use: "list", Aliases: []string{"l"}, Short: "Returns chain configuration data", + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s chains list +$ %s ch l`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { jsn, err := cmd.Flags().GetBool(flagJSON) if err != nil { @@ -231,6 +249,12 @@ func chainsAddCmd() *cobra.Command { Use: "add", Aliases: []string{"a"}, Short: "Add a new chain to the configuration file by passing a file (-f) or url (-u), or user input", + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s chains add +$ %s ch a +$ %s chains add --file chains/ibc0.json +$ %s chains add --url http://relayer.com/ibc0.json +`, appName, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { var out *Config @@ -272,6 +296,9 @@ func chainsAddDirCmd() *cobra.Command { Args: cobra.ExactArgs(1), Short: `Add new chains to the configuration file from a directory full of chain configuration, useful for adding testnet configurations`, + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s chains add-dir testnet/chains/ +$ %s ch ad testnet/chains/`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) (err error) { var out *Config if out, err = filesAdd(args[0]); err != nil { diff --git a/cmd/config.go b/cmd/config.go index 38668833c88..b59b7ac83f5 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -60,6 +60,9 @@ func configShowCmd() *cobra.Command { Use: "show", Aliases: []string{"s", "list", "l"}, Short: "Prints current configuration", + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s config show --home %s +$ %s cfg list`, appName, defaultHome, appName)), RunE: func(cmd *cobra.Command, args []string) error { home, err := cmd.Flags().GetString(flags.FlagHome) if err != nil { @@ -93,6 +96,9 @@ func configInitCmd() *cobra.Command { Use: "init", Aliases: []string{"i"}, Short: "Creates a default home directory at path defined by --home", + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s config init --home %s +$ %s cfg i`, appName, defaultHome, appName)), RunE: func(cmd *cobra.Command, args []string) error { home, err := cmd.Flags().GetString(flags.FlagHome) if err != nil { @@ -149,6 +155,9 @@ func configAddDirCmd() *cobra.Command { Args: cobra.ExactArgs(1), Short: `Add new chains and paths to the configuration file from a directory full of chain and path configuration, useful for adding testnet configurations`, + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s config add-dir configs/ +$ %s cfg ad configs/`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) (err error) { var out *Config if out, err = cfgFilesAdd(args[0]); err != nil { diff --git a/cmd/dev.go b/cmd/dev.go index ab432c6264f..0729da2e4ca 100644 --- a/cmd/dev.go +++ b/cmd/dev.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "os" + "strings" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" @@ -32,6 +33,10 @@ func genesisCmd() *cobra.Command { Aliases: []string{"gen"}, Short: "fetch the genesis file for a configured chain", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s dev genesis ibc-0 +$ %s dev gen ibc-0 +$ %s development genesis ibc-2`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, err := config.Chains.Get(args[0]) if err != nil { @@ -62,6 +67,10 @@ func listenCmd() *cobra.Command { Aliases: []string{"l"}, Short: "listen to all transaction and block events from a given chain and output them to stdout", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s dev listen ibc-0 --data --no-tx +$ %s dev l ibc-1 --no-block +$ %s development listen ibc-2 --no-tx`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, err := config.Chains.Get(args[0]) if err != nil { @@ -100,6 +109,9 @@ func gaiaServiceCmd() *cobra.Command { Use: "gaia [user] [home]", Short: "gaia returns a sample gaiad service file", Args: cobra.ExactArgs(2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s dev gaia [user-name] [path-to-home] +$ %s development gaia user /home/user`, appName, appName)), Run: func(cmd *cobra.Command, args []string) { fmt.Printf(`[Unit] Description=gaiad @@ -125,6 +137,9 @@ func faucetService() *cobra.Command { Use: "faucet [user] [home] [chain-id] [key-name] [amount]", Short: "faucet returns a sample faucet service file", Args: cobra.ExactArgs(5), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s dev faucet faucetuser /home/faucetuser ibc-0 testkey 1000000stake +$ %s development faucet root /home/root ibc-1 testkey2 1000000stake`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[2]) if err != nil { @@ -163,7 +178,10 @@ func rlyService() *cobra.Command { Use: "relayer [path-name]", Aliases: []string{"rly"}, Short: "relayer returns a service file for the relayer to relay over an individual path", - Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s dev rly demo-path +$ %s development relayer path-test`, appName, appName)), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { user, home := os.Getenv("USER"), os.Getenv("HOME") if user == "" || home == "" { diff --git a/cmd/keys.go b/cmd/keys.go index 4475f80b0cf..13573e2e622 100644 --- a/cmd/keys.go +++ b/cmd/keys.go @@ -53,6 +53,10 @@ func keysAddCmd() *cobra.Command { Aliases: []string{"a"}, Short: "adds a key to the keychain associated with a particular chain", Args: cobra.RangeArgs(1, 2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s keys add ibc-0 +$ %s keys add ibc-1 key2 +$ %s k a ibc-2 testkey`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -107,6 +111,9 @@ func keysRestoreCmd() *cobra.Command { Aliases: []string{"r"}, Short: "restores a mnemonic to the keychain associated with a particular chain", Args: cobra.ExactArgs(3), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s keys restore ibc-0 testkey "[mnemonic-words]" +$ %s k r ibc-1 faucet-key "[mnemonic-words]"`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { keyName := args[1] chain, err := config.Chains.Get(args[0]) @@ -139,6 +146,10 @@ func keysDeleteCmd() *cobra.Command { Aliases: []string{"d"}, Short: "deletes a key from the keychain associated with a particular chain", Args: cobra.RangeArgs(1, 2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s keys delete ibc-0 -y +$ %s keys delete ibc-1 key2 -y +$ %s k d ibc-2 testkey`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -202,6 +213,9 @@ func keysListCmd() *cobra.Command { Aliases: []string{"l"}, Short: "lists keys from the keychain associated with a particular chain", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s keys list ibc-0 +$ %s k l ibc-1`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -231,6 +245,10 @@ func keysShowCmd() *cobra.Command { Aliases: []string{"s"}, Short: "shows a key from the keychain associated with a particular chain", Args: cobra.RangeArgs(1, 2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s keys show ibc-0 +$ %s keys show ibc-1 key2 +$ %s k s ibc-2 testkey`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -268,6 +286,9 @@ func keysExportCmd() *cobra.Command { Aliases: []string{"e"}, Short: "exports a privkey from the keychain associated with a particular chain", Args: cobra.ExactArgs(2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s keys export ibc-0 testkey +$ %s k e ibc-2 testkey`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { keyName := args[1] chain, err := config.Chains.Get(args[0]) diff --git a/cmd/light.go b/cmd/light.go index 1d1beff6c9e..7a976b65be0 100644 --- a/cmd/light.go +++ b/cmd/light.go @@ -18,6 +18,7 @@ package cmd import ( "fmt" "strconv" + "strings" "github.com/cosmos/cosmos-sdk/client/flags" tmclient "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" @@ -50,6 +51,10 @@ func initLightCmd() *cobra.Command { 1. passing it a root of trust as a --hash/-x and --height 2. Use --force/-f to initialize from the configured node`, Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s light init ibc-0 --force +$ %s light init ibc-1 --height 1406 --hash +$ %s l i ibc-2 --force`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -104,6 +109,9 @@ func updateLightCmd() *cobra.Command { Aliases: []string{"u"}, Short: "Update the light client to latest header from configured node", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s light update ibc-0 +$ %s l u ibc-1`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -136,6 +144,10 @@ func lightHeaderCmd() *cobra.Command { Long: "Get a header from the light client database. 0 returns last" + "trusted header and all others return the header at that height if stored", Args: cobra.RangeArgs(1, 2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s light header ibc-0 +$ %s light header ibc-1 1400 +$ %s l hdr ibc-2`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chainID := args[0] chain, err := config.Chains.Get(chainID) @@ -194,6 +206,9 @@ func deleteLightCmd() *cobra.Command { Aliases: []string{"d"}, Short: "wipe the light client database, forcing re-initialzation on the next run", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s light delete ibc-0 +$ %s l d ibc-2`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chainID := args[0] chain, err := config.Chains.Get(chainID) diff --git a/cmd/paths.go b/cmd/paths.go index fba0552cb85..c2a142e251f 100644 --- a/cmd/paths.go +++ b/cmd/paths.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "os" + "strings" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" conntypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" @@ -44,6 +45,9 @@ func pathsGenCmd() *cobra.Command { Aliases: []string{"gen"}, Short: "generate identifiers for a new path between src and dst, reusing any that exist", Args: cobra.ExactArgs(3), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s paths generate ibc-0 ibc-1 demo-path --force +$ %s pth gen ibc-0 ibc-1 demo-path --unordered false --version ics20-2`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) (err error) { var ( src, dst, pth = args[0], args[1], args[2] @@ -313,6 +317,9 @@ func pathsDeleteCmd() *cobra.Command { Aliases: []string{"d"}, Short: "delete a path with a given index", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s paths delete demo-path +$ %s pth d path-name`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { if _, err := config.Paths.Get(args[0]); err != nil { return err @@ -330,6 +337,10 @@ func pathsListCmd() *cobra.Command { Use: "list", Aliases: []string{"l"}, Short: "print out configured paths", + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s paths list --yaml +$ %s paths list --json +$ %s pth l`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { jsn, _ := cmd.Flags().GetBool(flagJSON) yml, _ := cmd.Flags().GetBool(flagYAML) @@ -386,6 +397,10 @@ func pathsShowCmd() *cobra.Command { Aliases: []string{"s"}, Short: "show a path given its name", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s paths show demo-path --yaml +$ %s paths show demo-path --json +$ %s pth s path-name`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { path, err := config.Paths.Get(args[0]) if err != nil { @@ -431,6 +446,10 @@ func pathsAddCmd() *cobra.Command { Aliases: []string{"a"}, Short: "add a path to the list of paths", Args: cobra.ExactArgs(3), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s paths add ibc-0 ibc-1 demo-path +$ %s paths add ibc-0 ibc-1 demo-path --file paths/demo.json +$ %s pth a ibc-0 ibc-1 demo-path`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] _, err := config.Chains.Gets(src, dst) diff --git a/cmd/query.go b/cmd/query.go index 7c6881b635d..3e06ca3a8f5 100644 --- a/cmd/query.go +++ b/cmd/query.go @@ -57,6 +57,9 @@ func queryIBCDenoms() *cobra.Command { Use: "ibc-denoms [chain-id]", Short: "Query transaction by transaction hash", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query ibc-denoms ibc-0 +$ %s q ibc-denoms ibc-0`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -81,6 +84,9 @@ func queryTx() *cobra.Command { Use: "tx [chain-id] [tx-hash]", Short: "Query transaction by transaction hash", Args: cobra.ExactArgs(2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query tx ibc-0 [tx-hash] +$ %s q tx ibc-0 A5DF8D272F1C451CFF92BA6C41942C4D29B5CF180279439ED6AB038282F956BE`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -114,6 +120,9 @@ takes the form of '{eventType}.{eventAttribute}={value}' with multiple events se Please refer to each module's documentation for the full set of events to query for. Each module documents its respective events under 'cosmos-sdk/x/{module}/spec/xx_events.md'.`), Args: cobra.ExactArgs(2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query txs ibc-0 "message.action=transfer" --offset 1 --limit 10 +$ %s q txs ibc-0 "message.action=transfer"`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -163,6 +172,9 @@ func queryAccountCmd() *cobra.Command { Aliases: []string{"acc"}, Short: "Query the account data", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query account ibc-0 +$ %s q acc ibc-1`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -195,6 +207,10 @@ func queryBalanceCmd() *cobra.Command { Aliases: []string{"bal"}, Short: "Query the account balances", Args: cobra.RangeArgs(1, 2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query balance ibc-0 +$ %s query balance ibc-0 testkey +$ %s q bal ibc-1 --ibc-denoms`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -257,10 +273,14 @@ func queryBalanceCmd() *cobra.Command { func queryHeaderCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "header [chain-id] [height]", + Use: "header [chain-id] [[height]]", Aliases: []string{"hdr"}, Short: "Query the header of a chain at a given height", Args: cobra.RangeArgs(1, 2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query header ibc-0 +$ %s query header ibc-0 1400 +$ %s q hdr ibc-1`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -314,6 +334,9 @@ func queryNodeStateCmd() *cobra.Command { Use: "node-state [chain-id]", Short: "Query the consensus state of a node", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query node-state ibc-0 +$ %s q node-state ibc-1`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -338,6 +361,10 @@ func queryClientCmd() *cobra.Command { Aliases: []string{"clnt"}, Short: "Query the state of a client given it's client-id", Args: cobra.ExactArgs(2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query client ibc-0 ibczeroclient +$ %s query client ibc-0 ibczeroclient --height 1205 +$ %s q clnt ibc-1 ibconeclient`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -378,6 +405,10 @@ func queryClientsCmd() *cobra.Command { Aliases: []string{"clnts"}, Short: "Query for all client states on a chain", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query clients ibc-0 +$ %s query clients ibc-2 --offset 2 --limit 30 +$ %s q clnts ibc-1`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -412,6 +443,9 @@ func queryValSetAtHeightCmd() *cobra.Command { Aliases: []string{"vs"}, Short: "Query validator set at particular height", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query valset ibc-0 +$ %s q vs ibc-1`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -443,6 +477,10 @@ func queryConnections() *cobra.Command { Aliases: []string{"conns"}, Short: "Query for all connections on a chain", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query connections ibc-0 +$ %s query connections ibc-2 --offset 2 --limit 30 +$ %s q conns ibc-1`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -477,6 +515,10 @@ func queryConnectionsUsingClient() *cobra.Command { Aliases: []string{"clnt-conns"}, Short: "Query for all connections on a given client", Args: cobra.ExactArgs(2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query client-connections ibc-0 ibczeroclient +$ %s query client-connections ibc-0 ibczeroclient --height 1205 +$ %s q clnt-conns ibc-1 ibconeclient`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -517,6 +559,9 @@ func queryConnection() *cobra.Command { Aliases: []string{"conn"}, Short: "Query the connection state for the given connection id", Args: cobra.ExactArgs(2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query connection ibc-0 ibconnection0 +$ %s q conn ibc-1 ibconeconn`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -550,6 +595,10 @@ func queryConnectionChannels() *cobra.Command { Aliases: []string{"conn-chans"}, Short: "Query any channels associated with a given connection", Args: cobra.ExactArgs(2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query connection-channels ibc-0 ibcconnection1 +$ %s query connection-channels ibc-2 ibcconnection2 --offset 2 --limit 30 +$ %s q conn-chans ibc-0 ibcconnection1`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -586,6 +635,10 @@ func queryChannel() *cobra.Command { Aliases: []string{"chan"}, Short: "Query a channel given it's channel and port ids", Args: cobra.ExactArgs(3), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query channel ibc-0 ibczerochannel transfer +$ %s query channel ibc-2 ibctwochannel transfer --height 1205 +$ %s q chan ibc-1 ibconechannel transfer`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -626,6 +679,10 @@ func queryChannels() *cobra.Command { Aliases: []string{"chans"}, Short: "Query for all channels on a chain", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query channels ibc-0 +$ %s query channels ibc-2 --offset 2 --limit 30 +$ %s q chans ibc-1`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -659,6 +716,9 @@ func queryPacketCommitment() *cobra.Command { Use: "packet-commit [chain-id] [channel-id] [port-id] [seq]", Short: "Query for the packet commitment given it's sequence and channel ids", Args: cobra.ExactArgs(4), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query packet-commit ibc-0 ibczerochannel transfer 32 +$ %s q packet-commit ibc-1 ibconechannel transfer 31`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -692,6 +752,10 @@ func queryUnrelayedPackets() *cobra.Command { Aliases: []string{"unrelayed", "pkts"}, Short: "Query for the packet sequence numbers that remain to be relayed on a given path", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query unrelayed-packets demo-path +$ %s query unrelayed demo-path +$ %s q pkts demo-path`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { path, err := config.Paths.Get(args[0]) if err != nil { @@ -745,6 +809,9 @@ func queryUnrelayedAcknowledgements() *cobra.Command { Aliases: []string{"acks"}, Short: "Query for the packet sequence numbers that remain to be relayed on a given path", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query unrelayed-acknowledgements demo-path +$ %s q acks demo-path`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { path, err := config.Paths.Get(args[0]) if err != nil { diff --git a/cmd/raw.go b/cmd/raw.go index f03e1e01711..23f4ba3f3a0 100644 --- a/cmd/raw.go +++ b/cmd/raw.go @@ -1,6 +1,7 @@ package cmd import ( + "fmt" "strings" sdk "github.com/cosmos/cosmos-sdk/types" @@ -46,6 +47,9 @@ func updateClientCmd() *cobra.Command { Aliases: []string{"uc"}, Short: "update client for dst-chain on src-chain", Args: cobra.ExactArgs(3), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw update-client ibc-0 ibc-1 ibczeroclient +$ %s tx raw uc ibc-0 ibc-1 ibconeclient`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] @@ -80,6 +84,9 @@ func createClientCmd() *cobra.Command { Aliases: []string{"clnt"}, Short: "create a client for dst-chain on src-chain", Args: cobra.ExactArgs(3), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw client ibc-0 ibc-1 ibczeroclient +$ %s tx raw clnt ibc-1 ibc-0 ibconeclient`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) @@ -119,6 +126,9 @@ func connInit() *cobra.Command { Use: "conn-init [src-chain-id] [dst-chain-id] [src-client-id] [dst-client-id] [src-conn-id] [dst-conn-id]", Short: "conn-init", Args: cobra.ExactArgs(6), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw conn-init ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2 +$ %s tx raw conn-init ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) @@ -146,6 +156,9 @@ func connTry() *cobra.Command { Use: "conn-try [src-chain-id] [dst-chain-id] [src-client-id] [dst-client-id] [src-conn-id] [dst-conn-id]", Short: "conn-try", Args: cobra.ExactArgs(6), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw conn-try ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2 +$ %s tx raw conn-try ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) @@ -211,6 +224,9 @@ func connAck() *cobra.Command { Use: "conn-ack [src-chain-id] [dst-chain-id] [dst-client-id] [src-client-id] [src-conn-id] [dst-conn-id]", Short: "conn-ack", Args: cobra.ExactArgs(6), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw conn-ack ibc-0 ibc-1 ibconeclient ibczeroclient ibcconn1 ibcconn2 +$ %s tx raw conn-ack ibc-0 ibc-1 ibconeclient ibczeroclient ibcconn1 ibcconn2`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) @@ -276,6 +292,9 @@ func connConfirm() *cobra.Command { Use: "conn-confirm [src-chain-id] [dst-chain-id] [src-client-id] [dst-client-id] [src-conn-id] [dst-conn-id]", Short: "conn-confirm", Args: cobra.ExactArgs(6), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw conn-confirm ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2 +$ %s tx raw conn-confirm ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) @@ -327,6 +346,9 @@ func createConnectionStepCmd() *cobra.Command { Long: strings.TrimSpace(`This command creates the next handshake message given a specifc set of identifiers. If the command fails, you can safely run it again to repair an unfinished connection`), Args: cobra.ExactArgs(6), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw connection-step ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2 +$ %s tx raw conn-step ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) @@ -369,6 +391,8 @@ func chanInit() *cobra.Command { [dst-client-id] [src-conn-id] [dst-conn-id] [src-chan-id] [dst-chan-id] [src-port-id] [dst-port-id] [ordering]`), Short: "chan-init", Args: cobra.ExactArgs(11), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s tx raw chan-init ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2 ibcchan1 ibcchan2 transfer transfer ordered`, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(args[0], args[1]) @@ -397,6 +421,9 @@ func chanTry() *cobra.Command { [src-client-id] [src-conn-id] [src-chan-id] [dst-chan-id] [src-port-id] [dst-port-id]`), Short: "chan-try", Args: cobra.ExactArgs(8), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw chan-try ibc-0 ibc-1 ibczeroclient ibcconn0 ibcchan1 ibcchan2 transfer transfer +$ %s tx raw chan-try ibc-0 ibc-1 ibczeroclient ibcconn0 ibcchan1 ibcchan2 transfer transfer`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) @@ -443,6 +470,10 @@ func chanAck() *cobra.Command { [src-chan-id] [dst-chan-id] [src-port-id] [dst-port-id]`), Short: "chan-ack", Args: cobra.ExactArgs(7), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw chan-ack ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 transfer transfer +$ %s tx raw chan-ack ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 transfer transfer +`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) @@ -489,6 +520,9 @@ func chanConfirm() *cobra.Command { [src-chan-id] [dst-chan-id] [src-port-id] [dst-port-id]`), Short: "chan-confirm", Args: cobra.ExactArgs(7), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw chan-confirm ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 transfer transfer +$ %s tx raw chan-confirm ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 transfer transfer`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) @@ -536,6 +570,10 @@ func createChannelStepCmd() *cobra.Command { Aliases: []string{"chan-step"}, Short: "create the next step in creating a channel between chains with the passed identifiers", Args: cobra.ExactArgs(11), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw chan-step ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2 ibcchan1 ibcchan2 transfer transfer ordered +$ %s tx raw channel-step ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2 ibcchan1 ibcchan2 transfer transfer ordered +`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] ordering := relayer.OrderFromString(args[10]) @@ -578,6 +616,9 @@ func chanCloseInit() *cobra.Command { Use: "chan-close-init [chain-id] [channel-id] [port-id]", Short: "chan-close-init", Args: cobra.ExactArgs(3), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact raw chan-close-init ibc-0 ibcchan1 transfer +$ %s tx raw chan-close-init ibc-0 ibcchan1 transfer`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, err := config.Chains.Get(args[0]) if err != nil { @@ -600,6 +641,8 @@ func chanCloseConfirm() *cobra.Command { [src-client-id] [src-chan-id] [dst-chan-id] [src-port-id] [dst-port-id]`), Short: "chan-close-confirm", Args: cobra.ExactArgs(7), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s tx raw chan-close-confirm ibc-0 ibc-1 ibczeroclient ibcchan1 ibcchan2 transfer transfer`, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) @@ -646,6 +689,8 @@ func closeChannelStepCmd() *cobra.Command { [src-connection-id] [dst-connection-id] [src-channel-id] [dst-channel-id] [src-port-id] [dst-port-id]`), Short: "create the next step in closing a channel between chains with the passed identifiers", Args: cobra.ExactArgs(10), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s tx raw close-channel-step ibc-0 ibc-1 ibczeroclient ibconeclient ibcconn1 ibcconn2 ibcchan1 ibcchan2 transfer transfer`, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] chains, err := config.Chains.Gets(src, dst) diff --git a/cmd/root.go b/cmd/root.go index b28ee3d87a3..15d97af3ffb 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -34,6 +34,7 @@ var ( debug bool config *Config defaultHome = os.ExpandEnv("$HOME/.relayer") + appName = "rly" // Default identifiers for dummy usage dcli = "defaultclientid" @@ -83,7 +84,7 @@ func init() { // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ - Use: "rly", + Use: appName, Short: "This application relays data between configured IBC enabled chains", Long: strings.TrimSpace(`The relayer has commands for: 1. Configuration of the Chains and Paths that the relayer with transfer packets over diff --git a/cmd/start.go b/cmd/start.go index 364f20244c3..0a0c1049da1 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -19,6 +19,7 @@ import ( "fmt" "os" "os/signal" + "strings" "syscall" "github.com/cosmos/relayer/relayer" @@ -33,6 +34,9 @@ func startCmd() *cobra.Command { Aliases: []string{"st"}, Short: "Start the listening relayer on a given path", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s start demo-path --max-msgs 3 +$ %s start demo-path2 --max-tx-size 10`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, src, dst, err := config.ChainsFromPath(args[0]) if err != nil { diff --git a/cmd/testnets.go b/cmd/testnets.go index 0b2eebd7805..d96da80b321 100644 --- a/cmd/testnets.go +++ b/cmd/testnets.go @@ -8,6 +8,7 @@ import ( "net" "net/http" "net/url" + "strings" "time" sdk "github.com/cosmos/cosmos-sdk/types" @@ -35,6 +36,10 @@ func faucetRequestCmd() *cobra.Command { Aliases: []string{"req"}, Short: "request tokens from a relayer faucet", Args: cobra.RangeArgs(1, 2), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s testnets request ibc-0 --url http://0.0.0.0:8000 +$ %s testnets request ibc-0 testkey --url http://0.0.0.0:8000 +$ %s tst req ibc-0`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { @@ -100,6 +105,9 @@ func faucetStartCmd() *cobra.Command { Use: "faucet [chain-id] [key-name] [amount]", Short: "listens on a port for requests for tokens", Args: cobra.ExactArgs(3), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s testnets faucet ibc-0 testkey 100000stake --listen http://0.0.0.0:8081 +$ %s tst faucet ibc-0 testkey 100000stake`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chain, err := config.Chains.Get(args[0]) if err != nil { diff --git a/cmd/tx.go b/cmd/tx.go index 349c152918a..02bbac9c691 100644 --- a/cmd/tx.go +++ b/cmd/tx.go @@ -64,6 +64,9 @@ func createClientsCmd() *cobra.Command { Long: "Creates a working ibc client for chain configured on each end of the" + " path by querying headers from each chain and then sending the corresponding create-client messages", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact clients demo-path +$ %s tx clnts demo-path`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, src, dst, err := config.ChainsFromPath(args[0]) if err != nil { @@ -92,6 +95,10 @@ func updateClientsCmd() *cobra.Command { Long: "Updates a working ibc client for chain configured on each end of the " + "path by querying headers from each chain and then sending the corresponding update-client messages", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact update-clients demo-path +$ %s tx update demo-path +$ %s tx uc demo-path`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, src, dst, err := config.ChainsFromPath(args[0]) if err != nil { @@ -120,6 +127,10 @@ func createConnectionCmd() *cobra.Command { Long: strings.TrimSpace(`This command is meant to be used to repair or create a connection between two chains with a configured path in the config file`), Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact connection demo-path +$ %s tx conn demo-path --timeout 5s +$ %s tx con demo-path -o 3s`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, src, dst, err := config.ChainsFromPath(args[0]) if err != nil { @@ -154,6 +165,10 @@ func createChannelCmd() *cobra.Command { Long: strings.TrimSpace(`This command is meant to be used to repair or create a channel between two chains with a configured path in the config file`), Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact channel demo-path +$ %s tx chan demo-path --timeout 5s +$ %s tx ch demo-path -o 3s`, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, src, dst, err := config.ChainsFromPath(args[0]) if err != nil { @@ -187,6 +202,11 @@ func closeChannelCmd() *cobra.Command { Short: "close a channel between two configured chains with a configured path", Long: "This command is meant to close a channel", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact channel-close demo-path +$ %s tx chan-cl demo-path --timeout 5s +$ %s tx cl demo-path +$ %s tx close demo-path -o 3s`, appName, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, src, dst, err := config.ChainsFromPath(args[0]) if err != nil { @@ -219,6 +239,12 @@ func linkCmd() *cobra.Command { Aliases: []string{"full-path", "connect", "path", "pth"}, Short: "create clients, connection, and channel between two configured chains with a configured path", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact link demo-path +$ %s tx full-path demo-path --timeout 5s +$ %s tx connect demo-path +$ %s tx path demo-path -o 3s +$ %s tx pth demo-path`, appName, appName, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, src, dst, err := config.ChainsFromPath(args[0]) if err != nil { @@ -261,6 +287,9 @@ func linkThenStartCmd() *cobra.Command { Use: "link-then-start [path-name]", Short: "wait for a link to come up, then start relaying packets", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact link-then-start demo-path +$ %s tx link-then-start demo-path --timeout 5s`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { lCmd := linkCmd() for err := lCmd.RunE(cmd, args); err != nil; err = lCmd.RunE(cmd, args) { @@ -280,6 +309,11 @@ func relayMsgsCmd() *cobra.Command { Aliases: []string{"rly", "pkts", "relay"}, Short: "relay any packets that remain to be relayed on a given path, in both directions", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact relay-packets demo-path +$ %s tx rly demo-path -l 3 +$ %s tx pkts demo-path -s 5 +$ %s tx relay demo-path`, appName, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, src, dst, err := config.ChainsFromPath(args[0]) if err != nil { @@ -322,6 +356,9 @@ func relayAcksCmd() *cobra.Command { Aliases: []string{"acks"}, Short: "relay any acknowledgements that remain to be relayed on a given path, in both directions", Args: cobra.ExactArgs(1), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact relay-acknowledgements demo-path +$ %s tx acks demo-path -l 3 -s 6`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, src, dst, err := config.ChainsFromPath(args[0]) if err != nil { diff --git a/cmd/version.go b/cmd/version.go index 5be6d0da3fe..45e3d367930 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "runtime" + "strings" "github.com/spf13/cobra" "gopkg.in/yaml.v2" @@ -30,6 +31,9 @@ func getVersionCmd() *cobra.Command { Use: "version", Aliases: []string{"v"}, Short: "Print relayer version info", + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s version --json +$ %s v`, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { jsn, err := cmd.Flags().GetBool(flagJSON) if err != nil { diff --git a/cmd/xfer.go b/cmd/xfer.go index f7963333aad..225ac43bc04 100644 --- a/cmd/xfer.go +++ b/cmd/xfer.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "strings" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" @@ -19,6 +20,12 @@ func xfersend() *cobra.Command { Long: "Sends the first step to transfer tokens in an IBC transfer." + " The created packet must be relayed to another chain", Args: cobra.ExactArgs(4), + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s transact transfer ibc-0 ibc-1 100000stake cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk --path demo-path +$ %s tx xfer ibc-0 ibc-1 100000stake cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk --path demo -y 2 -c 10 +$ %s tx txf ibc-0 ibc-1 100000stake cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk --path demo +$ %s tx raw send ibc-0 ibc-1 100000stake cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk --path demo -c 5 +`, appName, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { src, dst := args[0], args[1] c, err := config.Chains.Gets(src, dst)