basecli refactor

This commit is contained in:
rigelrozanski
2018-03-01 02:36:57 +00:00
parent 94948746a0
commit 65f27f2daa
12 changed files with 123 additions and 80 deletions
+4 -3
View File
@@ -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 -3
View File
@@ -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
+4 -3
View File
@@ -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 {