From 7b4719a3e4ae8a3fde0452e9be6b8d27918b2962 Mon Sep 17 00:00:00 2001 From: NagaTulasi Date: Thu, 4 Feb 2021 23:20:35 +0530 Subject: [PATCH 1/5] rly tx channel command deprecated --- cmd/tx.go | 8 ++++---- docs/commands.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/tx.go b/cmd/tx.go index be8569d2b..1a2ab1af2 100644 --- a/cmd/tx.go +++ b/cmd/tx.go @@ -55,7 +55,7 @@ func transactionCmd() *cobra.Command { upgradeClientsCmd(), upgradeChainCmd(), createConnectionCmd(), - createChannelCmd(), + //createChannelCmd(), closeChannelCmd(), flags.LineBreak, rawTransactionCmd(), @@ -232,12 +232,12 @@ $ %s tx con demo-path -o 3s`, appName, appName, appName)), return retryFlag(timeoutFlag(cmd)) } -func createChannelCmd() *cobra.Command { +/*func createChannelCmd() *cobra.Command { cmd := &cobra.Command{ Use: "channel [path-name]", Aliases: []string{"chan", "ch"}, Short: "create a channel between two configured chains with a configured path", - Long: strings.TrimSpace(`This command is meant to be used to repair or + 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(` @@ -281,7 +281,7 @@ $ %s tx ch demo-path -o 3s`, appName, appName, appName)), } return retryFlag(timeoutFlag(cmd)) -} +}*/ func closeChannelCmd() *cobra.Command { cmd := &cobra.Command{ diff --git a/docs/commands.md b/docs/commands.md index 075ce07da..7369516b7 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -1147,7 +1147,7 @@ Commands to create IBC transactions on configured chains. Most of these commands ### Subcommands -* [rly transact channel](#rly-transact-channel) - create a channel between two configured chains with a configured path + * [rly transact channel-close](#rly-transact-channel-close) - close a channel between two configured chains with a configured path * [rly transact clients](#rly-transact-clients) - create a clients between two configured chains with a configured path * [rly transact connection](#rly-transact-connection) - create a connection between two configured chains with a configured path From 9b51ca61dc39271180ecabb9c216bb1e5ba0d54c Mon Sep 17 00:00:00 2001 From: NagaTulasi Date: Fri, 5 Feb 2021 12:20:21 +0530 Subject: [PATCH 2/5] createChannelCmd deprecated --- cmd/tx.go | 7 ++++--- docs/commands.md | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/tx.go b/cmd/tx.go index 1a2ab1af2..3b3c3b828 100644 --- a/cmd/tx.go +++ b/cmd/tx.go @@ -55,7 +55,7 @@ func transactionCmd() *cobra.Command { upgradeClientsCmd(), upgradeChainCmd(), createConnectionCmd(), - //createChannelCmd(), + createChannelCmd(), closeChannelCmd(), flags.LineBreak, rawTransactionCmd(), @@ -232,7 +232,8 @@ $ %s tx con demo-path -o 3s`, appName, appName, appName)), return retryFlag(timeoutFlag(cmd)) } -/*func createChannelCmd() *cobra.Command { +// Deprecated: Use linkCmd insted to create channel. +func createChannelCmd() *cobra.Command { cmd := &cobra.Command{ Use: "channel [path-name]", Aliases: []string{"chan", "ch"}, @@ -281,7 +282,7 @@ $ %s tx ch demo-path -o 3s`, appName, appName, appName)), } return retryFlag(timeoutFlag(cmd)) -}*/ +} func closeChannelCmd() *cobra.Command { cmd := &cobra.Command{ diff --git a/docs/commands.md b/docs/commands.md index 7369516b7..075ce07da 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -1147,7 +1147,7 @@ Commands to create IBC transactions on configured chains. Most of these commands ### Subcommands - +* [rly transact channel](#rly-transact-channel) - create a channel between two configured chains with a configured path * [rly transact channel-close](#rly-transact-channel-close) - close a channel between two configured chains with a configured path * [rly transact clients](#rly-transact-clients) - create a clients between two configured chains with a configured path * [rly transact connection](#rly-transact-connection) - create a connection between two configured chains with a configured path From 17cebcaf8b1f5f7e3d32784ad4b8904f40ef29c4 Mon Sep 17 00:00:00 2001 From: NagaTulasi Date: Fri, 5 Feb 2021 13:13:36 +0530 Subject: [PATCH 3/5] rly tx channel deprecated --- cmd/tx.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/tx.go b/cmd/tx.go index 3b3c3b828..f21db64b7 100644 --- a/cmd/tx.go +++ b/cmd/tx.go @@ -232,7 +232,8 @@ $ %s tx con demo-path -o 3s`, appName, appName, appName)), return retryFlag(timeoutFlag(cmd)) } -// Deprecated: Use linkCmd insted to create channel. +// Deprecated: createChannelCmd exists for historical compatability and should not be used. +// To create channel use linkCmd instead func createChannelCmd() *cobra.Command { cmd := &cobra.Command{ Use: "channel [path-name]", @@ -240,7 +241,8 @@ func createChannelCmd() *cobra.Command { Short: "create a channel between two configured chains with a configured path", 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), + Args: cobra.ExactArgs(1), + Deprecated: "Use rly tx link command to create channel", Example: strings.TrimSpace(fmt.Sprintf(` $ %s transact channel demo-path $ %s tx chan demo-path --timeout 5s From 4e81b9454e25fe28b08a62c021b6314de6f6a12b Mon Sep 17 00:00:00 2001 From: NagaTulasi Date: Fri, 5 Feb 2021 13:21:01 +0530 Subject: [PATCH 4/5] golint error resolved --- cmd/tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/tx.go b/cmd/tx.go index f21db64b7..8ce0e8c87 100644 --- a/cmd/tx.go +++ b/cmd/tx.go @@ -232,7 +232,7 @@ $ %s tx con demo-path -o 3s`, appName, appName, appName)), return retryFlag(timeoutFlag(cmd)) } -// Deprecated: createChannelCmd exists for historical compatability and should not be used. +// Deprecated: createChannelCmd exists for historical compatibility and should not be used. // To create channel use linkCmd instead func createChannelCmd() *cobra.Command { cmd := &cobra.Command{ From cdec2f5675f1aec0858a05be3efc010adacabddf Mon Sep 17 00:00:00 2001 From: NagaTulasi Date: Fri, 5 Feb 2021 16:37:02 +0530 Subject: [PATCH 5/5] creatChannelCmd code removed and alias channel added to the link command --- cmd/tx.go | 60 +++--------------------------------------------- docs/commands.md | 21 ----------------- 2 files changed, 3 insertions(+), 78 deletions(-) diff --git a/cmd/tx.go b/cmd/tx.go index 8ce0e8c87..851b42240 100644 --- a/cmd/tx.go +++ b/cmd/tx.go @@ -55,7 +55,6 @@ func transactionCmd() *cobra.Command { upgradeClientsCmd(), upgradeChainCmd(), createConnectionCmd(), - createChannelCmd(), closeChannelCmd(), flags.LineBreak, rawTransactionCmd(), @@ -232,60 +231,6 @@ $ %s tx con demo-path -o 3s`, appName, appName, appName)), return retryFlag(timeoutFlag(cmd)) } -// Deprecated: createChannelCmd exists for historical compatibility and should not be used. -// To create channel use linkCmd instead -func createChannelCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "channel [path-name]", - Aliases: []string{"chan", "ch"}, - Short: "create a channel between two configured chains with a configured path", - 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), - Deprecated: "Use rly tx link command to create channel", - 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 { - return err - } - - to, err := getTimeout(cmd) - if err != nil { - return err - } - - retries, err := cmd.Flags().GetUint64(flagMaxRetries) - if err != nil { - return err - } - - // ensure that keys exist - if _, err = c[src].GetAddress(); err != nil { - return err - } - if _, err = c[dst].GetAddress(); err != nil { - return err - } - - modified, err := c[src].CreateOpenChannels(c[dst], retries, to) - if modified { - if err := overWriteConfig(cmd, config); err != nil { - return err - } - } - - return err - - }, - } - - return retryFlag(timeoutFlag(cmd)) -} - func closeChannelCmd() *cobra.Command { cmd := &cobra.Command{ Use: "channel-close [path-name]", @@ -327,7 +272,7 @@ $ %s tx close demo-path -o 3s`, appName, appName, appName, appName)), func linkCmd() *cobra.Command { cmd := &cobra.Command{ Use: "link [path-name]", - Aliases: []string{"full-path", "connect", "path", "pth"}, + Aliases: []string{"full-path", "connect", "path", "pth", "channel"}, Short: "create clients, connection, and channel between two configured chains with a configured path", Args: cobra.ExactArgs(1), Example: strings.TrimSpace(fmt.Sprintf(` @@ -335,7 +280,8 @@ $ %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)), +$ %s tx channel demo-path +$ %s tx pth demo-path`, appName, appName, appName, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { c, src, dst, err := config.ChainsFromPath(args[0]) if err != nil { diff --git a/docs/commands.md b/docs/commands.md index 075ce07da..2b9c4bd24 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -92,7 +92,6 @@ NOTE: Most of the commands have aliases that make typing them much quicker (i.e. - [rly testnets request](#rly-testnets-request) - [rly transact](#rly-transact) - [rly transact channel-close](#rly-transact-channel-close) - - [rly transact channel](#rly-transact-channel) - [rly transact clients](#rly-transact-clients) - [rly transact connection](#rly-transact-connection) - [rly transact link](#rly-transact-link) @@ -1147,7 +1146,6 @@ Commands to create IBC transactions on configured chains. Most of these commands ### Subcommands -* [rly transact channel](#rly-transact-channel) - create a channel between two configured chains with a configured path * [rly transact channel-close](#rly-transact-channel-close) - close a channel between two configured chains with a configured path * [rly transact clients](#rly-transact-clients) - create a clients between two configured chains with a configured path * [rly transact connection](#rly-transact-connection) - create a connection between two configured chains with a configured path @@ -1176,25 +1174,6 @@ rly transact channel-close [path-name] [flags] ``` -## rly transact channel - -create a channel between two configured chains with a configured path - -### Synopsis - -This command is meant to be used to repair or create a channel between two chains with a configured path in the config file - -``` -rly transact channel [path-name] [flags] -``` - -### Options - -``` - -o, --timeout string timeout between relayer runs (default "10s") -``` - - ## rly transact clients create a clients between two configured chains with a configured path