integrate client interface to allow for offline deals
This commit is contained in:
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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))
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user