diff --git a/ioctl/cmd/node/nodedelegate.go b/ioctl/cmd/node/nodedelegate.go index c6ca3a3f03..e9119c5b18 100644 --- a/ioctl/cmd/node/nodedelegate.go +++ b/ioctl/cmd/node/nodedelegate.go @@ -137,6 +137,9 @@ func delegates() error { if err != nil { return output.NewError(0, "failed to get epoch meta", err) } + if response.EpochData == nil { + return output.NewError(0, "ROLLDPOS is not registered", nil) + } epochData := response.EpochData aliases := alias.GetAliasMap() message := delegatesMessage{ diff --git a/ioctl/cmd/node/nodeprobationlist.go b/ioctl/cmd/node/nodeprobationlist.go index 6f5ce0bc64..60847cce9d 100644 --- a/ioctl/cmd/node/nodeprobationlist.go +++ b/ioctl/cmd/node/nodeprobationlist.go @@ -79,6 +79,9 @@ func probationlist() error { if err != nil { return output.NewError(0, "failed to get epoch meta", err) } + if response.EpochData == nil { + return output.NewError(0, "ROLLDPOS is not registered", nil) + } probationlist, err := getProbationList(_epochNum, response.EpochData.Height) if err != nil { return output.NewError(0, "failed to get probation list", err) diff --git a/ioctl/newcmd/node/node.go b/ioctl/newcmd/node/node.go index 1a39ce01cb..484897e110 100644 --- a/ioctl/newcmd/node/node.go +++ b/ioctl/newcmd/node/node.go @@ -25,6 +25,7 @@ func NewNodeCmd(client ioctl.Client) *cobra.Command { } nc.AddCommand(NewNodeDelegateCmd(client)) nc.AddCommand(NewNodeRewardCmd(client)) + nc.AddCommand(NewNodeProbationlistCmd(client)) client.SetEndpointWithFlag(nc.PersistentFlags().StringVar) client.SetInsecureWithFlag(nc.PersistentFlags().BoolVar) diff --git a/ioctl/newcmd/node/nodedelegate.go b/ioctl/newcmd/node/nodedelegate.go index c10fc5a485..471e1fd2e6 100644 --- a/ioctl/newcmd/node/nodedelegate.go +++ b/ioctl/newcmd/node/nodedelegate.go @@ -182,6 +182,9 @@ func NewNodeDelegateCmd(client ioctl.Client) *cobra.Command { if err != nil { return errors.Wrap(err, "failed to get epoch meta") } + if response.EpochData == nil { + return errors.New("ROLLDPOS is not registered") + } epochData := response.EpochData aliases := client.AliasMap() message := delegatesMessage{ diff --git a/ioctl/newcmd/node/nodeprobationlist.go b/ioctl/newcmd/node/nodeprobationlist.go index d27e3804b0..3119a30a35 100644 --- a/ioctl/newcmd/node/nodeprobationlist.go +++ b/ioctl/newcmd/node/nodeprobationlist.go @@ -55,6 +55,9 @@ func NewNodeProbationlistCmd(client ioctl.Client) *cobra.Command { if err != nil { return errors.Wrap(err, "failed to get epoch meta") } + if response.EpochData == nil { + return errors.New("ROLLDPOS is not registered") + } probationlist, err := getProbationList(client, epochNum, response.EpochData.Height) if err != nil { return errors.Wrap(err, "failed to get probation list") diff --git a/ioctl/newcmd/root.go b/ioctl/newcmd/root.go index c60cf08a96..021080c2db 100644 --- a/ioctl/newcmd/root.go +++ b/ioctl/newcmd/root.go @@ -12,6 +12,8 @@ import ( "github.com/iotexproject/iotex-core/ioctl" "github.com/iotexproject/iotex-core/ioctl/config" "github.com/iotexproject/iotex-core/ioctl/newcmd/account" + "github.com/iotexproject/iotex-core/ioctl/newcmd/bc" + "github.com/iotexproject/iotex-core/ioctl/newcmd/node" ) // Multi-language support @@ -47,6 +49,8 @@ func NewIoctl(client ioctl.Client) *cobra.Command { rootCmd.AddCommand(config.ConfigCmd) rootCmd.AddCommand(account.NewAccountCmd(client)) + rootCmd.AddCommand(bc.NewBCCmd(client)) + rootCmd.AddCommand(node.NewNodeCmd(client)) return rootCmd }