Add a shed command to turn raw commPs into CIDs
This commit is contained in:
parent
efd435d763
commit
c0204cdd83
17
cmd/lotus-shed/commp.go
Normal file
17
cmd/lotus-shed/commp.go
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
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
|
||||||
|
},
|
||||||
|
}
|
@ -23,6 +23,7 @@ func main() {
|
|||||||
bigIntParseCmd,
|
bigIntParseCmd,
|
||||||
staterootStatsCmd,
|
staterootStatsCmd,
|
||||||
importCarCmd,
|
importCarCmd,
|
||||||
|
commpToCidCmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
app := &cli.App{
|
app := &cli.App{
|
||||||
|
Loading…
Reference in New Issue
Block a user