lotus/cmd/lotus-shed/commp.go
2020-04-15 14:01:00 -04:00

18 lines
374 B
Go

package main
import (
"fmt"
commcid "github.com/filecoin-project/go-fil-commcid"
"gopkg.in/urfave/cli.v2"
)
var commpToCidCmd = &cli.Command{
Name: "commp-to-cid",
Description: "Convert a raw commP to a piece-Cid",
Action: func(cctx *cli.Context) error {
cp := []byte(cctx.Args().Get(0))
fmt.Println(commcid.PieceCommitmentV1ToCID(cp))
return nil
},
}