diff --git a/cmd/cheqd-noded/cmd/configure.go b/cmd/cheqd-noded/cmd/configure.go index 8a85300a8..3c5c38a19 100644 --- a/cmd/cheqd-noded/cmd/configure.go +++ b/cmd/cheqd-noded/cmd/configure.go @@ -42,7 +42,8 @@ func p2pCmd(defaultNodeHome string) *cobra.Command { persistentPeersCmd(defaultNodeHome), sendRateCmd(defaultNodeHome), recvRateCmd(defaultNodeHome), - maxPacketMsgPayloadSizeCmd(defaultNodeHome)) + maxPacketMsgPayloadSizeCmd(defaultNodeHome), + p2pLaddrCmd(defaultNodeHome)) return cmd } @@ -227,6 +228,26 @@ func maxPacketMsgPayloadSizeCmd(defaultNodeHome string) *cobra.Command { return cmd } +// p2pLaddrCmd returns configuration cobra Command. +func p2pLaddrCmd(defaultNodeHome string) *cobra.Command { + cmd := &cobra.Command{ + Use: "laddr [value]", + Short: "Update p2p.laddr value in config.toml", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + return updateTmConfig(clientCtx.HomeDir, func(config *tmcfg.Config) { + config.P2P.ListenAddress = args[0] + }) + }, + } + + cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") + + return cmd +} + // createEmptyBlocksCmd returns configuration cobra Command. func createEmptyBlocksCmd(defaultNodeHome string) *cobra.Command { cmd := &cobra.Command{