market utils: Support unixfsnode in TraverseDag

This commit is contained in:
Łukasz Magiera 2022-02-22 10:48:47 +01:00
parent 6123aa2ed4
commit a05a462c8c
2 changed files with 3 additions and 0 deletions

1
go.mod
View File

@ -100,6 +100,7 @@ require (
github.com/ipfs/go-metrics-prometheus v0.0.2
github.com/ipfs/go-path v0.0.7
github.com/ipfs/go-unixfs v0.3.1
github.com/ipfs/go-unixfsnode v1.2.0
github.com/ipfs/interface-go-ipfs-core v0.4.0
github.com/ipld/go-car v0.3.3
github.com/ipld/go-car/v2 v2.1.1

View File

@ -11,6 +11,7 @@ import (
"github.com/ipfs/go-cid"
mdagipld "github.com/ipfs/go-ipld-format"
"github.com/ipfs/go-unixfsnode"
dagpb "github.com/ipld/go-codec-dagpb"
"github.com/ipld/go-ipld-prime"
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
@ -62,6 +63,7 @@ func TraverseDag(
return bytes.NewBuffer(node.RawData()), nil
}
unixfsnode.AddUnixFSReificationToLinkSystem(&linkSystem)
// this is how we pull the start node out of the DS
startLink := cidlink.Link{Cid: startFrom}