basecli refactor
This commit is contained in:
+4
-3
@@ -5,7 +5,6 @@ import (
|
||||
"strconv"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
tmwire "github.com/tendermint/tendermint/wire"
|
||||
@@ -43,8 +42,10 @@ func getBlock(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
// get the node
|
||||
uri := viper.GetString(client.FlagNode)
|
||||
node := client.GetNode(uri)
|
||||
node, err := client.GetNode()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO: actually honor the --select flag!
|
||||
// header -> BlockchainInfo
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
tmwire "github.com/tendermint/tendermint/wire"
|
||||
@@ -22,8 +21,10 @@ func statusCommand() *cobra.Command {
|
||||
|
||||
func checkStatus(cmd *cobra.Command, args []string) error {
|
||||
// get the node
|
||||
uri := viper.GetString(client.FlagNode)
|
||||
node := client.GetNode(uri)
|
||||
node, err := client.GetNode()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
res, err := node.Status()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"strconv"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
tmwire "github.com/tendermint/tendermint/wire"
|
||||
@@ -38,8 +37,10 @@ func getValidators(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
// get the node
|
||||
uri := viper.GetString(client.FlagNode)
|
||||
node := client.GetNode(uri)
|
||||
node, err := client.GetNode()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
res, err := node.Validators(height)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user