Skip to content

Commit

Permalink
No need to set the Reifier in the fetcher as it is the default already
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanjuan committed Oct 12, 2023
1 parent 3c69a94 commit 70d5202
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ import (
levelds "github.com/ipfs/go-ds-leveldb"
metri "github.com/ipfs/go-metrics-interface"
mprome "github.com/ipfs/go-metrics-prometheus"
"github.com/ipfs/go-unixfsnode"
dagpb "github.com/ipld/go-codec-dagpb"
"github.com/ipld/go-ipld-prime"
"github.com/ipld/go-ipld-prime/node/basicnode"
"github.com/ipld/go-ipld-prime/schema"
"github.com/libp2p/go-libp2p"
dht "github.com/libp2p/go-libp2p-kad-dht"
"github.com/libp2p/go-libp2p-kad-dht/fullrt"
Expand Down Expand Up @@ -300,14 +295,7 @@ func Setup(ctx context.Context, cfg Config) (*Node, error) {
}
ns = nopfsipfs.WrapNameSystem(ns, blocker)

fetcherConfig := bsfetcher.NewFetcherConfig(bsrv)
fetcherConfig.PrototypeChooser = dagpb.AddSupportToChooser(func(lnk ipld.Link, lnkCtx ipld.LinkContext) (ipld.NodePrototype, error) {
if tlnkNd, ok := lnkCtx.LinkNode.(schema.TypedLinkNode); ok {
return tlnkNd.LinkTargetNodePrototype(), nil
}
return basicnode.Prototype.Any, nil
})
fetcher := fetcherConfig.WithReifier(unixfsnode.Reify)
fetcher := bsfetcher.NewFetcherConfig(bsrv)
r := resolver.NewBasicResolver(fetcher)
r = nopfsipfs.WrapResolver(r, blocker)

Expand Down

0 comments on commit 70d5202

Please sign in to comment.