Skip to content

Commit

Permalink
fix(builder): use client blockstore for retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahhoward committed Dec 19, 2019
1 parent 2092035 commit 369a30d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion node/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func Online() Option {
Override(new(*discovery.Local), discovery.NewLocal),
Override(new(retrievalmarket.PeerResolver), modules.RetrievalResolver),

Override(new(retrievalmarket.RetrievalClient), retrievalimpl.NewClient),
Override(new(retrievalmarket.RetrievalClient), modules.RetrievalClient),
Override(new(dtypes.ClientDealStore), modules.NewClientDealStore),
Override(new(dtypes.ClientDataTransfer), modules.NewClientDAGServiceDataTransfer),
Override(new(*deals.ClientRequestValidator), deals.NewClientRequestValidator),
Expand Down
9 changes: 9 additions & 0 deletions node/modules/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (

"github.com/filecoin-project/lotus/lib/statestore"
"github.com/filecoin-project/lotus/node/modules/helpers"
"github.com/filecoin-project/lotus/paych"
retrievalmarket "github.com/filecoin-project/lotus/retrieval"
retrievalimpl "github.com/filecoin-project/lotus/retrieval/impl"
"github.com/ipfs/go-bitswap"
"github.com/ipfs/go-bitswap/network"
graphsync "github.com/ipfs/go-graphsync/impl"
Expand All @@ -26,6 +29,7 @@ import (

"github.com/filecoin-project/go-data-transfer/impl/graphsync"
"github.com/filecoin-project/lotus/chain/deals"
payapi "github.com/filecoin-project/lotus/node/impl/paych"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/repo"
)
Expand Down Expand Up @@ -97,3 +101,8 @@ func ClientGraphsync(mctx helpers.MetricsCtx, lc fx.Lifecycle, ibs dtypes.Client

return gs
}

// RetrievalClient creates a new retrieval client attached to the client blockstore
func RetrievalClient(h host.Host, bs dtypes.ClientBlockstore, pmgr *paych.Manager, payapi payapi.PaychAPI) retrievalmarket.RetrievalClient {
return retrievalimpl.NewClient(h, bs, pmgr, payapi)
}

0 comments on commit 369a30d

Please sign in to comment.