Skip to content

Commit 449df60

Browse files
committed
feat: initia: add restart command
1 parent fdca44e commit 449df60

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

cmd/initia.go

+22
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func InitiaCommand() *cobra.Command {
3636
initiaInitCommand(),
3737
initiaStartCommand(),
3838
initiaStopCommand(),
39+
initiaRestartCommand(),
3940
initiaLogCommand(),
4041
)
4142

@@ -104,6 +105,27 @@ func initiaStopCommand() *cobra.Command {
104105
return startCmd
105106
}
106107

108+
func initiaRestartCommand() *cobra.Command {
109+
reStartCmd := &cobra.Command{
110+
Use: "restart",
111+
Short: "Restart the initiad full node application.",
112+
RunE: func(cmd *cobra.Command, args []string) error {
113+
err := utils.StopService(utils.GetRunL1NodeServiceName())
114+
if err != nil {
115+
return err
116+
}
117+
118+
err = utils.StartService(utils.GetRunL1NodeServiceName())
119+
if err != nil {
120+
return err
121+
}
122+
return nil
123+
},
124+
}
125+
126+
return reStartCmd
127+
}
128+
107129
func initiaLogCommand() *cobra.Command {
108130
logCmd := &cobra.Command{
109131
Use: "log",

0 commit comments

Comments
 (0)