package main import ( "fmt" "github.com/ipfs/go-ipfs/merkledag" ) func main() { node := merkledag.NewRawNode([]byte("hello world")) fmt.Println(node.Cid()) }
package main import ( "fmt" "github.com/ipfs/go-ipfs/merkledag" ) func main() { parentNode := merkledag.NewRawNode([]byte("parent")) childNode := merkledag.NewRawNode([]byte("hello world")) protoNode := &merkledag.ProtoNode{} protoNode.SetData([]byte{}) protoNode.AddNodeLink("child", childNode) parentNode.AddNodeLink("proto", protoNode) fmt.Println(parentNode.Cid()) }In both examples, the package library being used is the `go-ipfs` library, specifically the `github.com/ipfs/go-ipfs/merkledag` package.