Skip to content
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

Support standalone miner-market process #6356

Merged
merged 106 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
a989f60
add SectorAddPieceToAny and SectorUnsealPiece to StorageMiner iface; …
nonsense May 19, 2021
87ed228
extract pushUrl and fix return type for worker RPC v0
nonsense May 19, 2021
e275b54
export PartialFile and OpenPartialFile
nonsense May 19, 2021
5540111
add UnpaddedByteIndex.Valid()
nonsense May 19, 2021
83e55dc
move handleProvingSector to correct file - states_proving.go
nonsense May 19, 2021
1295c92
confirm that Miner struct satisfies sectorblocks.SectorBuilder
nonsense May 19, 2021
2aad7b6
update sectorstorage.New (Manager) interface
nonsense May 20, 2021
2562f2e
add ReaderParamDecoder to json rpc server to lotus-miner run
nonsense May 20, 2021
c12d802
update reader to use ReadAtLeast
nonsense May 20, 2021
cb603c6
update retrievaladapter ; add piece_provider
nonsense May 20, 2021
76bb424
update StorageMinerAPI
nonsense May 20, 2021
4693c61
re-arrange NodeBuilder and add storageminer_svc
nonsense May 20, 2021
9092899
remove DealInfo and DealSchedule from storage-sealing gen/main.go
nonsense May 20, 2021
1a9b576
add remoteGetAllocated http handler
nonsense May 20, 2021
19bd5be
update remoteGetSector
nonsense May 20, 2021
9a7b0b6
comment
nonsense May 20, 2021
8d3d3c8
introduce init service, refactor restore service
nonsense May 20, 2021
9979de2
logs and defaults
nonsense May 26, 2021
c311520
add missing messagepool override
nonsense May 27, 2021
46a368d
bump api ver
nonsense May 27, 2021
d195a12
Merge branch 'master' into nonsense/split-market-miner-processes
nonsense May 31, 2021
e4136b0
add modules.StorageAuthWithURL to set correct token
nonsense Jun 1, 2021
0a79f49
fix tests
nonsense Jun 1, 2021
88756f3
fix TestAPIDeal tests
nonsense Jun 4, 2021
7f23480
make linter happy
nonsense Jun 4, 2021
c877166
add messagepool to test node constructor
nonsense Jun 4, 2021
8bd09e3
resolve merge conflicts
nonsense Jun 4, 2021
d9a7348
use masters filecoin-ffi
nonsense Jun 4, 2021
6f125cc
add prover to fullnode and miner builders
nonsense Jun 4, 2021
c4d10bc
apply messagepool.NewProviderLite to lite nodes
nonsense Jun 4, 2021
ed634bc
rebuild docs
nonsense Jun 4, 2021
ded5341
fixup test node builder
nonsense Jun 4, 2021
042ac82
testplans: lotus-soup: new images with filecoin-ffi ; use default WPo…
nonsense Jun 7, 2021
b0cb0c1
do not depend on filecoin-ffi in api package
nonsense Jun 7, 2021
de646a5
fix node builder
nonsense Jun 7, 2021
9f3ec82
initial resolution of conflicts
nonsense Jun 8, 2021
c0607a0
Merge branch 'master' into nonsense/split-market-miner-processes
nonsense Jun 8, 2021
4dd093b
fix piece provider test
nonsense Jun 8, 2021
3f5f96d
go mod tidy
nonsense Jun 8, 2021
30ba9a2
remove double http handler decl
nonsense Jun 8, 2021
9ab84bd
upgrade docsgen
nonsense Jun 8, 2021
beb5bff
fix log.Error; rename RemoteStore
nonsense Jun 9, 2021
31e6fb1
resolve conflicts
nonsense Jun 14, 2021
c0feb36
add missing debug
nonsense Jun 14, 2021
090a163
bump miner version apiv0
nonsense Jun 15, 2021
323c78e
comment for checkV1ApiSupport
nonsense Jun 15, 2021
d45bb14
Merge branch 'master' into nonsense/split-market-miner-processes
nonsense Jun 16, 2021
338bd04
Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-m…
nonsense Jun 17, 2021
89df3cc
Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-m…
nonsense Jun 18, 2021
577b730
wip
nonsense Jun 18, 2021
6720463
resolve merge conflicts
nonsense Jun 22, 2021
5e10d53
wip
nonsense Jun 22, 2021
0061867
policy.SetPreCommitChallengeDelay to reduce WaitSeed stage time
nonsense Jun 22, 2021
b0d1668
comment out preseal sectors
nonsense Jun 22, 2021
e656aad
regenerate docs
nonsense Jun 22, 2021
9567807
Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-m…
nonsense Jun 22, 2021
a828b15
revert MockSectorMgr
nonsense Jun 22, 2021
4f2d8b0
add all subsystems to deadlines and wdpost_dispute tests
nonsense Jun 22, 2021
218c919
fix testNonGenesisMiner
nonsense Jun 22, 2021
aa58447
fix paych and sdr tests
nonsense Jun 22, 2021
fc7feff
Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-m…
nonsense Jun 22, 2021
d98eca7
Merge branch 'raulk/itests-refactor-kit' into nonsense/split-market-m…
nonsense Jun 23, 2021
51a4657
fix SDR test
nonsense Jun 23, 2021
7fb93d4
refactor kit.NewDealHarness to include main miner and market node
nonsense Jun 23, 2021
99646d2
fix TestFirstDealEnablesMining
nonsense Jun 23, 2021
21b5132
adding TestDealWithMarketAndMinerNode
nonsense Jun 23, 2021
4217ec5
make auth on remote rpc server optional
nonsense Jun 23, 2021
a8d5ae5
enable more tests
nonsense Jun 23, 2021
9ec7cd7
enable libp2p options
nonsense Jun 24, 2021
4f0a96c
resolved conflicts
nonsense Jun 30, 2021
3aa6d03
connect miner to full node , only when running markets
nonsense Jun 30, 2021
1869de7
unwire host from storage.Miner.
raulk Jul 1, 2021
4194c7f
revert back optional for Miner; remove ActorAddress call in node.Mine…
nonsense Jul 2, 2021
96245c3
lint
nonsense Jul 2, 2021
9e85492
fix test
nonsense Jul 2, 2021
287e069
missing flag, that will need to be refactored
nonsense Jul 2, 2021
8dbae00
fix lotus-soup
nonsense Jul 2, 2021
724f728
enable more tests
nonsense Jul 2, 2021
ab6e01e
remove --enable-markets flag, read from repo
nonsense Jul 2, 2021
e9d0a25
remove redundant flag from docs
nonsense Jul 2, 2021
adba1a7
add missing err check
nonsense Jul 2, 2021
4be0a7a
resolve conflicts with master
nonsense Jul 5, 2021
5a87f04
fix finalize sectors early test
nonsense Jul 5, 2021
9839d57
fix SectorsStatus to query full node for on-chain data
nonsense Jul 6, 2021
ff2772a
resolved conflicts
nonsense Jul 6, 2021
604be5f
Update extern/sector-storage/stores/remote.go
nonsense Jul 6, 2021
8cf3acc
Update itests/kit/ensemble.go
nonsense Jul 6, 2021
898687e
Update node/modules/storageminer.go
nonsense Jul 6, 2021
10dc90f
addressing comments
nonsense Jul 6, 2021
b572c2b
fix IsUnsealed
nonsense Jul 6, 2021
7a78527
remove not used sa; cleanup
nonsense Jul 6, 2021
2a7af38
fix testServ to Start with correct listener
nonsense Jul 6, 2021
566a9d5
fix signature
nonsense Jul 6, 2021
42ae876
remove ApplyIfEnableLibP2P
nonsense Jul 7, 2021
caa366b
variadic WithSubsystems
nonsense Jul 7, 2021
6b014f5
pass Subsystems to StorageMiner option; add enableLibp2p bool in Sett…
nonsense Jul 7, 2021
1fe08f5
refactor testkit in lotus-soup to include Subsystems when instantiati…
nonsense Jul 7, 2021
bb466ed
fix cast on role_miner in testground lotus-soup plan
nonsense Jul 7, 2021
82efe01
fixup
nonsense Jul 7, 2021
16784aa
remove pieceProvider from DI; small refactors
nonsense Jul 12, 2021
d89ddb9
resolve conflicts
nonsense Jul 12, 2021
a423c46
rename mock.go to net.go
nonsense Jul 12, 2021
056136e
rename argument from url to apiInfo
nonsense Jul 12, 2021
4bc9fa0
rename cfg.Subsystems.EnableStorageMarket to EnableMarkets
nonsense Jul 12, 2021
7728d6b
remove --enable-markets flag; add --name string slice flag
nonsense Jul 12, 2021
2af02af
rename --name to --type; provide empty stores.StorageConfig when init…
nonsense Jul 13, 2021
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
Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
88 changes: 44 additions & 44 deletions cmd/lotus-storage-miner/init_restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,50 @@ import (
"github.com/filecoin-project/lotus/node/repo"
)

var restoreCmd = &cli.Command{
Name: "restore",
Usage: "Initialize a lotus miner repo from a backup",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "nosync",
Usage: "don't check full-node sync status",
},
&cli.StringFlag{
Name: "config",
Usage: "config file (config.toml)",
},
&cli.StringFlag{
Name: "storage-config",
Usage: "storage paths config (storage.json)",
},
},
ArgsUsage: "[backupFile]",
Action: func(cctx *cli.Context) error {
ctx := lcli.ReqContext(cctx)
log.Info("Initializing lotus miner using a backup")

if err := restore(ctx, cctx, nil, func(api lapi.FullNode, maddr address.Address, peerid peer.ID, mi miner.MinerInfo) error {
log.Info("Checking proof parameters")

if err := paramfetch.GetParams(ctx, build.ParametersJSON(), build.SrsJSON(), uint64(mi.SectorSize)); err != nil {
return xerrors.Errorf("fetching proof parameters: %w", err)
}

log.Info("Configuring miner actor")

if err := configureStorageMiner(ctx, api, maddr, peerid, big.Zero()); err != nil {
return err
}

return nil
}); err != nil {
return err
}

return nil
},
}

func restore(ctx context.Context, cctx *cli.Context, manageConfig func(*config.StorageMiner) error, after func(api lapi.FullNode, addr address.Address, peerid peer.ID, mi miner.MinerInfo) error) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I wasn't able to review this file because the diff is too noisy and I'm not familiar with this command. I trust @magik6k here.

if cctx.Args().Len() != 1 {
return xerrors.Errorf("expected 1 argument")
Expand Down Expand Up @@ -246,47 +290,3 @@ func restore(ctx context.Context, cctx *cli.Context, manageConfig func(*config.S

return after(api, maddr, peerid, mi)
}

var restoreCmd = &cli.Command{
Name: "restore",
Usage: "Initialize a lotus miner repo from a backup",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "nosync",
Usage: "don't check full-node sync status",
},
&cli.StringFlag{
Name: "config",
Usage: "config file (config.toml)",
},
&cli.StringFlag{
Name: "storage-config",
Usage: "storage paths config (storage.json)",
},
},
ArgsUsage: "[backupFile]",
Action: func(cctx *cli.Context) error {
ctx := lcli.ReqContext(cctx)
log.Info("Initializing lotus miner using a backup")

if err := restore(ctx, cctx, nil, func(api lapi.FullNode, maddr address.Address, peerid peer.ID, mi miner.MinerInfo) error {
log.Info("Checking proof parameters")

if err := paramfetch.GetParams(ctx, build.ParametersJSON(), build.SrsJSON(), uint64(mi.SectorSize)); err != nil {
return xerrors.Errorf("fetching proof parameters: %w", err)
}

log.Info("Configuring miner actor")

if err := configureStorageMiner(ctx, api, maddr, peerid, big.Zero()); err != nil {
return err
}

return nil
}); err != nil {
return err
}

return nil
},
}
90 changes: 55 additions & 35 deletions cmd/lotus-storage-miner/init_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,9 @@ import (
"golang.org/x/xerrors"
)

func checkApiInfo(ctx context.Context, ai string) (string, error) {
ai = strings.TrimPrefix(strings.TrimSpace(ai), "MINER_API_INFO=")
info := cliutil.ParseApiInfo(ai)
addr, err := info.DialArgs("v0")
if err != nil {
return "", xerrors.Errorf("could not get DialArgs: %w", err)
}

log.Infof("Checking api version of %s", addr)

api, closer, err := client.NewStorageMinerRPCV0(ctx, addr, info.AuthHeader())
if err != nil {
return "", err
}
defer closer()

v, err := api.Version(ctx)
if err != nil {
return "", xerrors.Errorf("checking version: %w", err)
}

if !v.APIVersion.EqMajorMinor(lapi.MinerAPIVersion0) {
return "", xerrors.Errorf("remote service API version didn't match (expected %s, remote %s)", lapi.MinerAPIVersion0, v.APIVersion)
}

return ai, nil
}
const (
MarketsService = "markets"
)

var serviceCmd = &cli.Command{
Name: "service",
Expand All @@ -63,12 +39,10 @@ var serviceCmd = &cli.Command{
Name: "nosync",
Usage: "don't check full-node sync status",
},

&cli.BoolFlag{
Name: "enable-market",
Usage: "enable market module",
&cli.StringSliceFlag{
Name: "name",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe type? lotus-miner init service --name markets ... looks a bit weild

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to type.

Usage: "services to be enabled",
},

&cli.StringFlag{
Name: "api-sealer",
Usage: "sealer API info (lotus-miner auth api-info --perm=admin)",
Expand All @@ -83,10 +57,17 @@ var serviceCmd = &cli.Command{
ctx := lcli.ReqContext(cctx)
log.Info("Initializing lotus miner service")

if !cctx.Bool("enable-market") {
es := EnabledServices(cctx.StringSlice("name"))

if len(es) == 0 {
return xerrors.Errorf("at least one module must be enabled")
}

// we should remove this as soon as we have more service types and not just `markets`
if !es.Contains(MarketsService) {
return xerrors.Errorf("markets module must be enabled")
}

if !cctx.IsSet("api-sealer") {
return xerrors.Errorf("--api-sealer is required without the sealer module enabled")
}
Expand All @@ -95,7 +76,7 @@ var serviceCmd = &cli.Command{
}

if err := restore(ctx, cctx, func(cfg *config.StorageMiner) error {
cfg.Subsystems.EnableStorageMarket = cctx.Bool("enable-market")
cfg.Subsystems.EnableMarkets = es.Contains(MarketsService)
cfg.Subsystems.EnableMining = false
cfg.Subsystems.EnableSealing = false
cfg.Subsystems.EnableSectorStorage = false
Expand All @@ -118,7 +99,7 @@ var serviceCmd = &cli.Command{

return nil
}, func(api lapi.FullNode, maddr address.Address, peerid peer.ID, mi miner.MinerInfo) error {
if cctx.Bool("enable-market") {
if es.Contains(MarketsService) {
log.Info("Configuring miner actor")

if err := configureStorageMiner(ctx, api, maddr, peerid, big.Zero()); err != nil {
Expand All @@ -134,3 +115,42 @@ var serviceCmd = &cli.Command{
return nil
},
}

type EnabledServices []string

func (es EnabledServices) Contains(name string) bool {
for _, s := range es {
if s == name {
return true
}
}
return false
}

func checkApiInfo(ctx context.Context, ai string) (string, error) {
ai = strings.TrimPrefix(strings.TrimSpace(ai), "MINER_API_INFO=")
info := cliutil.ParseApiInfo(ai)
addr, err := info.DialArgs("v0")
if err != nil {
return "", xerrors.Errorf("could not get DialArgs: %w", err)
}

log.Infof("Checking api version of %s", addr)

api, closer, err := client.NewStorageMinerRPCV0(ctx, addr, info.AuthHeader())
if err != nil {
return "", err
}
defer closer()

v, err := api.Version(ctx)
if err != nil {
return "", xerrors.Errorf("checking version: %w", err)
}

if !v.APIVersion.EqMajorMinor(lapi.MinerAPIVersion0) {
return "", xerrors.Errorf("remote service API version didn't match (expected %s, remote %s)", lapi.MinerAPIVersion0, v.APIVersion)
}

return ai, nil
}
2 changes: 1 addition & 1 deletion cmd/lotus-storage-miner/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var runCmd = &cli.Command{
return xerrors.Errorf("invalid config for repo, got: %T", c)
}

bootstrapLibP2P := cfg.Subsystems.EnableStorageMarket
bootstrapLibP2P := cfg.Subsystems.EnableMarkets

err = lr.Close()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion documentation/en/cli-lotus-miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ OPTIONS:
--config value config file (config.toml)
--storage-config value storage paths config (storage.json)
--nosync don't check full-node sync status (default: false)
--enable-market enable market module (default: false)
--name value services to be enabled
--api-sealer value sealer API info (lotus-miner auth api-info --perm=admin)
--api-sector-index value sector Index API info (lotus-miner auth api-info --perm=admin)
--help, -h show help (default: false)
Expand Down
1 change: 0 additions & 1 deletion extern/sector-storage/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,4 +723,3 @@ func (m *Manager) Close(ctx context.Context) error {

var _ Unsealer = &Manager{}
var _ SectorManager = &Manager{}
var _ Unsealer = &Manager{}
5 changes: 5 additions & 0 deletions itests/deals_publish_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ func TestPublishDealsBatching(t *testing.T) {
client, miner, ens := kit.EnsembleMinimal(t, kit.Account(publisherKey, types.FromFil(10)), kit.MockProofs(), kit.ConstructorOpts(opts))
ens.InterconnectAll().BeginMining(10 * time.Millisecond)

_, err = client.WalletImport(ctx, &publisherKey.KeyInfo)
require.NoError(t, err)

miner.SetControlAddresses(publisherKey.Address)

dh := kit.NewDealHarness(t, client, miner, miner)

// Starts a deal and waits until it's published
Expand Down
2 changes: 1 addition & 1 deletion itests/kit/ensemble.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func (n *Ensemble) Start() *Ensemble {
n.t.Fatalf("invalid config from repo, got: %T", c)
}
cfg.Common.API.RemoteListenAddress = m.RemoteListener.Addr().String()
cfg.Subsystems.EnableStorageMarket = m.options.subsystems.Has(SStorageMarket)
cfg.Subsystems.EnableMarkets = m.options.subsystems.Has(SMarkets)
cfg.Subsystems.EnableMining = m.options.subsystems.Has(SMining)
cfg.Subsystems.EnableSealing = m.options.subsystems.Has(SSealing)
cfg.Subsystems.EnableSectorStorage = m.options.subsystems.Has(SSectorStorage)
Expand Down
2 changes: 1 addition & 1 deletion itests/kit/ensemble_presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func EnsembleWithMinerAndMarketNodes(t *testing.T, opts ...interface{}) (*TestFu
ens := NewEnsemble(t, eopts...).FullNode(&fullnode, nopts...).Miner(&main, &fullnode, mainNodeOpts...).Start()
ens.BeginMining(blockTime)

marketNodeOpts := []NodeOpt{OwnerAddr(fullnode.DefaultKey), MainMiner(&main), WithSubsystems(SStorageMarket)}
marketNodeOpts := []NodeOpt{OwnerAddr(fullnode.DefaultKey), MainMiner(&main), WithSubsystems(SMarkets)}
marketNodeOpts = append(marketNodeOpts, nopts...)

ens.Miner(&market, &fullnode, marketNodeOpts...).Start().Connect(market, fullnode)
Expand Down
2 changes: 1 addition & 1 deletion itests/kit/node_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
type MinerSubsystem int

const (
SStorageMarket MinerSubsystem = 1 << iota
SMarkets MinerSubsystem = 1 << iota
SMining
SSealing
SSectorStorage
Expand Down
2 changes: 1 addition & 1 deletion itests/kit/node_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type NodeOpt func(opts *nodeOpts) error

func WithAllSubsystems() NodeOpt {
return func(opts *nodeOpts) error {
opts.subsystems = opts.subsystems.Add(SStorageMarket)
opts.subsystems = opts.subsystems.Add(SMarkets)
opts.subsystems = opts.subsystems.Add(SMining)
opts.subsystems = opts.subsystems.Add(SSealing)
opts.subsystems = opts.subsystems.Add(SSectorStorage)
Expand Down
6 changes: 3 additions & 3 deletions node/builder_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func ConfigStorageMiner(c interface{}) Option {
return Error(xerrors.New("retrieval pricing policy must be either default or external"))
}

enableLibp2pNode := cfg.Subsystems.EnableStorageMarket // we enable libp2p nodes if the storage market subsystem is enabled, otherwise we don't
enableLibp2pNode := cfg.Subsystems.EnableMarkets // we enable libp2p nodes if the storage market subsystem is enabled, otherwise we don't

return Options(
ConfigCommon(&cfg.Common, enableLibp2pNode),
Expand Down Expand Up @@ -127,7 +127,7 @@ func ConfigStorageMiner(c interface{}) Option {
Override(new(stores.SectorIndex), From(new(modules.MinerSealingService))),
),

If(cfg.Subsystems.EnableStorageMarket,
If(cfg.Subsystems.EnableMarkets,
// Markets
Override(new(dtypes.StagingMultiDstore), modules.StagingMultiDatastore),
Override(new(dtypes.StagingBlockstore), modules.StagingBlockstore),
Expand Down Expand Up @@ -209,7 +209,7 @@ func StorageMiner(out *api.StorageMiner, subsystemsCfg config.MinerSubsystemConf

func(s *Settings) error {
s.nodeType = repo.StorageMiner
s.enableLibp2pNode = subsystemsCfg.EnableStorageMarket
s.enableLibp2pNode = subsystemsCfg.EnableMarkets
return nil
},

Expand Down
4 changes: 2 additions & 2 deletions node/config/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type MinerSubsystemConfig struct {
EnableMining bool
EnableSealing bool
EnableSectorStorage bool
EnableStorageMarket bool
EnableMarkets bool

SealerApiInfo string // if EnableSealing == false
SectorIndexApiInfo string // if EnableSectorStorage == false
Expand Down Expand Up @@ -400,7 +400,7 @@ func DefaultStorageMiner() *StorageMiner {
EnableMining: true,
EnableSealing: true,
EnableSectorStorage: true,
EnableStorageMarket: true,
EnableMarkets: true,
},

Fees: MinerFeeConfig{
Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions node/modules/storageminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ func RetrievalProvider(
pieceStore dtypes.ProviderPieceStore,
mds dtypes.StagingMultiDstore,
nonsense marked this conversation as resolved.
Show resolved Hide resolved
dt dtypes.ProviderDataTransfer,
pieceProvider sectorstorage.PieceProvider,
pricingFnc dtypes.RetrievalPricingFunc,
userFilter dtypes.RetrievalDealFilter,
) (retrievalmarket.RetrievalProvider, error) {
Expand Down Expand Up @@ -727,11 +726,11 @@ func StorageAuth(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.Storage
return sectorstorage.StorageAuth(headers), nil
}

func StorageAuthWithURL(url string) func(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) {
func StorageAuthWithURL(apiInfo string) func(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) {
return func(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) {
s := strings.Split(url, ":")
s := strings.Split(apiInfo, ":")
if len(s) != 2 {
return nil, errors.New("unexpected format of URL")
return nil, errors.New("unexpected format of `apiInfo`")
}
headers := http.Header{}
headers.Add("Authorization", "Bearer "+s[0])
Expand Down