Skip to content

Commit

Permalink
cid -> bytes command
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenGround0 committed Jan 17, 2023
1 parent 14d921f commit 8eb1e5b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cmd/lotus-shed/cid.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ var cidCmd = &cli.Command{
cidIdCmd,
inspectBundleCmd,
cborCid,
cidBytes,
},
}

var cidBytes = &cli.Command{
Name: "cbor",
Usage: "cid bytes",
ArgsUsage: "[cid]",
Action: func(cctx *cli.Context) error {
c, err := cid.Decode(cctx.Args().First())
if err != nil {
return err
}
fmt.Printf("%x\n", c.Bytes())
return nil
},
}

Expand Down

0 comments on commit 8eb1e5b

Please sign in to comment.