add command to get sector size of a miner

This commit is contained in:
whyrusleeping 2019-12-12 12:31:22 +01:00
parent a8734ad481
commit 42074ff041
2 changed files with 34 additions and 1 deletions

View File

@ -24,6 +24,7 @@ var stateCmd = &cli.Command{
stateGetActorCmd,
stateLookupIDCmd,
stateReplaySetCmd,
stateSectorSizeCmd,
},
}
@ -334,3 +335,35 @@ var stateLookupIDCmd = &cli.Command{
return nil
},
}
var stateSectorSizeCmd = &cli.Command{
Name: "sector-size",
Usage: "Look up miners sector size",
Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx)
if err != nil {
return err
}
defer closer()
ctx := ReqContext(cctx)
if !cctx.Args().Present() {
return fmt.Errorf("must pass address of actor to get")
}
addr, err := address.NewFromString(cctx.Args().First())
if err != nil {
return err
}
ssize, err := api.StateMinerSectorSize(ctx, addr, nil)
if err != nil {
return err
}
fmt.Printf("%d\n", ssize)
return nil
},
}

View File

@ -270,7 +270,7 @@ func (m *Miner) mineOne(ctx context.Context, addr address.Address, base *MiningB
return nil, nil
}
log.Infof("Time delta between now and our mining base: %ds", uint64(time.Now().Unix())-base.ts.MinTimestamp())
log.Infof("Time delta between now and our mining base: %ds (nulls: %d)", uint64(time.Now().Unix())-base.ts.MinTimestamp(), base.nullRounds)
ticket, err := m.computeTicket(ctx, addr, base)
if err != nil {