Merge pull request #887 from filecoin-project/feat/sector-size-cmd
add command to get sector size of a miner
This commit is contained in:
commit
5537cc3444
33
cli/state.go
33
cli/state.go
@ -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
|
||||
},
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user