integrate client interface to allow for offline deals

This commit is contained in:
whyrusleeping
2020-03-03 16:18:08 -08:00
parent 0025b3c1dc
commit 99c842e027
12 changed files with 134 additions and 67 deletions
+4 -1
View File
@@ -302,7 +302,10 @@ func migratePreSealMeta(ctx context.Context, api lapi.FullNode, metadata string,
ClientDealProposal: sector.Deal,
ProposalCid: pnd.Cid(),
State: storagemarket.StorageDealActive,
DealID: sector.,
Ref: &storagemarket.DataRef{Root: proposalCid}, // TODO: This is super wrong, but there
// are no params for CommP CIDs, we can't recover unixfs cid easily,
// and this isn't even used after the deal enters Complete state
DealID: dealID,
},
}
+3 -2
View File
@@ -22,11 +22,12 @@ func main() {
lotuslog.SetupLogLevels()
local := []*cli.Command{
runCmd,
initCmd,
infoCmd,
initCmd,
pledgeSectorCmd,
runCmd,
sectorsCmd,
setPriceCmd,
}
jaeger := tracing.SetupJaegerTracing("lotus")
defer func() {
+35
View File
@@ -0,0 +1,35 @@
package main
import (
"fmt"
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
"gopkg.in/urfave/cli.v2"
)
var setPriceCmd = &cli.Command{
Name: "set-price",
Usage: "Set price that miner will accept storage deals at",
Flags: []cli.Flag{},
Action: func(cctx *cli.Context) error {
api, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil {
return err
}
defer closer()
ctx := lcli.DaemonContext(cctx)
if !cctx.Args().Present() {
return fmt.Errorf("must specify price to set")
}
fp, err := types.ParseFIL(cctx.Args().First())
if err != nil {
return err
}
return api.SetPrice(ctx, types.BigInt(fp))
},
}