INNER CODE UNIT · Go

cid

sealerio/sealer · cmd/dist-receiver/main.go:102

	cid := icorepath.New(*cidArg)

	if err := node.Dht().Provide(ctx, cid); err != nil {
		fmt.Fprintf(os.Stderr, "Failed to seed the resource file: %s\n", err)
	}

	if err := node.Pin().Add(ctx, cid); err != nil {
		fmt.Fprintf(os.Stderr, "Failed to pin the resource file: %s\n", err)
	}

	rootNode, err := node.Unixfs().Get(ctx, cid)

	if err != nil {
		panic(fmt.Errorf("could not get file with CID: %s", err))
	}

	if err := files.WriteTo(rootNode, *fileName); err != nil {
		panic(fmt.Errorf("could not write out the fetched CID: %s", err))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…