Merge pull request #1135 from filecoin-project/feat/listmsgs-cids

cli: state: --cids flag for list-messages
This commit is contained in:
Łukasz Magiera 2020-01-22 00:33:53 +01:00 committed by GitHub
commit 4310cc23ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -535,6 +535,10 @@ var stateListMessagesCmd = &cli.Command{
Name: "toheight",
Usage: "don't look before given block height",
},
&cli.BoolFlag{
Name: "cids",
Usage: "print message CIDs instead of messages",
},
},
Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx)
@ -575,6 +579,11 @@ var stateListMessagesCmd = &cli.Command{
}
for _, c := range msgs {
if cctx.Bool("cids") {
fmt.Println(c.String())
continue
}
m, err := api.ChainGetMessage(ctx, c)
if err != nil {
return err