diff --git a/cli/cmd.go b/cli/cmd.go index 1bf73792e..ee964efbe 100644 --- a/cli/cmd.go +++ b/cli/cmd.go @@ -61,7 +61,6 @@ func reqContext(cctx *cli.Context) context.Context { var Commands = []*cli.Command{ chainCmd, clientCmd, - idCmd, minerCmd, mpoolCmd, netCmd, diff --git a/cli/id.go b/cli/id.go deleted file mode 100644 index 2e68664e3..000000000 --- a/cli/id.go +++ /dev/null @@ -1,28 +0,0 @@ -package cli - -import ( - "fmt" - - "gopkg.in/urfave/cli.v2" -) - -var idCmd = &cli.Command{ - Name: "id", - Usage: "Get node identity", - Action: func(cctx *cli.Context) error { - api, err := getAPI(cctx) - if err != nil { - return err - } - - ctx := reqContext(cctx) - - pid, err := api.ID(ctx) - if err != nil { - return err - } - - fmt.Println(pid) - return nil - }, -} diff --git a/cli/net.go b/cli/net.go index a46a48200..a5660d404 100644 --- a/cli/net.go +++ b/cli/net.go @@ -19,6 +19,7 @@ var netCmd = &cli.Command{ netPeers, netConnect, netListen, + netId, }, } @@ -95,6 +96,27 @@ var netConnect = &cli.Command{ }, } +var netId = &cli.Command{ + Name: "id", + Usage: "Get node identity", + Action: func(cctx *cli.Context) error { + api, err := getAPI(cctx) + if err != nil { + return err + } + + ctx := reqContext(cctx) + + pid, err := api.ID(ctx) + if err != nil { + return err + } + + fmt.Println(pid) + return nil + }, +} + // parseAddresses is a function that takes in a slice of string peer addresses // (multiaddr + peerid) and returns a slice of properly constructed peers func parseAddresses(ctx context.Context, addrs []string) ([]peer.AddrInfo, error) {