Skip to content

experiment: http retrieval #495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ require (
github.com/multiformats/go-multiaddr v0.5.0
github.com/multiformats/go-multibase v0.0.3
github.com/multiformats/go-multihash v0.1.0
github.com/multiformats/go-varint v0.0.6
github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333
github.com/pressly/goose/v3 v3.5.3
github.com/prometheus/client_golang v1.11.0
Expand Down
33 changes: 14 additions & 19 deletions node/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,30 @@ import (
"fmt"
"time"

"github.com/filecoin-project/boost/indexprovider"
"github.com/filecoin-project/boost/storagemarket/dealfilter"

provider "github.com/filecoin-project/index-provider"
"github.com/filecoin-project/lotus/markets/idxprov"

"github.com/filecoin-project/boost/api"
"github.com/filecoin-project/boost/build"
"github.com/filecoin-project/boost/db"
"github.com/filecoin-project/boost/fundmanager"
"github.com/filecoin-project/boost/gql"
"github.com/filecoin-project/boost/indexprovider"
"github.com/filecoin-project/boost/node/config"
"github.com/filecoin-project/boost/node/impl"
"github.com/filecoin-project/boost/node/impl/common"
"github.com/filecoin-project/boost/node/impl/net"
"github.com/filecoin-project/boost/node/modules"
"github.com/filecoin-project/boost/node/modules/dtypes"
"github.com/filecoin-project/boost/retrieval"
"github.com/filecoin-project/boost/sealingpipeline"
"github.com/filecoin-project/boost/storagemanager"
"github.com/filecoin-project/boost/storagemarket"

"github.com/filecoin-project/boost/storagemarket/dealfilter"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network"
lotus_storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask"
"github.com/filecoin-project/go-state-types/abi"
provider "github.com/filecoin-project/index-provider"
lotus_api "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
lotus_sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage"
Expand All @@ -39,6 +42,7 @@ import (
_ "github.com/filecoin-project/lotus/lib/sigs/secp"
"github.com/filecoin-project/lotus/markets/dagstore"
lotus_dealfilter "github.com/filecoin-project/lotus/markets/dealfilter"
"github.com/filecoin-project/lotus/markets/idxprov"
"github.com/filecoin-project/lotus/markets/retrievaladapter"
"github.com/filecoin-project/lotus/markets/sectoraccessor"
lotus_storageadapter "github.com/filecoin-project/lotus/markets/storageadapter"
Expand All @@ -53,15 +57,8 @@ import (
"github.com/filecoin-project/lotus/storage"
"github.com/filecoin-project/lotus/storage/sectorblocks"
"github.com/filecoin-project/lotus/system"

"github.com/filecoin-project/go-fil-markets/retrievalmarket"
rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network"
lotus_storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"

logging "github.com/ipfs/go-log/v2"
"github.com/ipfs/go-metrics-interface"
ci "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
Expand All @@ -71,9 +68,6 @@ import (
"github.com/libp2p/go-libp2p-peerstore/pstoremem"
record "github.com/libp2p/go-libp2p-record"
"github.com/libp2p/go-libp2p/p2p/net/conngater"

logging "github.com/ipfs/go-log/v2"
"github.com/ipfs/go-metrics-interface"
"github.com/multiformats/go-multiaddr"
"go.uber.org/fx"
"golang.org/x/xerrors"
Expand Down Expand Up @@ -445,6 +439,7 @@ func ConfigBoost(c interface{}) Option {

// GraphQL server
Override(new(*gql.Server), modules.NewGraphqlServer(cfg)),
Override(new(*retrieval.HttpServer), modules.NewHttpRetrievalServer),

// Address selector
Override(new(*storage.AddressSelector), lotus_modules.AddressSelector(&lotus_config.MinerAddressConfig{
Expand Down
15 changes: 6 additions & 9 deletions node/impl/boost.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,25 @@ import (
"net/http"
"sort"

"github.com/filecoin-project/dagstore/shard"

"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"

"github.com/filecoin-project/boost/indexprovider"

"github.com/filecoin-project/boost/api"
"github.com/filecoin-project/boost/gql"
"github.com/filecoin-project/boost/indexprovider"
"github.com/filecoin-project/boost/retrieval"
"github.com/filecoin-project/boost/sealingpipeline"
"github.com/filecoin-project/boost/storagemarket"
"github.com/filecoin-project/boost/storagemarket/types"
"github.com/filecoin-project/dagstore"
"github.com/filecoin-project/dagstore/shard"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
lotus_storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-jsonrpc/auth"

lapi "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/markets/storageadapter"
lotus_dtypes "github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/storage/sectorblocks"

"github.com/google/uuid"
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p-core/host"
"go.uber.org/fx"
)
Expand Down Expand Up @@ -70,6 +66,7 @@ type BoostAPI struct {
// TODO: Figure out how to start graphql server without it needing
// to be a dependency of another fx object
GraphqlServer *gql.Server
HttpServer *retrieval.HttpServer

DS lotus_dtypes.MetadataDS

Expand Down
27 changes: 19 additions & 8 deletions node/modules/storageminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,25 @@ import (
"time"

"github.com/filecoin-project/boost/build"

"github.com/filecoin-project/go-fil-markets/shared"
"github.com/filecoin-project/go-state-types/crypto"
ctypes "github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/lib/sigs"

"github.com/filecoin-project/boost/indexprovider"

"github.com/filecoin-project/boost/db"
"github.com/filecoin-project/boost/fundmanager"
"github.com/filecoin-project/boost/gql"
"github.com/filecoin-project/boost/indexprovider"
"github.com/filecoin-project/boost/node/config"
"github.com/filecoin-project/boost/node/modules/dtypes"
"github.com/filecoin-project/boost/retrieval"
"github.com/filecoin-project/boost/sealingpipeline"
"github.com/filecoin-project/boost/storagemanager"
"github.com/filecoin-project/boost/storagemarket"
"github.com/filecoin-project/boost/storagemarket/lp2pimpl"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/shared"
lotus_storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/lotus/api/v1api"
ctypes "github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/lib/sigs"
"github.com/filecoin-project/lotus/markets/dagstore"
"github.com/filecoin-project/lotus/markets/storageadapter"
lotus_dtypes "github.com/filecoin-project/lotus/node/modules/dtypes"
Expand Down Expand Up @@ -401,3 +399,16 @@ func NewGraphqlServer(cfg *config.Boost) func(lc fx.Lifecycle, r repo.LockedRepo
return server
}
}

func NewHttpRetrievalServer(lc fx.Lifecycle, sa dagstore.SectorAccessor, ps lotus_dtypes.ProviderPieceStore, dagst *dagstore.Wrapper) *retrieval.HttpServer {
server := retrieval.NewHttpServer("/retrieve", sa, ps, dagst)

lc.Append(fx.Hook{
OnStart: server.Start,
OnStop: func(ctx context.Context) error {
return server.Stop()
},
})

return server
}
Loading