Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
remove boost detection helper
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign committed Apr 27, 2022
1 parent af78aa5 commit 4facc45
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 55 deletions.
21 changes: 0 additions & 21 deletions mocks/service/lotusclient/LotusClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 0 additions & 27 deletions service/lotusclient/lotusclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ type LotusClient interface {
HealthCheck() error
CurrentSealingSectors() (int, error)
ImportData(pcid cid.Cid, file string) error
IsRunningBoost() (bool, error)
}

// Client provides access to Lotus for importing deal data.
Expand Down Expand Up @@ -173,32 +172,6 @@ func (c *Client) ImportData(pcid cid.Cid, file string) error {
return nil
}

// IsRunningBoost detects if the storage provider is running Boost.
func (c *Client) IsRunningBoost() (bool, error) {
if c.fakeMode {
return false, nil
}

ctx, cls := context.WithTimeout(context.Background(), time.Second*10)
defer cls()
peerID, err := c.cmkt.ID(ctx)
if err != nil {
return false, fmt.Errorf("getting lotus market peer-id: %s", err)
}
pinfo, err := c.cmkt.NetPeerInfo(ctx, peerID)
if err != nil {
return false, fmt.Errorf("getting lotus market peer %s info: %s", peerID, err)
}

for _, p := range pinfo.Protocols {
if p == DealProtocolv120 {
return true, nil
}
}

return false, nil
}

type clientBuilder func(ctx context.Context) (*api.StorageMinerStruct, func(), error)

func newBuilder(maddrs string, authToken string, connRetries int) (clientBuilder, error) {
Expand Down
6 changes: 0 additions & 6 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,6 @@ func New(
}
fin.Add(commChannel)

isRunningBoost, err := lc.IsRunningBoost()
if err != nil {
return nil, fin.Cleanupf("detecting if storage-provider is running Boost: %s", err)
}
log.Infof("running-boost %v", isRunningBoost)

// Create bid store
s, err := bidstore.NewStore(
store,
Expand Down
1 change: 0 additions & 1 deletion service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ func newLotusClientMock() *lotusclientmocks.LotusClient {
mock.Anything,
mock.Anything,
).Return(nil)
lc.On("IsRunningBoost").Return(false, nil)
lc.On("Close").Return(nil)
return lc
}
Expand Down

0 comments on commit 4facc45

Please sign in to comment.