Skip to content

Commit

Permalink
Merge pull request #207 from cheqd/configure-p2p-laddr
Browse files Browse the repository at this point in the history
Add configure p2p laddr command
  • Loading branch information
askolesov authored Nov 11, 2021
2 parents 26700d3 + fda73d4 commit 47f5a14
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion cmd/cheqd-noded/cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func p2pCmd(defaultNodeHome string) *cobra.Command {
persistentPeersCmd(defaultNodeHome),
sendRateCmd(defaultNodeHome),
recvRateCmd(defaultNodeHome),
maxPacketMsgPayloadSizeCmd(defaultNodeHome))
maxPacketMsgPayloadSizeCmd(defaultNodeHome),
p2pLaddrCmd(defaultNodeHome))

return cmd
}
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 47f5a14

Please # to comment.