override maddr for observability
This commit is contained in:
parent
3aaa4fb692
commit
2a050ca326
@ -62,6 +62,10 @@ func main() {
|
||||
Version: build.UserVersion(),
|
||||
EnableBashCompletion: true,
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "maddr",
|
||||
Value: "",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "repo",
|
||||
EnvVars: []string{"LOTUS_PATH"},
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/specs-actors/actors/abi"
|
||||
@ -53,6 +54,15 @@ var provingFaultsCmd = &cli.Command{
|
||||
return xerrors.Errorf("getting actor address: %w", err)
|
||||
}
|
||||
|
||||
// override maddr is specified
|
||||
if cctx.String("maddr") != "" {
|
||||
var err error
|
||||
maddr, err = address.NewFromString(cctx.String("maddr"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
var mas miner.State
|
||||
{
|
||||
mact, err := api.StateGetActor(ctx, maddr, types.EmptyTSK)
|
||||
@ -121,6 +131,15 @@ var provingInfoCmd = &cli.Command{
|
||||
return xerrors.Errorf("getting actor address: %w", err)
|
||||
}
|
||||
|
||||
// override maddr is specified
|
||||
if cctx.String("maddr") != "" {
|
||||
var err error
|
||||
maddr, err = address.NewFromString(cctx.String("maddr"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
head, err := api.ChainHead(ctx)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting chain head: %w", err)
|
||||
@ -244,6 +263,15 @@ var provingDeadlinesCmd = &cli.Command{
|
||||
return xerrors.Errorf("getting actor address: %w", err)
|
||||
}
|
||||
|
||||
// override maddr is specified
|
||||
if cctx.String("maddr") != "" {
|
||||
var err error
|
||||
maddr, err = address.NewFromString(cctx.String("maddr"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
deadlines, err := api.StateMinerDeadlines(ctx, maddr, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting deadlines: %w", err)
|
||||
|
Loading…
Reference in New Issue
Block a user