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
+16 -1
View File
@@ -81,6 +81,12 @@ var clientLocalCmd = &cli.Command{
var clientDealCmd = &cli.Command{
Name: "deal",
Usage: "Initialize storage deal with a miner",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "manual-transfer",
Usage: "data will be transferred out of band",
},
},
Action: func(cctx *cli.Context) error {
api, closer, err := GetFullNodeAPI(cctx)
if err != nil {
@@ -119,7 +125,16 @@ var clientDealCmd = &cli.Command{
if err != nil {
return err
}
proposal, err := api.ClientStartDeal(ctx, data, a, miner, types.BigInt(price), uint64(dur))
ref := &storagemarket.DataRef{
TransferType: storagemarket.TTGraphsync,
Root: data,
}
if cctx.Bool("manual-transfer") {
ref.TransferType = storagemarket.TTManual
}
proposal, err := api.ClientStartDeal(ctx, ref, a, miner, types.BigInt(price), uint64(dur))
if err != nil {
return err
}