From 8f160d3046fd342cb6da8f2917a2715173e738e4 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 13 Oct 2023 16:03:26 +0200 Subject: [PATCH] fix fetcher initialization --- setup.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.go b/setup.go index 866cfbc..bf7a319 100644 --- a/setup.go +++ b/setup.go @@ -29,6 +29,8 @@ 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/libp2p/go-libp2p" dht "github.com/libp2p/go-libp2p-kad-dht" "github.com/libp2p/go-libp2p-kad-dht/fullrt" @@ -295,7 +297,9 @@ func Setup(ctx context.Context, cfg Config) (*Node, error) { } ns = nopfsipfs.WrapNameSystem(ns, blocker) - fetcher := bsfetcher.NewFetcherConfig(bsrv) + fetcherCfg := bsfetcher.NewFetcherConfig(bsrv) + fetcherCfg.PrototypeChooser = dagpb.AddSupportToChooser(bsfetcher.DefaultPrototypeChooser) + fetcher := fetcherCfg.WithReifier(unixfsnode.Reify) r := resolver.NewBasicResolver(fetcher) r = nopfsipfs.WrapResolver(r, blocker)