shed: Support miner nodes in rpc util

This commit is contained in:
Łukasz Magiera 2021-02-04 20:06:00 +01:00
parent 9b65793509
commit ebfde330dd

View File

@ -24,9 +24,18 @@ import (
var rpcCmd = &cli.Command{ var rpcCmd = &cli.Command{
Name: "rpc", Name: "rpc",
Usage: "Interactive JsonPRC shell", Usage: "Interactive JsonPRC shell",
// TODO: flag for miner/worker Flags: []cli.Flag{
&cli.BoolFlag{
Name: "miner",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
addr, headers, err := lcli.GetRawAPI(cctx, repo.FullNode) rt := repo.FullNode
if cctx.Bool("miner") {
rt = repo.StorageMiner
}
addr, headers, err := lcli.GetRawAPI(cctx, rt)
if err != nil { if err != nil {
return err return err
} }