WS JsonRPC client
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@ func getAPI(ctx *cli.Context) (api.API, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return client.NewRPC("http://" + addr + "/rpc/v0"), nil
|
||||
return client.NewRPC("ws://" + addr + "/rpc/v0")
|
||||
}
|
||||
|
||||
// reqContext returns context for cli execution. Calling it for the first time
|
||||
|
||||
+11
-2
@@ -1,16 +1,25 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"gopkg.in/urfave/cli.v2"
|
||||
)
|
||||
|
||||
var versionCmd = &cli.Command{
|
||||
Name: "version",
|
||||
Usage: "Print version",
|
||||
Action: func(context *cli.Context) error {
|
||||
Action: func(cctx *cli.Context) error {
|
||||
api, err := getAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ctx := reqContext(cctx)
|
||||
// TODO: print more useful things
|
||||
|
||||
cli.VersionPrinter(context)
|
||||
fmt.Println(api.Version(ctx))
|
||||
cli.VersionPrinter(cctx)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user