package node import ( blockstore "gitlab.dms3.io/dms3/go-dms3-blockstore" "gitlab.dms3.io/dms3/go-graphsync" gsimpl "gitlab.dms3.io/dms3/go-graphsync/impl" "gitlab.dms3.io/dms3/go-graphsync/network" "gitlab.dms3.io/dms3/go-graphsync/storeutil" p2p "gitlab.dms3.io/p2p/go-p2p-core" "go.uber.org/fx" "gitlab.dms3.io/dms3/go-dms3/core/node/helpers" ) // Graphsync constructs a graphsync func Graphsync(lc fx.Lifecycle, mctx helpers.MetricsCtx, host p2p.Host, bs blockstore.GCBlockstore) graphsync.GraphExchange { ctx := helpers.LifecycleCtx(mctx, lc) network := network.NewFromP2pHost(host) return gsimpl.New(ctx, network, storeutil.LinkSystemForBlockstore(bs), ) }