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

remove query before deal #218

Open
wants to merge 1 commit into
base: no-query-ask
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions command/auto.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,16 @@ func (cmdAutoBidDeal *CmdAutoBidDeal) sendAutobidDeal(offlineDeal *libmodel.Offl
dealConfig.Duration = verifreg.MinimumVerifiedAllocationTerm
allocationId, err = boost.GetClient(cmdAutoBidDeal.SwanRepo).WithClient(lotusClient).AllocateDeal(&dealConfig)
} else {
dealCid, err = boost.GetClient(cmdAutoBidDeal.SwanRepo).WithClient(lotusClient).StartDeal(&dealConfig)
pieceSize, _ := utils.CalculatePieceSize(dealConfig.FileSize, true)
dealCid, err = boost.GetClient(cmdAutoBidDeal.SwanRepo).WithClient(lotusClient).StartDealDirect(pieceSize, big.Int{}, &dealConfig)
}
if err != nil {
logs.GetLogger().Error(err)
continue
}
} else {
lotusDealCid, err := lotusClient.LotusClientStartDeal(&dealConfig)
pieceSize, _ := utils.CalculatePieceSize(dealConfig.FileSize, false)
lotusDealCid, err := lotusClient.StartDeal(pieceSize, big.Int{}, &dealConfig)
if err != nil {
logs.GetLogger().Error("tried ", i+1, " times,", err)

Expand Down
7 changes: 5 additions & 2 deletions command/deal.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package command

import (
"fmt"
"math/big"
"path/filepath"
"strings"
"time"
Expand Down Expand Up @@ -269,11 +270,13 @@ func (cmdDeal *CmdDeal) sendDeals2Miner(taskName string, outputDir string, fileD
dealConfig.Duration = verifreg.MinimumVerifiedAllocationTerm
allocationId, err = boost.GetClient(cmdDeal.SwanRepo).WithClient(lotusClient).AllocateDeal(&dealConfig)
} else {
dealCid, err = boost.GetClient(cmdDeal.SwanRepo).WithClient(lotusClient).StartDeal(&dealConfig)
pieceSize, _ := utils.CalculatePieceSize(dealConfig.FileSize, true)
dealCid, err = boost.GetClient(cmdDeal.SwanRepo).WithClient(lotusClient).StartDealDirect(pieceSize, big.Int{}, &dealConfig)
}
} else {
var cidPtr *string
cidPtr, err = lotusClient.LotusClientStartDeal(&dealConfig)
pieceSize, _ := utils.CalculatePieceSize(dealConfig.FileSize, false)
cidPtr, err = lotusClient.StartDeal(pieceSize, big.Int{}, &dealConfig)
if err == nil {
dealCid = *cidPtr
dealInfo, err := lotusClient.LotusClientGetDealInfo(*cidPtr)
Expand Down