From 96b45931e56fcec4898210dccad7725858f02f23 Mon Sep 17 00:00:00 2001 From: aarshkshah1992 Date: Thu, 16 May 2024 10:11:41 +0530 Subject: [PATCH 1/6] remove client CLI --- cli/clicommands/cmd.go | 1 - cli/client.go | 2468 ---------------------------------------- 2 files changed, 2469 deletions(-) delete mode 100644 cli/client.go diff --git a/cli/clicommands/cmd.go b/cli/clicommands/cmd.go index a37ce329acc..791a11927d7 100644 --- a/cli/clicommands/cmd.go +++ b/cli/clicommands/cmd.go @@ -10,7 +10,6 @@ var Commands = []*cli.Command{ lcli.WithCategory("basic", lcli.SendCmd), lcli.WithCategory("basic", lcli.WalletCmd), lcli.WithCategory("basic", lcli.InfoCmd), - lcli.WithCategory("basic", lcli.ClientCmd), lcli.WithCategory("basic", lcli.MultisigCmd), lcli.WithCategory("basic", lcli.FilplusCmd), lcli.WithCategory("basic", lcli.PaychCmd), diff --git a/cli/client.go b/cli/client.go deleted file mode 100644 index e40a6686679..00000000000 --- a/cli/client.go +++ /dev/null @@ -1,2468 +0,0 @@ -package cli - -import ( - "bufio" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "math" - "math/rand" - "os" - "path/filepath" - "sort" - "strconv" - "strings" - "sync" - "sync/atomic" - "text/tabwriter" - "time" - - tm "github.com/buger/goterm" - "github.com/chzyer/readline" - "github.com/docker/go-units" - "github.com/fatih/color" - "github.com/ipfs/go-cid" - "github.com/ipfs/go-cidutil/cidenc" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/multiformats/go-multibase" - "github.com/urfave/cli/v2" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - - "github.com/filecoin-project/lotus/api" - lapi "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/api/v0api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/actors/builtin" - "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/tablewriter" - "github.com/filecoin-project/lotus/node/repo/imports" -) - -var CidBaseFlag = cli.StringFlag{ - Name: "cid-base", - Hidden: true, - Value: "base32", - Usage: "Multibase encoding used for version 1 CIDs in output.", - DefaultText: "base32", -} - -// GetCidEncoder returns an encoder using the `cid-base` flag if provided, or -// the default (Base32) encoder if not. -func GetCidEncoder(cctx *cli.Context) (cidenc.Encoder, error) { - val := cctx.String("cid-base") - - e := cidenc.Encoder{Base: multibase.MustNewEncoder(multibase.Base32)} - - if val != "" { - var err error - e.Base, err = multibase.EncoderByName(val) - if err != nil { - return e, err - } - } - - return e, nil -} - -var ClientCmd = &cli.Command{ - Name: "client", - Usage: "Make deals, store data, retrieve data", - Subcommands: []*cli.Command{ - WithCategory("storage", clientDealCmd), - WithCategory("storage", clientQueryAskCmd), - WithCategory("storage", clientListDeals), - WithCategory("storage", clientGetDealCmd), - WithCategory("storage", clientListAsksCmd), - WithCategory("storage", clientDealStatsCmd), - WithCategory("storage", clientInspectDealCmd), - WithCategory("data", clientImportCmd), - WithCategory("data", clientDropCmd), - WithCategory("data", clientLocalCmd), - WithCategory("data", clientStat), - WithCategory("retrieval", clientFindCmd), - WithCategory("retrieval", clientQueryRetrievalAskCmd), - WithCategory("retrieval", clientRetrieveCmd), - WithCategory("retrieval", clientRetrieveCatCmd), - WithCategory("retrieval", clientRetrieveLsCmd), - WithCategory("retrieval", clientCancelRetrievalDealCmd), - WithCategory("retrieval", clientListRetrievalsCmd), - WithCategory("util", clientCommPCmd), - WithCategory("util", clientCarGenCmd), - WithCategory("util", clientBalancesCmd), - WithCategory("util", clientListTransfers), - WithCategory("util", clientRestartTransfer), - WithCategory("util", clientCancelTransfer), - }, -} - -var clientImportCmd = &cli.Command{ - Name: "import", - Usage: "Import data", - ArgsUsage: "[inputPath]", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "car", - Usage: "import from a car file instead of a regular file", - }, - &cli.BoolFlag{ - Name: "quiet", - Aliases: []string{"q"}, - Usage: "Output root CID only", - }, - &CidBaseFlag, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - absPath, err := filepath.Abs(cctx.Args().First()) - if err != nil { - return err - } - - ref := lapi.FileRef{ - Path: absPath, - IsCAR: cctx.Bool("car"), - } - c, err := api.ClientImport(ctx, ref) - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - if !cctx.Bool("quiet") { - fmt.Printf("Import %d, Root ", c.ImportID) - } - fmt.Println(encoder.Encode(c.Root)) - - return nil - }, -} - -var clientDropCmd = &cli.Command{ - Name: "drop", - Usage: "Remove import", - ArgsUsage: "[import ID...]", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - var ids []uint64 - for i, s := range cctx.Args().Slice() { - id, err := strconv.ParseUint(s, 10, 64) - if err != nil { - return xerrors.Errorf("parsing %d-th import ID: %w", i, err) - } - - ids = append(ids, id) - } - - for _, id := range ids { - if err := api.ClientRemoveImport(ctx, imports.ID(id)); err != nil { - return xerrors.Errorf("removing import %d: %w", id, err) - } - } - - return nil - }, -} - -var clientCommPCmd = &cli.Command{ - Name: "commP", - Usage: "Calculate the piece-cid (commP) of a CAR file", - ArgsUsage: "[inputFile]", - Flags: []cli.Flag{ - &CidBaseFlag, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - ret, err := api.ClientCalcCommP(ctx, cctx.Args().Get(0)) - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - fmt.Println("CID: ", encoder.Encode(ret.Root)) - fmt.Println("Piece size: ", types.SizeStr(types.NewInt(uint64(ret.Size)))) - fmt.Println("Piece size in bytes: ", types.NewInt(uint64(ret.Size))) - return nil - }, -} - -var clientCarGenCmd = &cli.Command{ - Name: "generate-car", - Usage: "Generate a car file from input", - ArgsUsage: "[inputPath outputPath]", - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - if cctx.NArg() != 2 { - return IncorrectNumArgs(cctx) - } - - ref := lapi.FileRef{ - Path: cctx.Args().First(), - IsCAR: false, - } - - op := cctx.Args().Get(1) - - if err = api.ClientGenCar(ctx, ref, op); err != nil { - return err - } - return nil - }, -} - -var clientLocalCmd = &cli.Command{ - Name: "local", - Usage: "List locally imported data", - Flags: []cli.Flag{ - &CidBaseFlag, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - list, err := api.ClientListImports(ctx) - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - sort.Slice(list, func(i, j int) bool { - return list[i].Key < list[j].Key - }) - - for _, v := range list { - cidStr := "" - if v.Root != nil { - cidStr = encoder.Encode(*v.Root) - } - - fmt.Printf("%d: %s @%s (%s)\n", v.Key, cidStr, v.FilePath, v.Source) - if v.Err != "" { - fmt.Printf("\terror: %s\n", v.Err) - } - } - return nil - }, -} - -var clientDealCmd = &cli.Command{ - Name: "deal", - Usage: "Initialize storage deal with a miner", - Description: `Make a deal with a miner. -dataCid comes from running 'lotus client import'. -miner is the address of the miner you wish to make a deal with. -price is measured in FIL/Epoch. Miners usually don't accept a bid -lower than their advertised ask (which is in FIL/GiB/Epoch). You can check a miners listed price -with 'lotus client query-ask '. -duration is how long the miner should store the data for, in blocks. -The minimum value is 518400 (6 months).`, - ArgsUsage: "[dataCid miner price duration]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "manual-piece-cid", - Usage: "manually specify piece commitment for data (dataCid must be to a car file)", - }, - &cli.Int64Flag{ - Name: "manual-piece-size", - Usage: "if manually specifying piece cid, used to specify size (dataCid must be to a car file)", - }, - &cli.BoolFlag{ - Name: "manual-stateless-deal", - Usage: "instructs the node to send an offline deal without registering it with the deallist/fsm", - }, - &cli.StringFlag{ - Name: "from", - Usage: "specify address to fund the deal with", - }, - &cli.Int64Flag{ - Name: "start-epoch", - Usage: "specify the epoch that the deal should start at", - Value: -1, - }, - &cli.BoolFlag{ - Name: "fast-retrieval", - Usage: "indicates that data should be available for fast retrieval", - Value: true, - }, - &cli.BoolFlag{ - Name: "verified-deal", - Usage: "indicate that the deal counts towards verified client total", - DefaultText: "true if client is verified, false otherwise", - }, - &cli.StringFlag{ - Name: "provider-collateral", - Usage: "specify the requested provider collateral the miner should put up", - }, - &CidBaseFlag, - }, - Action: func(cctx *cli.Context) error { - - expectedArgsMsg := "expected 4 args: dataCid, miner, price, duration" - - if !cctx.Args().Present() { - if cctx.Bool("manual-stateless-deal") { - return xerrors.New("--manual-stateless-deal can not be combined with interactive deal mode: you must specify the " + expectedArgsMsg) - } - return interactiveDeal(cctx) - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - afmt := NewAppFmt(cctx.App) - - if cctx.NArg() != 4 { - return IncorrectNumArgs(cctx) - } - - // [data, miner, price, dur] - - data, err := cid.Parse(cctx.Args().Get(0)) - if err != nil { - return err - } - - miner, err := address.NewFromString(cctx.Args().Get(1)) - if err != nil { - return err - } - - price, err := types.ParseFIL(cctx.Args().Get(2)) - if err != nil { - return err - } - - dur, err := strconv.ParseInt(cctx.Args().Get(3), 10, 32) - if err != nil { - return err - } - - var provCol big.Int - if pcs := cctx.String("provider-collateral"); pcs != "" { - pc, err := big.FromString(pcs) - if err != nil { - return fmt.Errorf("failed to parse provider-collateral: %w", err) - } - provCol = pc - } - - if abi.ChainEpoch(dur) < build.MinDealDuration { - return xerrors.Errorf("minimum deal duration is %d blocks", build.MinDealDuration) - } - if abi.ChainEpoch(dur) > build.MaxDealDuration { - return xerrors.Errorf("maximum deal duration is %d blocks", build.MaxDealDuration) - } - - var a address.Address - if from := cctx.String("from"); from != "" { - faddr, err := address.NewFromString(from) - if err != nil { - return xerrors.Errorf("failed to parse 'from' address: %w", err) - } - a = faddr - } else { - def, err := api.WalletDefaultAddress(ctx) - if err != nil { - return err - } - a = def - } - - ref := &storagemarket.DataRef{ - TransferType: storagemarket.TTGraphsync, - Root: data, - } - - if mpc := cctx.String("manual-piece-cid"); mpc != "" { - c, err := cid.Parse(mpc) - if err != nil { - return xerrors.Errorf("failed to parse provided manual piece cid: %w", err) - } - - ref.PieceCid = &c - - psize := cctx.Int64("manual-piece-size") - if psize == 0 { - return xerrors.Errorf("must specify piece size when manually setting cid") - } - - ref.PieceSize = abi.UnpaddedPieceSize(psize) - - ref.TransferType = storagemarket.TTManual - } - - // Check if the address is a verified client - dcap, err := api.StateVerifiedClientStatus(ctx, a, types.EmptyTSK) - if err != nil { - return err - } - - isVerified := dcap != nil - - // If the user has explicitly set the --verified-deal flag - if cctx.IsSet("verified-deal") { - // If --verified-deal is true, but the address is not a verified - // client, return an error - verifiedDealParam := cctx.Bool("verified-deal") - if verifiedDealParam && !isVerified { - return xerrors.Errorf("address %s does not have verified client status", a) - } - - // Override the default - isVerified = verifiedDealParam - } - - sdParams := &lapi.StartDealParams{ - Data: ref, - Wallet: a, - Miner: miner, - EpochPrice: types.BigInt(price), - MinBlocksDuration: uint64(dur), - DealStartEpoch: abi.ChainEpoch(cctx.Int64("start-epoch")), - FastRetrieval: cctx.Bool("fast-retrieval"), - VerifiedDeal: isVerified, - ProviderCollateral: provCol, - } - - var proposal *cid.Cid - if cctx.Bool("manual-stateless-deal") { - if ref.TransferType != storagemarket.TTManual || price.Int64() != 0 { - return xerrors.New("when manual-stateless-deal is enabled, you must also provide a 'price' of 0 and specify 'manual-piece-cid' and 'manual-piece-size'") - } - proposal, err = api.ClientStatelessDeal(ctx, sdParams) - } else { - proposal, err = api.ClientStartDeal(ctx, sdParams) - } - - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - afmt.Println(encoder.Encode(*proposal)) - - return nil - }, -} - -func interactiveDeal(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPIV1(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - ctx, cancel := context.WithCancel(ctx) - defer cancel() - afmt := NewAppFmt(cctx.App) - - state := "import" - gib := types.NewInt(1 << 30) - - var data cid.Cid - var days int - var maddrs []address.Address - var ask []storagemarket.StorageAsk - var epochPrices []big.Int - var dur time.Duration - var epochs abi.ChainEpoch - var verified bool - var ds lapi.DataCIDSize - - // find - var candidateAsks []QueriedAsk - var budget types.FIL - var dealCount int64 - var medianPing, maxAcceptablePing time.Duration - - var a address.Address - if from := cctx.String("from"); from != "" { - faddr, err := address.NewFromString(from) - if err != nil { - return xerrors.Errorf("failed to parse 'from' address: %w", err) - } - a = faddr - } else { - def, err := api.WalletDefaultAddress(ctx) - if err != nil { - return err - } - a = def - } - - if _, err := api.StateGetActor(ctx, a, types.EmptyTSK); err != nil { - return xerrors.Errorf("address not initialized on chain: %w", err) - } - - fromBal, err := api.WalletBalance(ctx, a) - if err != nil { - return xerrors.Errorf("checking from address balance: %w", err) - } - - printErr := func(err error) { - afmt.Printf("%s %s\n", color.RedString("Error:"), err.Error()) - } - - cs := readline.NewCancelableStdin(afmt.Stdin) - go func() { - <-ctx.Done() - _ = cs.Close() - }() - - rl := bufio.NewReader(cs) - -uiLoop: - for { - // TODO: better exit handling - if err := ctx.Err(); err != nil { - return err - } - - switch state { - case "import": - afmt.Print("Data CID (from " + color.YellowString("lotus client import") + "): ") - - _cidStr, _, err := rl.ReadLine() - cidStr := string(_cidStr) - if err != nil { - printErr(xerrors.Errorf("reading cid string: %w", err)) - continue - } - - data, err = cid.Parse(cidStr) - if err != nil { - printErr(xerrors.Errorf("parsing cid string: %w", err)) - continue - } - - color.Blue(".. calculating data size\n") - ds, err = api.ClientDealPieceCID(ctx, data) - if err != nil { - return err - } - - state = "duration" - case "duration": - afmt.Print("Deal duration (days): ") - - _daystr, _, err := rl.ReadLine() - daystr := string(_daystr) - if err != nil { - return err - } - - _, err = fmt.Sscan(daystr, &days) - if err != nil { - printErr(xerrors.Errorf("parsing duration: %w", err)) - continue - } - - minDealDurationDays := uint64(build.MinDealDuration) / (builtin.SecondsInDay / build.BlockDelaySecs) - if days < int(minDealDurationDays) { - printErr(xerrors.Errorf("minimum duration is %d days, got %d", minDealDurationDays, days)) - continue - } - - maxDealDurationDays := uint64(build.MaxDealDuration) / (builtin.SecondsInDay / build.BlockDelaySecs) - if days > int(maxDealDurationDays) { - printErr(xerrors.Errorf("maximum duration is %d days, got %d", maxDealDurationDays, days)) - continue - } - - dur = 24 * time.Hour * time.Duration(days) - epochs = abi.ChainEpoch(dur / (time.Duration(build.BlockDelaySecs) * time.Second)) - - state = "verified" - case "verified": - ts, err := api.ChainHead(ctx) - if err != nil { - return err - } - - dcap, err := api.StateVerifiedClientStatus(ctx, a, ts.Key()) - if err != nil { - return err - } - - if dcap == nil { - state = "miner" - continue - } - - if dcap.Uint64() < uint64(ds.PieceSize) { - color.Yellow(".. not enough DataCap available for a verified deal\n") - state = "miner" - continue - } - - afmt.Print("\nMake this a verified deal? (yes/no): ") - - _yn, _, err := rl.ReadLine() - yn := string(_yn) - if err != nil { - return err - } - - switch yn { - case "yes": - verified = true - case "no": - verified = false - default: - afmt.Println("Type in full 'yes' or 'no'") - continue - } - - state = "miner" - case "miner": - maddrs = maddrs[:0] - ask = ask[:0] - afmt.Print("Miner Addresses (f0.. f0..), none to find: ") - - _maddrsStr, _, err := rl.ReadLine() - maddrsStr := string(_maddrsStr) - if err != nil { - printErr(xerrors.Errorf("reading miner address: %w", err)) - continue - } - - for _, s := range strings.Fields(maddrsStr) { - maddr, err := address.NewFromString(strings.TrimSpace(s)) - if err != nil { - printErr(xerrors.Errorf("parsing miner address: %w", err)) - continue uiLoop - } - - maddrs = append(maddrs, maddr) - } - - state = "query" - if len(maddrs) == 0 { - state = "find" - } - case "find": - asks, err := GetAsks(ctx, api) - if err != nil { - return err - } - - if len(asks) == 0 { - printErr(xerrors.Errorf("no asks found")) - continue uiLoop - } - - medianPing = asks[len(asks)/2].Ping - var avgPing time.Duration - for _, ask := range asks { - avgPing += ask.Ping - } - avgPing /= time.Duration(len(asks)) - - for _, ask := range asks { - if ask.Ask.MinPieceSize > ds.PieceSize { - continue - } - if ask.Ask.MaxPieceSize < ds.PieceSize { - continue - } - candidateAsks = append(candidateAsks, ask) - } - - afmt.Printf("Found %d candidate asks\n", len(candidateAsks)) - afmt.Printf("Average network latency: %s; Median latency: %s\n", avgPing.Truncate(time.Millisecond), medianPing.Truncate(time.Millisecond)) - state = "max-ping" - case "max-ping": - maxAcceptablePing = medianPing - - afmt.Printf("Maximum network latency (default: %s) (ms): ", maxAcceptablePing.Truncate(time.Millisecond)) - _latStr, _, err := rl.ReadLine() - latStr := string(_latStr) - if err != nil { - printErr(xerrors.Errorf("reading maximum latency: %w", err)) - continue - } - - if latStr != "" { - maxMs, err := strconv.ParseInt(latStr, 10, 64) - if err != nil { - printErr(xerrors.Errorf("parsing FIL: %w", err)) - continue uiLoop - } - - maxAcceptablePing = time.Millisecond * time.Duration(maxMs) - } - - var goodAsks []QueriedAsk - for _, candidateAsk := range candidateAsks { - if candidateAsk.Ping < maxAcceptablePing { - goodAsks = append(goodAsks, candidateAsk) - } - } - - if len(goodAsks) == 0 { - afmt.Printf("no asks left after filtering for network latency\n") - continue uiLoop - } - - afmt.Printf("%d asks left after filtering for network latency\n", len(goodAsks)) - candidateAsks = goodAsks - - state = "find-budget" - case "find-budget": - afmt.Printf("Proposing from %s, Current Balance: %s\n", a, types.FIL(fromBal)) - afmt.Print("Maximum budget (FIL): ") // TODO: Propose some default somehow? - - _budgetStr, _, err := rl.ReadLine() - budgetStr := string(_budgetStr) - if err != nil { - printErr(xerrors.Errorf("reading miner address: %w", err)) - continue - } - - budget, err = types.ParseFIL(budgetStr) - if err != nil { - printErr(xerrors.Errorf("parsing FIL: %w", err)) - continue uiLoop - } - - var goodAsks []QueriedAsk - for _, ask := range candidateAsks { - p := ask.Ask.Price - if verified { - p = ask.Ask.VerifiedPrice - } - - epochPrice := types.BigDiv(types.BigMul(p, types.NewInt(uint64(ds.PieceSize))), gib) - totalPrice := types.BigMul(epochPrice, types.NewInt(uint64(epochs))) - - if totalPrice.LessThan(abi.TokenAmount(budget)) { - goodAsks = append(goodAsks, ask) - } - } - candidateAsks = goodAsks - afmt.Printf("%d asks within budget\n", len(candidateAsks)) - state = "find-count" - case "find-count": - afmt.Print("Deals to make (1): ") - dealcStr, _, err := rl.ReadLine() - if err != nil { - printErr(xerrors.Errorf("reading deal count: %w", err)) - continue - } - - dealCount, err = strconv.ParseInt(string(dealcStr), 10, 64) - if err != nil { - printErr(xerrors.Errorf("reading deal count: invalid number")) - continue - } - - color.Blue(".. Picking miners") - - // TODO: some better strategy (this tries to pick randomly) - var pickedAsks []*storagemarket.StorageAsk - pickLoop: - for i := 0; i < 64; i++ { - rand.Shuffle(len(candidateAsks), func(i, j int) { - candidateAsks[i], candidateAsks[j] = candidateAsks[j], candidateAsks[i] - }) - - remainingBudget := abi.TokenAmount(budget) - pickedAsks = []*storagemarket.StorageAsk{} - - for _, ask := range candidateAsks { - p := ask.Ask.Price - if verified { - p = ask.Ask.VerifiedPrice - } - - epochPrice := types.BigDiv(types.BigMul(p, types.NewInt(uint64(ds.PieceSize))), gib) - totalPrice := types.BigMul(epochPrice, types.NewInt(uint64(epochs))) - - if totalPrice.GreaterThan(remainingBudget) { - continue - } - - pickedAsks = append(pickedAsks, ask.Ask) - remainingBudget = big.Sub(remainingBudget, totalPrice) - - if len(pickedAsks) == int(dealCount) { - break pickLoop - } - } - } - - for _, pickedAsk := range pickedAsks { - maddrs = append(maddrs, pickedAsk.Miner) - ask = append(ask, *pickedAsk) - } - - state = "confirm" - case "query": - color.Blue(".. querying miner asks") - - for _, maddr := range maddrs { - mi, err := api.StateMinerInfo(ctx, maddr, types.EmptyTSK) - if err != nil { - printErr(xerrors.Errorf("failed to get peerID for miner: %w", err)) - state = "miner" - continue uiLoop - } - - a, err := api.ClientQueryAsk(ctx, *mi.PeerId, maddr) - if err != nil { - printErr(xerrors.Errorf("failed to query ask for miner %s: %w", maddr.String(), err)) - state = "miner" - continue uiLoop - } - - ask = append(ask, *a.Response) - } - - // TODO: run more validation - state = "confirm" - case "confirm": - // TODO: do some more or epochs math (round to miner PP, deal start buffer) - - afmt.Printf("-----\n") - afmt.Printf("Proposing from %s\n", a) - afmt.Printf("\tBalance: %s\n", types.FIL(fromBal)) - afmt.Printf("\n") - afmt.Printf("Piece size: %s (Payload size: %s)\n", units.BytesSize(float64(ds.PieceSize)), units.BytesSize(float64(ds.PayloadSize))) - afmt.Printf("Duration: %s\n", dur) - - pricePerGib := big.Zero() - for _, a := range ask { - p := a.Price - if verified { - p = a.VerifiedPrice - } - pricePerGib = big.Add(pricePerGib, p) - epochPrice := types.BigDiv(types.BigMul(p, types.NewInt(uint64(ds.PieceSize))), gib) - epochPrices = append(epochPrices, epochPrice) - - mpow, err := api.StateMinerPower(ctx, a.Miner, types.EmptyTSK) - if err != nil { - return xerrors.Errorf("getting power (%s): %w", a.Miner, err) - } - - if len(ask) > 1 { - totalPrice := types.BigMul(epochPrice, types.NewInt(uint64(epochs))) - afmt.Printf("Miner %s (Power:%s) price: ~%s (%s per epoch)\n", color.YellowString(a.Miner.String()), color.GreenString(types.SizeStr(mpow.MinerPower.QualityAdjPower)), color.BlueString(types.FIL(totalPrice).String()), types.FIL(epochPrice)) - } - } - - // TODO: price is based on PaddedPieceSize, right? - epochPrice := types.BigDiv(types.BigMul(pricePerGib, types.NewInt(uint64(ds.PieceSize))), gib) - totalPrice := types.BigMul(epochPrice, types.NewInt(uint64(epochs))) - - afmt.Printf("Total price: ~%s (%s per epoch)\n", color.CyanString(types.FIL(totalPrice).String()), types.FIL(epochPrice)) - afmt.Printf("Verified: %v\n", verified) - - state = "accept" - case "accept": - afmt.Print("\nAccept (yes/no): ") - - _yn, _, err := rl.ReadLine() - yn := string(_yn) - if err != nil { - return err - } - - if yn == "no" { - return nil - } - - if yn != "yes" { - afmt.Println("Type in full 'yes' or 'no'") - continue - } - - state = "execute" - case "execute": - color.Blue(".. executing\n") - - for i, maddr := range maddrs { - proposal, err := api.ClientStartDeal(ctx, &lapi.StartDealParams{ - Data: &storagemarket.DataRef{ - TransferType: storagemarket.TTGraphsync, - Root: data, - - PieceCid: &ds.PieceCID, - PieceSize: ds.PieceSize.Unpadded(), - }, - Wallet: a, - Miner: maddr, - EpochPrice: epochPrices[i], - MinBlocksDuration: uint64(epochs), - DealStartEpoch: abi.ChainEpoch(cctx.Int64("start-epoch")), - FastRetrieval: cctx.Bool("fast-retrieval"), - VerifiedDeal: verified, - }) - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - afmt.Printf("Deal (%s) CID: %s\n", maddr, color.GreenString(encoder.Encode(*proposal))) - } - - return nil - default: - return xerrors.Errorf("unknown state: %s", state) - } - } -} - -var clientFindCmd = &cli.Command{ - Name: "find", - Usage: "Find data in the network", - ArgsUsage: "[dataCid]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "pieceCid", - Usage: "require data to be retrieved from a specific Piece CID", - }, - }, - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - file, err := cid.Parse(cctx.Args().First()) - if err != nil { - return err - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - // Check if we already have this data locally - - has, err := api.ClientHasLocal(ctx, file) - if err != nil { - return err - } - - if has { - fmt.Println("LOCAL") - } - - var pieceCid *cid.Cid - if cctx.String("pieceCid") != "" { - parsed, err := cid.Parse(cctx.String("pieceCid")) - if err != nil { - return err - } - pieceCid = &parsed - } - - offers, err := api.ClientFindData(ctx, file, pieceCid) - if err != nil { - return err - } - - for _, offer := range offers { - if offer.Err != "" { - fmt.Printf("ERR %s@%s: %s\n", offer.Miner, offer.MinerPeer.ID, offer.Err) - continue - } - fmt.Printf("RETRIEVAL %s@%s-%s-%s\n", offer.Miner, offer.MinerPeer.ID, types.FIL(offer.MinPrice), types.SizeStr(types.NewInt(offer.Size))) - } - - return nil - }, -} - -var clientQueryRetrievalAskCmd = &cli.Command{ - Name: "retrieval-ask", - Usage: "Get a miner's retrieval ask", - ArgsUsage: "[minerAddress] [data CID]", - Flags: []cli.Flag{ - &cli.Int64Flag{ - Name: "size", - Usage: "data size in bytes", - }, - }, - Action: func(cctx *cli.Context) error { - afmt := NewAppFmt(cctx.App) - if cctx.NArg() != 2 { - return IncorrectNumArgs(cctx) - } - - maddr, err := address.NewFromString(cctx.Args().First()) - if err != nil { - return err - } - - dataCid, err := cid.Parse(cctx.Args().Get(1)) - if err != nil { - return fmt.Errorf("parsing data cid: %w", err) - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - ask, err := api.ClientMinerQueryOffer(ctx, maddr, dataCid, nil) - if err != nil { - return err - } - - afmt.Printf("Ask: %s\n", maddr) - afmt.Printf("Unseal price: %s\n", types.FIL(ask.UnsealPrice)) - afmt.Printf("Price per byte: %s\n", types.FIL(ask.PricePerByte)) - afmt.Printf("Payment interval: %s\n", types.SizeStr(types.NewInt(ask.PaymentInterval))) - afmt.Printf("Payment interval increase: %s\n", types.SizeStr(types.NewInt(ask.PaymentIntervalIncrease))) - - size := cctx.Uint64("size") - if size == 0 { - if ask.Size == 0 { - return nil - } - size = ask.Size - afmt.Printf("Size: %s\n", types.SizeStr(types.NewInt(ask.Size))) - } - transferPrice := types.BigMul(ask.PricePerByte, types.NewInt(size)) - totalPrice := types.BigAdd(ask.UnsealPrice, transferPrice) - afmt.Printf("Total price for %d bytes: %s\n", size, types.FIL(totalPrice)) - - return nil - }, -} - -var clientListRetrievalsCmd = &cli.Command{ - Name: "list-retrievals", - Usage: "List retrieval market deals", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - Usage: "print verbose deal details", - }, - &cli.BoolFlag{ - Name: "show-failed", - Usage: "show failed/failing deals", - Value: true, - }, - &cli.BoolFlag{ - Name: "completed", - Usage: "show completed retrievals", - }, - &cli.BoolFlag{ - Name: "watch", - Usage: "watch deal updates in real-time, rather than a one time list", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - verbose := cctx.Bool("verbose") - watch := cctx.Bool("watch") - showFailed := cctx.Bool("show-failed") - completed := cctx.Bool("completed") - - localDeals, err := api.ClientListRetrievals(ctx) - if err != nil { - return err - } - - if watch { - updates, err := api.ClientGetRetrievalUpdates(ctx) - if err != nil { - return err - } - - for { - tm.Clear() - tm.MoveCursor(1, 1) - - err = outputRetrievalDeals(ctx, tm.Screen, localDeals, verbose, showFailed, completed) - if err != nil { - return err - } - - tm.Flush() - - select { - case <-ctx.Done(): - return nil - case updated := <-updates: - var found bool - for i, existing := range localDeals { - if existing.ID == updated.ID { - localDeals[i] = updated - found = true - break - } - } - if !found { - localDeals = append(localDeals, updated) - } - } - } - } - - return outputRetrievalDeals(ctx, cctx.App.Writer, localDeals, verbose, showFailed, completed) - }, -} - -func isTerminalError(status retrievalmarket.DealStatus) bool { - // should patch this in go-fil-markets but to solve the problem immediate and not have buggy output - return retrievalmarket.IsTerminalError(status) || status == retrievalmarket.DealStatusErrored || status == retrievalmarket.DealStatusCancelled -} -func outputRetrievalDeals(ctx context.Context, out io.Writer, localDeals []lapi.RetrievalInfo, verbose bool, showFailed bool, completed bool) error { - var deals []api.RetrievalInfo - for _, deal := range localDeals { - if !showFailed && isTerminalError(deal.Status) { - continue - } - if !completed && retrievalmarket.IsTerminalSuccess(deal.Status) { - continue - } - deals = append(deals, deal) - } - - tableColumns := []tablewriter.Column{ - tablewriter.Col("PayloadCID"), - tablewriter.Col("DealId"), - tablewriter.Col("Provider"), - tablewriter.Col("Status"), - tablewriter.Col("PricePerByte"), - tablewriter.Col("Received"), - tablewriter.Col("TotalPaid"), - } - - if verbose { - tableColumns = append(tableColumns, - tablewriter.Col("PieceCID"), - tablewriter.Col("UnsealPrice"), - tablewriter.Col("BytesPaidFor"), - tablewriter.Col("TransferChannelID"), - tablewriter.Col("TransferStatus"), - ) - } - tableColumns = append(tableColumns, tablewriter.NewLineCol("Message")) - - w := tablewriter.New(tableColumns...) - - for _, d := range deals { - w.Write(toRetrievalOutput(d, verbose)) - } - - return w.Flush(out) -} - -func toRetrievalOutput(d api.RetrievalInfo, verbose bool) map[string]interface{} { - - payloadCID := d.PayloadCID.String() - provider := d.Provider.String() - if !verbose { - payloadCID = ellipsis(payloadCID, 8) - provider = ellipsis(provider, 8) - } - - retrievalOutput := map[string]interface{}{ - "PayloadCID": payloadCID, - "DealId": d.ID, - "Provider": provider, - "Status": retrievalStatusString(d.Status), - "PricePerByte": types.FIL(d.PricePerByte), - "Received": units.BytesSize(float64(d.BytesReceived)), - "TotalPaid": types.FIL(d.TotalPaid), - "Message": d.Message, - } - - if verbose { - transferChannelID := "" - if d.TransferChannelID != nil { - transferChannelID = d.TransferChannelID.String() - } - transferStatus := "" - if d.DataTransfer != nil { - transferStatus = datatransfer.Statuses[d.DataTransfer.Status] - } - pieceCID := "" - if d.PieceCID != nil { - pieceCID = d.PieceCID.String() - } - - retrievalOutput["PieceCID"] = pieceCID - retrievalOutput["UnsealPrice"] = types.FIL(d.UnsealPrice) - retrievalOutput["BytesPaidFor"] = units.BytesSize(float64(d.BytesPaidFor)) - retrievalOutput["TransferChannelID"] = transferChannelID - retrievalOutput["TransferStatus"] = transferStatus - } - return retrievalOutput -} - -func retrievalStatusString(status retrievalmarket.DealStatus) string { - s := retrievalmarket.DealStatuses[status] - - switch { - case isTerminalError(status): - return color.RedString(s) - case retrievalmarket.IsTerminalSuccess(status): - return color.GreenString(s) - default: - return s - } -} - -var clientInspectDealCmd = &cli.Command{ - Name: "inspect-deal", - Usage: "Inspect detailed information about deal's lifecycle and the various stages it goes through", - Flags: []cli.Flag{ - &cli.IntFlag{ - Name: "deal-id", - }, - &cli.StringFlag{ - Name: "proposal-cid", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := ReqContext(cctx) - return inspectDealCmd(ctx, api, cctx.String("proposal-cid"), cctx.Int("deal-id")) - }, -} - -var clientDealStatsCmd = &cli.Command{ - Name: "deal-stats", - Usage: "Print statistics about local storage deals", - Flags: []cli.Flag{ - &cli.DurationFlag{ - Name: "newer-than", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - localDeals, err := api.ClientListDeals(ctx) - if err != nil { - return err - } - - var totalSize uint64 - byState := map[storagemarket.StorageDealStatus][]uint64{} - for _, deal := range localDeals { - if cctx.IsSet("newer-than") { - if time.Now().Sub(deal.CreationTime) > cctx.Duration("newer-than") { - continue - } - } - - totalSize += deal.Size - byState[deal.State] = append(byState[deal.State], deal.Size) - } - - fmt.Printf("Total: %d deals, %s\n", len(localDeals), types.SizeStr(types.NewInt(totalSize))) - - type stateStat struct { - state storagemarket.StorageDealStatus - count int - bytes uint64 - } - - stateStats := make([]stateStat, 0, len(byState)) - for state, deals := range byState { - if state == storagemarket.StorageDealActive { - state = math.MaxUint64 // for sort - } - - st := stateStat{ - state: state, - count: len(deals), - } - for _, b := range deals { - st.bytes += b - } - - stateStats = append(stateStats, st) - } - - sort.Slice(stateStats, func(i, j int) bool { - return int64(stateStats[i].state) < int64(stateStats[j].state) - }) - - for _, st := range stateStats { - if st.state == math.MaxUint64 { - st.state = storagemarket.StorageDealActive - } - fmt.Printf("%s: %d deals, %s\n", storagemarket.DealStates[st.state], st.count, types.SizeStr(types.NewInt(st.bytes))) - } - - return nil - }, -} - -var clientListAsksCmd = &cli.Command{ - Name: "list-asks", - Usage: "List asks for top miners", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "by-ping", - Usage: "sort by ping", - }, - &cli.StringFlag{ - Name: "output-format", - Value: "text", - Usage: "Either 'text' or 'csv'", - }, - &cli.BoolFlag{ - Name: "protocols", - Usage: "Output supported deal protocols", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPIV1(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - asks, err := GetAsks(ctx, api) - if err != nil { - return err - } - - if cctx.Bool("by-ping") { - sort.Slice(asks, func(i, j int) bool { - return asks[i].Ping < asks[j].Ping - }) - } - pfmt := "%s: min:%s max:%s price:%s/GiB/Epoch verifiedPrice:%s/GiB/Epoch ping:%s protos:%s\n" - if cctx.String("output-format") == "csv" { - fmt.Printf("Miner,Min,Max,Price,VerifiedPrice,Ping,Protocols") - pfmt = "%s,%s,%s,%s,%s,%s,%s\n" - } - - for _, a := range asks { - ask := a.Ask - - protos := "" - if cctx.Bool("protocols") { - protos = "[" + strings.Join(a.DealProtocols, ",") + "]" - } - - fmt.Printf(pfmt, ask.Miner, - types.SizeStr(types.NewInt(uint64(ask.MinPieceSize))), - types.SizeStr(types.NewInt(uint64(ask.MaxPieceSize))), - types.FIL(ask.Price), - types.FIL(ask.VerifiedPrice), - a.Ping, - protos, - ) - } - - return nil - }, -} - -type QueriedAsk struct { - Ask *storagemarket.StorageAsk - DealProtocols []string - - Ping time.Duration -} - -func GetAsks(ctx context.Context, api lapi.FullNode) ([]QueriedAsk, error) { - isTTY := true - if fileInfo, _ := os.Stdout.Stat(); (fileInfo.Mode() & os.ModeCharDevice) == 0 { - isTTY = false - } - if isTTY { - color.Blue(".. getting miner list") - } - miners, err := api.StateListMiners(ctx, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("getting miner list: %w", err) - } - - var lk sync.Mutex - var found int64 - var withMinPower []address.Address - done := make(chan struct{}) - - go func() { - defer close(done) - - var wg sync.WaitGroup - wg.Add(len(miners)) - - throttle := make(chan struct{}, 50) - for _, miner := range miners { - throttle <- struct{}{} - go func(miner address.Address) { - defer wg.Done() - defer func() { - <-throttle - }() - - power, err := api.StateMinerPower(ctx, miner, types.EmptyTSK) - if err != nil { - return - } - - if power.HasMinPower { // TODO: Lower threshold - atomic.AddInt64(&found, 1) - lk.Lock() - withMinPower = append(withMinPower, miner) - lk.Unlock() - } - }(miner) - } - - wg.Wait() - }() - -loop: - for { - select { - case <-time.After(150 * time.Millisecond): - if isTTY { - fmt.Printf("\r* Found %d miners with power", atomic.LoadInt64(&found)) - } - case <-done: - break loop - } - } - if isTTY { - fmt.Printf("\r* Found %d miners with power\n", atomic.LoadInt64(&found)) - - color.Blue(".. querying asks") - } - - var asks []QueriedAsk - var queried, got int64 - - done = make(chan struct{}) - go func() { - defer close(done) - - var wg sync.WaitGroup - wg.Add(len(withMinPower)) - - throttle := make(chan struct{}, 50) - for _, miner := range withMinPower { - throttle <- struct{}{} - go func(miner address.Address) { - defer wg.Done() - defer func() { - <-throttle - atomic.AddInt64(&queried, 1) - }() - - ctx, cancel := context.WithTimeout(ctx, 4*time.Second) - defer cancel() - - mi, err := api.StateMinerInfo(ctx, miner, types.EmptyTSK) - if err != nil { - return - } - if mi.PeerId == nil { - return - } - - ask, err := api.ClientQueryAsk(ctx, *mi.PeerId, miner) - if err != nil { - return - } - - rt := time.Now() - _, err = api.ClientQueryAsk(ctx, *mi.PeerId, miner) - if err != nil { - return - } - pingDuration := time.Now().Sub(rt) - - atomic.AddInt64(&got, 1) - lk.Lock() - asks = append(asks, QueriedAsk{ - Ask: ask.Response, - DealProtocols: ask.DealProtocols, - - Ping: pingDuration, - }) - lk.Unlock() - }(miner) - } - - wg.Wait() - }() - -loop2: - for { - select { - case <-time.After(150 * time.Millisecond): - if isTTY { - fmt.Printf("\r* Queried %d asks, got %d responses", atomic.LoadInt64(&queried), atomic.LoadInt64(&got)) - } - case <-done: - break loop2 - } - } - if isTTY { - fmt.Printf("\r* Queried %d asks, got %d responses\n", atomic.LoadInt64(&queried), atomic.LoadInt64(&got)) - } - - sort.Slice(asks, func(i, j int) bool { - return asks[i].Ask.Price.LessThan(asks[j].Ask.Price) - }) - - return asks, nil -} - -var clientQueryAskCmd = &cli.Command{ - Name: "query-ask", - Usage: "Find a miners ask", - ArgsUsage: "[minerAddress]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "peerid", - Usage: "specify peer ID of node to make query against", - }, - &cli.Int64Flag{ - Name: "size", - Usage: "data size in bytes", - }, - &cli.Int64Flag{ - Name: "duration", - Usage: "deal duration", - }, - }, - Action: func(cctx *cli.Context) error { - afmt := NewAppFmt(cctx.App) - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - maddr, err := address.NewFromString(cctx.Args().First()) - if err != nil { - return err - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - var pid peer.ID - if pidstr := cctx.String("peerid"); pidstr != "" { - p, err := peer.Decode(pidstr) - if err != nil { - return err - } - pid = p - } else { - mi, err := api.StateMinerInfo(ctx, maddr, types.EmptyTSK) - if err != nil { - return xerrors.Errorf("failed to get peerID for miner: %w", err) - } - - if mi.PeerId == nil || *mi.PeerId == ("SETME") { - return fmt.Errorf("the miner hasn't initialized yet") - } - - pid = *mi.PeerId - } - - ask, err := api.ClientQueryAsk(ctx, pid, maddr) - if err != nil { - return err - } - - afmt.Printf("Ask: %s\n", maddr) - afmt.Printf("Price per GiB: %s\n", types.FIL(ask.Price)) - afmt.Printf("Verified Price per GiB: %s\n", types.FIL(ask.VerifiedPrice)) - afmt.Printf("Max Piece size: %s\n", types.SizeStr(types.NewInt(uint64(ask.MaxPieceSize)))) - afmt.Printf("Min Piece size: %s\n", types.SizeStr(types.NewInt(uint64(ask.MinPieceSize)))) - - size := cctx.Int64("size") - if size == 0 { - return nil - } - perEpoch := types.BigDiv(types.BigMul(ask.Price, types.NewInt(uint64(size))), types.NewInt(1<<30)) - afmt.Printf("Price per Block: %s\n", types.FIL(perEpoch)) - - duration := cctx.Int64("duration") - if duration == 0 { - return nil - } - afmt.Printf("Total Price: %s\n", types.FIL(types.BigMul(perEpoch, types.NewInt(uint64(duration))))) - - return nil - }, -} - -var clientListDeals = &cli.Command{ - Name: "list-deals", - Usage: "List storage market deals", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - Usage: "print verbose deal details", - }, - &cli.BoolFlag{ - Name: "show-failed", - Usage: "show failed/failing deals", - }, - &cli.BoolFlag{ - Name: "watch", - Usage: "watch deal updates in real-time, rather than a one time list", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - verbose := cctx.Bool("verbose") - watch := cctx.Bool("watch") - showFailed := cctx.Bool("show-failed") - - localDeals, err := api.ClientListDeals(ctx) - if err != nil { - return err - } - - if watch { - updates, err := api.ClientGetDealUpdates(ctx) - if err != nil { - return err - } - - for { - tm.Clear() - tm.MoveCursor(1, 1) - - err = outputStorageDeals(ctx, tm.Screen, api, localDeals, verbose, showFailed) - if err != nil { - return err - } - - tm.Flush() - - select { - case <-ctx.Done(): - return nil - case updated := <-updates: - var found bool - for i, existing := range localDeals { - if existing.ProposalCid.Equals(updated.ProposalCid) { - localDeals[i] = updated - found = true - break - } - } - if !found { - localDeals = append(localDeals, updated) - } - } - } - } - - return outputStorageDeals(ctx, cctx.App.Writer, api, localDeals, verbose, showFailed) - }, -} - -func dealFromDealInfo(ctx context.Context, full v0api.FullNode, head *types.TipSet, v api.DealInfo) deal { - if v.DealID == 0 { - return deal{ - LocalDeal: v, - OnChainDealState: market.EmptyDealState(), - } - } - - onChain, err := full.StateMarketStorageDeal(ctx, v.DealID, head.Key()) - if err != nil { - return deal{LocalDeal: v} - } - - return deal{ - LocalDeal: v, - OnChainDealState: onChain.State.Iface(), - } -} - -func outputStorageDeals(ctx context.Context, out io.Writer, full v0api.FullNode, localDeals []lapi.DealInfo, verbose bool, showFailed bool) error { - sort.Slice(localDeals, func(i, j int) bool { - return localDeals[i].CreationTime.Before(localDeals[j].CreationTime) - }) - - head, err := full.ChainHead(ctx) - if err != nil { - return err - } - - var deals []deal - for _, localDeal := range localDeals { - if showFailed || localDeal.State != storagemarket.StorageDealError { - deals = append(deals, dealFromDealInfo(ctx, full, head, localDeal)) - } - } - - if verbose { - w := tabwriter.NewWriter(out, 2, 4, 2, ' ', 0) - fmt.Fprintf(w, "Created\tDealCid\tDealId\tProvider\tState\tOn Chain?\tSlashed?\tPieceCID\tSize\tPrice\tDuration\tTransferChannelID\tTransferStatus\tVerified\tMessage\n") - for _, d := range deals { - onChain := "N" - if d.OnChainDealState.SectorStartEpoch() != -1 { - onChain = fmt.Sprintf("Y (epoch %d)", d.OnChainDealState.SectorStartEpoch()) - } - - slashed := "N" - if d.OnChainDealState.SlashEpoch() != -1 { - slashed = fmt.Sprintf("Y (epoch %d)", d.OnChainDealState.SlashEpoch()) - } - - price := types.FIL(types.BigMul(d.LocalDeal.PricePerEpoch, types.NewInt(d.LocalDeal.Duration))) - transferChannelID := "" - if d.LocalDeal.TransferChannelID != nil { - transferChannelID = d.LocalDeal.TransferChannelID.String() - } - transferStatus := "" - if d.LocalDeal.DataTransfer != nil { - transferStatus = datatransfer.Statuses[d.LocalDeal.DataTransfer.Status] - // TODO: Include the transferred percentage once this bug is fixed: - // https://github.com/ipfs/go-graphsync/issues/126 - //fmt.Printf("transferred: %d / size: %d\n", d.LocalDeal.DataTransfer.Transferred, d.LocalDeal.Size) - //if d.LocalDeal.Size > 0 { - // pct := (100 * d.LocalDeal.DataTransfer.Transferred) / d.LocalDeal.Size - // transferPct = fmt.Sprintf("%d%%", pct) - //} - } - fmt.Fprintf(w, "%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%d\t%s\t%s\t%v\t%s\n", - d.LocalDeal.CreationTime.Format(time.Stamp), - d.LocalDeal.ProposalCid, - d.LocalDeal.DealID, - d.LocalDeal.Provider, - dealStateString(d.LocalDeal.State), - onChain, - slashed, - d.LocalDeal.PieceCID, - types.SizeStr(types.NewInt(d.LocalDeal.Size)), - price, - d.LocalDeal.Duration, - transferChannelID, - transferStatus, - d.LocalDeal.Verified, - d.LocalDeal.Message) - } - return w.Flush() - } - - w := tablewriter.New(tablewriter.Col("DealCid"), - tablewriter.Col("DealId"), - tablewriter.Col("Provider"), - tablewriter.Col("State"), - tablewriter.Col("On Chain?"), - tablewriter.Col("Slashed?"), - tablewriter.Col("PieceCID"), - tablewriter.Col("Size"), - tablewriter.Col("Price"), - tablewriter.Col("Duration"), - tablewriter.Col("Verified"), - tablewriter.NewLineCol("Message")) - - for _, d := range deals { - propcid := ellipsis(d.LocalDeal.ProposalCid.String(), 8) - - onChain := "N" - if d.OnChainDealState.SectorStartEpoch() != -1 { - onChain = fmt.Sprintf("Y (epoch %d)", d.OnChainDealState.SectorStartEpoch()) - } - - slashed := "N" - if d.OnChainDealState.SlashEpoch() != -1 { - slashed = fmt.Sprintf("Y (epoch %d)", d.OnChainDealState.SlashEpoch()) - } - - piece := ellipsis(d.LocalDeal.PieceCID.String(), 8) - - price := types.FIL(types.BigMul(d.LocalDeal.PricePerEpoch, types.NewInt(d.LocalDeal.Duration))) - - w.Write(map[string]interface{}{ - "DealCid": propcid, - "DealId": d.LocalDeal.DealID, - "Provider": d.LocalDeal.Provider, - "State": dealStateString(d.LocalDeal.State), - "On Chain?": onChain, - "Slashed?": slashed, - "PieceCID": piece, - "Size": types.SizeStr(types.NewInt(d.LocalDeal.Size)), - "Price": price, - "Verified": d.LocalDeal.Verified, - "Duration": d.LocalDeal.Duration, - "Message": d.LocalDeal.Message, - }) - } - - return w.Flush(out) -} - -func dealStateString(state storagemarket.StorageDealStatus) string { - s := storagemarket.DealStates[state] - switch state { - case storagemarket.StorageDealError, storagemarket.StorageDealExpired: - return color.RedString(s) - case storagemarket.StorageDealActive: - return color.GreenString(s) - default: - return s - } -} - -type deal struct { - LocalDeal lapi.DealInfo - OnChainDealState market.DealState -} - -var clientGetDealCmd = &cli.Command{ - Name: "get-deal", - Usage: "Print detailed deal information", - ArgsUsage: "[proposalCID]", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - propcid, err := cid.Decode(cctx.Args().First()) - if err != nil { - return err - } - - di, err := api.ClientGetDealInfo(ctx, propcid) - if err != nil { - return err - } - - out := map[string]interface{}{ - "DealInfo: ": di, - } - - if di.DealID != 0 { - onChain, err := api.StateMarketStorageDeal(ctx, di.DealID, types.EmptyTSK) - if err != nil { - return err - } - - out["OnChain"] = onChain - } - - b, err := json.MarshalIndent(out, "", " ") - if err != nil { - return err - } - fmt.Println(string(b)) - return nil - }, -} - -var clientBalancesCmd = &cli.Command{ - Name: "balances", - Usage: "Print storage market client balances", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "client", - Usage: "specify storage client address", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - var addr address.Address - if clientFlag := cctx.String("client"); clientFlag != "" { - ca, err := address.NewFromString(clientFlag) - if err != nil { - return err - } - - addr = ca - } else { - def, err := api.WalletDefaultAddress(ctx) - if err != nil { - return err - } - addr = def - } - - balance, err := api.StateMarketBalance(ctx, addr, types.EmptyTSK) - if err != nil { - return err - } - - reserved, err := api.MarketGetReserved(ctx, addr) - if err != nil { - return err - } - - avail := big.Sub(big.Sub(balance.Escrow, balance.Locked), reserved) - if avail.LessThan(big.Zero()) { - avail = big.Zero() - } - - fmt.Printf("Client Market Balance for address %s:\n", addr) - - fmt.Printf(" Escrowed Funds: %s\n", types.FIL(balance.Escrow)) - fmt.Printf(" Locked Funds: %s\n", types.FIL(balance.Locked)) - fmt.Printf(" Reserved Funds: %s\n", types.FIL(reserved)) - fmt.Printf(" Available to Withdraw: %s\n", types.FIL(avail)) - - return nil - }, -} - -var clientStat = &cli.Command{ - Name: "stat", - Usage: "Print information about a locally stored file (piece size, etc)", - ArgsUsage: "", - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - dataCid, err := cid.Parse(cctx.Args().First()) - if err != nil { - return fmt.Errorf("parsing data cid: %w", err) - } - - ds, err := api.ClientDealSize(ctx, dataCid) - if err != nil { - return err - } - - fmt.Printf("Piece Size : %v\n", ds.PieceSize) - fmt.Printf("Payload Size: %v\n", ds.PayloadSize) - - return nil - }, -} - -var clientRestartTransfer = &cli.Command{ - Name: "restart-transfer", - Usage: "Force restart a stalled data transfer", - ArgsUsage: "[transferID]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "peerid", - Usage: "narrow to transfer with specific peer", - }, - &cli.BoolFlag{ - Name: "initiator", - Usage: "specify only transfers where peer is/is not initiator", - Value: true, - }, - }, - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - transferUint, err := strconv.ParseUint(cctx.Args().First(), 10, 64) - if err != nil { - return fmt.Errorf("Error reading transfer ID: %w", err) - } - transferID := datatransfer.TransferID(transferUint) - initiator := cctx.Bool("initiator") - var other peer.ID - if pidstr := cctx.String("peerid"); pidstr != "" { - p, err := peer.Decode(pidstr) - if err != nil { - return err - } - other = p - } else { - channels, err := api.ClientListDataTransfers(ctx) - if err != nil { - return err - } - found := false - for _, channel := range channels { - if channel.IsInitiator == initiator && channel.TransferID == transferID { - other = channel.OtherPeer - found = true - break - } - } - if !found { - return errors.New("unable to find matching data transfer") - } - } - - return api.ClientRestartDataTransfer(ctx, transferID, other, initiator) - }, -} - -var clientCancelTransfer = &cli.Command{ - Name: "cancel-transfer", - Usage: "Force cancel a data transfer", - ArgsUsage: "[transferID]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "peerid", - Usage: "narrow to transfer with specific peer", - }, - &cli.BoolFlag{ - Name: "initiator", - Usage: "specify only transfers where peer is/is not initiator", - Value: true, - }, - &cli.DurationFlag{ - Name: "cancel-timeout", - Usage: "time to wait for cancel to be sent to storage provider", - Value: 5 * time.Second, - }, - }, - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - transferUint, err := strconv.ParseUint(cctx.Args().First(), 10, 64) - if err != nil { - return fmt.Errorf("Error reading transfer ID: %w", err) - } - transferID := datatransfer.TransferID(transferUint) - initiator := cctx.Bool("initiator") - var other peer.ID - if pidstr := cctx.String("peerid"); pidstr != "" { - p, err := peer.Decode(pidstr) - if err != nil { - return err - } - other = p - } else { - channels, err := api.ClientListDataTransfers(ctx) - if err != nil { - return err - } - found := false - for _, channel := range channels { - if channel.IsInitiator == initiator && channel.TransferID == transferID { - other = channel.OtherPeer - found = true - break - } - } - if !found { - return errors.New("unable to find matching data transfer") - } - } - - timeoutCtx, cancel := context.WithTimeout(ctx, cctx.Duration("cancel-timeout")) - defer cancel() - return api.ClientCancelDataTransfer(timeoutCtx, transferID, other, initiator) - }, -} - -var clientCancelRetrievalDealCmd = &cli.Command{ - Name: "cancel-retrieval", - Usage: "Cancel a retrieval deal by deal ID; this also cancels the associated transfer", - Flags: []cli.Flag{ - &cli.Int64Flag{ - Name: "deal-id", - Usage: "specify retrieval deal by deal ID", - Required: true, - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - id := cctx.Int64("deal-id") - if id < 0 { - return errors.New("deal id cannot be negative") - } - - return api.ClientCancelRetrievalDeal(ctx, retrievalmarket.DealID(id)) - }, -} - -var clientListTransfers = &cli.Command{ - Name: "list-transfers", - Usage: "List ongoing data transfers for deals", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - Usage: "print verbose transfer details", - }, - &cli.BoolFlag{ - Name: "completed", - Usage: "show completed data transfers", - }, - &cli.BoolFlag{ - Name: "watch", - Usage: "watch deal updates in real-time, rather than a one time list", - }, - &cli.BoolFlag{ - Name: "show-failed", - Usage: "show failed/cancelled transfers", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - channels, err := api.ClientListDataTransfers(ctx) - if err != nil { - return err - } - - verbose := cctx.Bool("verbose") - completed := cctx.Bool("completed") - watch := cctx.Bool("watch") - showFailed := cctx.Bool("show-failed") - if watch { - channelUpdates, err := api.ClientDataTransferUpdates(ctx) - if err != nil { - return err - } - - for { - tm.Clear() // Clear current screen - - tm.MoveCursor(1, 1) - - OutputDataTransferChannels(tm.Screen, channels, verbose, completed, showFailed) - - tm.Flush() - - select { - case <-ctx.Done(): - return nil - case channelUpdate := <-channelUpdates: - var found bool - for i, existing := range channels { - if existing.TransferID == channelUpdate.TransferID && - existing.OtherPeer == channelUpdate.OtherPeer && - existing.IsSender == channelUpdate.IsSender && - existing.IsInitiator == channelUpdate.IsInitiator { - channels[i] = channelUpdate - found = true - break - } - } - if !found { - channels = append(channels, channelUpdate) - } - } - } - } - OutputDataTransferChannels(os.Stdout, channels, verbose, completed, showFailed) - return nil - }, -} - -// OutputDataTransferChannels generates table output for a list of channels -func OutputDataTransferChannels(out io.Writer, channels []lapi.DataTransferChannel, verbose, completed, showFailed bool) { - sort.Slice(channels, func(i, j int) bool { - return channels[i].TransferID < channels[j].TransferID - }) - - var receivingChannels, sendingChannels []lapi.DataTransferChannel - for _, channel := range channels { - if !completed && channel.Status == datatransfer.Completed { - continue - } - if !showFailed && (channel.Status == datatransfer.Failed || channel.Status == datatransfer.Cancelled) { - continue - } - if channel.IsSender { - sendingChannels = append(sendingChannels, channel) - } else { - receivingChannels = append(receivingChannels, channel) - } - } - - fmt.Fprintf(out, "Sending Channels\n\n") - w := tablewriter.New(tablewriter.Col("ID"), - tablewriter.Col("Status"), - tablewriter.Col("Sending To"), - tablewriter.Col("Root Cid"), - tablewriter.Col("Initiated?"), - tablewriter.Col("Transferred"), - tablewriter.Col("Voucher"), - tablewriter.NewLineCol("Message")) - for _, channel := range sendingChannels { - w.Write(toChannelOutput("Sending To", channel, verbose)) - } - _ = w.Flush(out) - - fmt.Fprintf(out, "\nReceiving Channels\n\n") - w = tablewriter.New(tablewriter.Col("ID"), - tablewriter.Col("Status"), - tablewriter.Col("Receiving From"), - tablewriter.Col("Root Cid"), - tablewriter.Col("Initiated?"), - tablewriter.Col("Transferred"), - tablewriter.Col("Voucher"), - tablewriter.NewLineCol("Message")) - for _, channel := range receivingChannels { - w.Write(toChannelOutput("Receiving From", channel, verbose)) - } - _ = w.Flush(out) -} - -func channelStatusString(status datatransfer.Status) string { - s := datatransfer.Statuses[status] - switch status { - case datatransfer.Failed, datatransfer.Cancelled: - return color.RedString(s) - case datatransfer.Completed: - return color.GreenString(s) - default: - return s - } -} - -func toChannelOutput(otherPartyColumn string, channel lapi.DataTransferChannel, verbose bool) map[string]interface{} { - rootCid := channel.BaseCID.String() - otherParty := channel.OtherPeer.String() - if !verbose { - rootCid = ellipsis(rootCid, 8) - otherParty = ellipsis(otherParty, 8) - } - - initiated := "N" - if channel.IsInitiator { - initiated = "Y" - } - - voucher := channel.Voucher - if len(voucher) > 40 && !verbose { - voucher = ellipsis(voucher, 37) - } - - return map[string]interface{}{ - "ID": channel.TransferID, - "Status": channelStatusString(channel.Status), - otherPartyColumn: otherParty, - "Root Cid": rootCid, - "Initiated?": initiated, - "Transferred": units.BytesSize(float64(channel.Transferred)), - "Voucher": voucher, - "Message": channel.Message, - } -} - -func ellipsis(s string, length int) string { - if length > 0 && len(s) > length { - return "..." + s[len(s)-length:] - } - return s -} - -func inspectDealCmd(ctx context.Context, api v0api.FullNode, proposalCid string, dealId int) error { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - deals, err := api.ClientListDeals(ctx) - if err != nil { - return err - } - - var di *lapi.DealInfo - for i, cdi := range deals { - if proposalCid != "" && cdi.ProposalCid.String() == proposalCid { - di = &deals[i] - break - } - - if dealId != 0 && int(cdi.DealID) == dealId { - di = &deals[i] - break - } - } - - if di == nil { - if proposalCid != "" { - return fmt.Errorf("cannot find deal with proposal cid: %s", proposalCid) - } - if dealId != 0 { - return fmt.Errorf("cannot find deal with deal id: %v", dealId) - } - return errors.New("you must specify proposal cid or deal id in order to inspect a deal") - } - - // populate DealInfo.DealStages and DataTransfer.Stages - di, err = api.ClientGetDealInfo(ctx, di.ProposalCid) - if err != nil { - return fmt.Errorf("cannot get deal info for proposal cid: %v", di.ProposalCid) - } - - renderDeal(di) - - return nil -} - -func renderDeal(di *lapi.DealInfo) { - color.Blue("Deal ID: %d\n", int(di.DealID)) - color.Blue("Proposal CID: %s\n\n", di.ProposalCid.String()) - - if di.DealStages == nil { - color.Yellow("Deal was made with an older version of Lotus and Lotus did not collect detailed information about its stages") - return - } - - for _, stg := range di.DealStages.Stages { - msg := fmt.Sprintf("%s %s: %s (expected duration: %s)", color.BlueString("Stage:"), color.BlueString(strings.TrimPrefix(stg.Name, "StorageDeal")), stg.Description, color.GreenString(stg.ExpectedDuration)) - if stg.UpdatedTime.Time().IsZero() { - msg = color.YellowString(msg) - } - fmt.Println(msg) - - for _, l := range stg.Logs { - fmt.Printf(" %s %s\n", color.YellowString(l.UpdatedTime.Time().UTC().Round(time.Second).Format(time.Stamp)), l.Log) - } - - if stg.Name == "StorageDealStartDataTransfer" { - for _, dtStg := range di.DataTransfer.Stages.Stages { - fmt.Printf(" %s %s %s\n", color.YellowString(dtStg.CreatedTime.Time().UTC().Round(time.Second).Format(time.Stamp)), color.BlueString("Data transfer stage:"), color.BlueString(dtStg.Name)) - for _, l := range dtStg.Logs { - fmt.Printf(" %s %s\n", color.YellowString(l.UpdatedTime.Time().UTC().Round(time.Second).Format(time.Stamp)), l.Log) - } - } - } - } -} From 03bd0a530da004e62f478b81d9196bb1f31bffb1 Mon Sep 17 00:00:00 2001 From: aarshkshah1992 Date: Thu, 16 May 2024 11:30:21 +0530 Subject: [PATCH 2/6] remove markets CLI from miner --- cli/cmd.go | 1 - cli/util/api.go | 21 - cmd/lotus-miner/dagstore.go | 282 -------- cmd/lotus-miner/index_provider.go | 62 -- cmd/lotus-miner/info_all.go | 71 -- cmd/lotus-miner/main.go | 6 - cmd/lotus-miner/market.go | 1039 --------------------------- cmd/lotus-miner/pieces.go | 193 ----- cmd/lotus-miner/retrieval-deals.go | 231 ------ cmd/lotus-miner/sectors.go | 27 - documentation/en/cli-lotus-miner.md | 13 - documentation/en/cli-lotus.md | 510 ------------- 12 files changed, 2456 deletions(-) delete mode 100644 cmd/lotus-miner/dagstore.go delete mode 100644 cmd/lotus-miner/index_provider.go delete mode 100644 cmd/lotus-miner/market.go delete mode 100644 cmd/lotus-miner/pieces.go delete mode 100644 cmd/lotus-miner/retrieval-deals.go diff --git a/cli/cmd.go b/cli/cmd.go index 76c0ab300a6..9ae8c14b75e 100644 --- a/cli/cmd.go +++ b/cli/cmd.go @@ -54,7 +54,6 @@ var GetFullNodeAPIV1 = cliutil.GetFullNodeAPIV1 var GetGatewayAPI = cliutil.GetGatewayAPI var GetStorageMinerAPI = cliutil.GetStorageMinerAPI -var GetMarketsAPI = cliutil.GetMarketsAPI var GetWorkerAPI = cliutil.GetWorkerAPI var CommonCommands = []*cli.Command{ diff --git a/cli/util/api.go b/cli/util/api.go index 7940f67c63a..a734b23371e 100644 --- a/cli/util/api.go +++ b/cli/util/api.go @@ -456,27 +456,6 @@ func GetWorkerAPI(ctx *cli.Context) (api.Worker, jsonrpc.ClientCloser, error) { return client.NewWorkerRPCV0(ctx.Context, addr, headers) } -func GetMarketsAPI(ctx *cli.Context) (api.StorageMiner, jsonrpc.ClientCloser, error) { - // to support lotus-miner cli tests. - if tn, ok := ctx.App.Metadata["testnode-storage"]; ok { - return tn.(api.StorageMiner), func() {}, nil - } - - addr, headers, err := GetRawAPI(ctx, repo.Markets, "v0") - if err != nil { - return nil, nil, err - } - - if IsVeryVerbose { - _, _ = fmt.Fprintln(ctx.App.Writer, "using markets API v0 endpoint:", addr) - } - - // the markets node is a specialised miner's node, supporting only the - // markets API, which is a subset of the miner API. All non-markets - // operations will error out with "unsupported". - return client.NewStorageMinerRPCV0(ctx.Context, addr, headers) -} - func GetGatewayAPI(ctx *cli.Context) (api.Gateway, jsonrpc.ClientCloser, error) { addr, headers, err := GetRawAPI(ctx, repo.FullNode, "v1") if err != nil { diff --git a/cmd/lotus-miner/dagstore.go b/cmd/lotus-miner/dagstore.go deleted file mode 100644 index c0e37f63bf0..00000000000 --- a/cmd/lotus-miner/dagstore.go +++ /dev/null @@ -1,282 +0,0 @@ -package main - -import ( - "fmt" - "os" - "strings" - - "github.com/fatih/color" - "github.com/ipfs/go-cid" - "github.com/urfave/cli/v2" - - "github.com/filecoin-project/lotus/api" - lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/lib/tablewriter" -) - -var dagstoreCmd = &cli.Command{ - Name: "dagstore", - Usage: "Manage the dagstore on the markets subsystem", - Subcommands: []*cli.Command{ - dagstoreListShardsCmd, - dagstoreRegisterShardCmd, - dagstoreInitializeShardCmd, - dagstoreRecoverShardCmd, - dagstoreInitializeAllCmd, - dagstoreGcCmd, - dagstoreLookupPiecesCmd, - }, -} - -var dagstoreListShardsCmd = &cli.Command{ - Name: "list-shards", - Usage: "List all shards known to the dagstore, with their current status", - Action: func(cctx *cli.Context) error { - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - shards, err := marketsApi.DagstoreListShards(ctx) - if err != nil { - return err - } - - return printTableShards(shards) - }, -} - -var dagstoreRegisterShardCmd = &cli.Command{ - Name: "register-shard", - ArgsUsage: "[key]", - Usage: "Register a shard", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - marketsAPI, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - shardKey := cctx.Args().First() - err = marketsAPI.DagstoreRegisterShard(ctx, shardKey) - if err != nil { - return err - } - - fmt.Println("Registered shard " + shardKey) - return nil - }, -} - -var dagstoreInitializeShardCmd = &cli.Command{ - Name: "initialize-shard", - ArgsUsage: "[key]", - Usage: "Initialize the specified shard", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - return marketsApi.DagstoreInitializeShard(ctx, cctx.Args().First()) - }, -} - -var dagstoreRecoverShardCmd = &cli.Command{ - Name: "recover-shard", - ArgsUsage: "[key]", - Usage: "Attempt to recover a shard in errored state", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - return marketsApi.DagstoreRecoverShard(ctx, cctx.Args().First()) - }, -} - -var dagstoreInitializeAllCmd = &cli.Command{ - Name: "initialize-all", - Usage: "Initialize all uninitialized shards, streaming results as they're produced; only shards for unsealed pieces are initialized by default", - Flags: []cli.Flag{ - &cli.UintFlag{ - Name: "concurrency", - Usage: "maximum shards to initialize concurrently at a time; use 0 for unlimited", - Required: true, - }, - &cli.BoolFlag{ - Name: "include-sealed", - Usage: "initialize sealed pieces as well", - }, - }, - Action: func(cctx *cli.Context) error { - concurrency := cctx.Uint("concurrency") - sealed := cctx.Bool("sealed") - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - params := api.DagstoreInitializeAllParams{ - MaxConcurrency: int(concurrency), - IncludeSealed: sealed, - } - - ch, err := marketsApi.DagstoreInitializeAll(ctx, params) - if err != nil { - return err - } - - for { - select { - case evt, ok := <-ch: - if !ok { - return nil - } - _, _ = fmt.Fprint(os.Stdout, color.New(color.BgHiBlack).Sprintf("(%d/%d)", evt.Current, evt.Total)) - _, _ = fmt.Fprint(os.Stdout, " ") - if evt.Event == "start" { - _, _ = fmt.Fprintln(os.Stdout, evt.Key, color.New(color.Reset).Sprint("STARTING")) - } else { - if evt.Success { - _, _ = fmt.Fprintln(os.Stdout, evt.Key, color.New(color.FgGreen).Sprint("SUCCESS")) - } else { - _, _ = fmt.Fprintln(os.Stdout, evt.Key, color.New(color.FgRed).Sprint("ERROR"), evt.Error) - } - } - - case <-ctx.Done(): - return fmt.Errorf("aborted") - } - } - }, -} - -var dagstoreGcCmd = &cli.Command{ - Name: "gc", - Usage: "Garbage collect the dagstore", - Action: func(cctx *cli.Context) error { - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - collected, err := marketsApi.DagstoreGC(ctx) - if err != nil { - return err - } - - if len(collected) == 0 { - _, _ = fmt.Fprintln(os.Stdout, "no shards collected") - return nil - } - - for _, e := range collected { - if e.Error == "" { - _, _ = fmt.Fprintln(os.Stdout, e.Key, color.New(color.FgGreen).Sprint("SUCCESS")) - } else { - _, _ = fmt.Fprintln(os.Stdout, e.Key, color.New(color.FgRed).Sprint("ERROR"), e.Error) - } - } - - return nil - }, -} - -func printTableShards(shards []api.DagstoreShardInfo) error { - if len(shards) == 0 { - return nil - } - - tw := tablewriter.New( - tablewriter.Col("Key"), - tablewriter.Col("State"), - tablewriter.Col("Error"), - ) - - colors := map[string]color.Attribute{ - "ShardStateAvailable": color.FgGreen, - "ShardStateServing": color.FgBlue, - "ShardStateErrored": color.FgRed, - "ShardStateNew": color.FgYellow, - } - - for _, s := range shards { - m := map[string]interface{}{ - "Key": s.Key, - "State": func() string { - trimmedState := strings.TrimPrefix(s.State, "ShardState") - if c, ok := colors[s.State]; ok { - return color.New(c).Sprint(trimmedState) - } - return trimmedState - }(), - "Error": s.Error, - } - tw.Write(m) - } - return tw.Flush(os.Stdout) -} - -var dagstoreLookupPiecesCmd = &cli.Command{ - Name: "lookup-pieces", - Usage: "Lookup pieces that a given CID belongs to", - ArgsUsage: "", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - cidStr := cctx.Args().First() - cid, err := cid.Parse(cidStr) - if err != nil { - return fmt.Errorf("invalid CID: %w", err) - } - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - shards, err := marketsApi.DagstoreLookupPieces(ctx, cid) - if err != nil { - return err - } - - return printTableShards(shards) - }, -} diff --git a/cmd/lotus-miner/index_provider.go b/cmd/lotus-miner/index_provider.go deleted file mode 100644 index 2b6838a4b3f..00000000000 --- a/cmd/lotus-miner/index_provider.go +++ /dev/null @@ -1,62 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/ipfs/go-cid" - "github.com/urfave/cli/v2" - - lcli "github.com/filecoin-project/lotus/cli" -) - -var indexProvCmd = &cli.Command{ - Name: "index", - Usage: "Manage the index provider on the markets subsystem", - Subcommands: []*cli.Command{ - indexProvAnnounceCmd, - indexProvAnnounceAllCmd, - }, -} - -var indexProvAnnounceCmd = &cli.Command{ - Name: "announce", - ArgsUsage: "", - Usage: "Announce a deal to indexers so they can download its index", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - proposalCidStr := cctx.Args().First() - proposalCid, err := cid.Parse(proposalCidStr) - if err != nil { - return fmt.Errorf("invalid deal proposal CID: %w", err) - } - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - return marketsApi.IndexerAnnounceDeal(ctx, proposalCid) - }, -} - -var indexProvAnnounceAllCmd = &cli.Command{ - Name: "announce-all", - Usage: "Announce all active deals to indexers so they can download the indices", - Action: func(cctx *cli.Context) error { - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - return marketsApi.IndexerAnnounceAllDeals(ctx) - }, -} diff --git a/cmd/lotus-miner/info_all.go b/cmd/lotus-miner/info_all.go index 5b83467a2f8..253d2befc67 100644 --- a/cmd/lotus-miner/info_all.go +++ b/cmd/lotus-miner/info_all.go @@ -112,72 +112,6 @@ var infoAllCmd = &cli.Command{ fmt.Println("ERROR: ", err) } - fmt.Println("\n#: Storage Ask") - if err := getAskCmd.Action(cctx); err != nil { - fmt.Println("ERROR: ", err) - } - - fmt.Println("\n#: Storage Deals") - { - fs := &flag.FlagSet{} - for _, f := range dealsListCmd.Flags { - if err := f.Apply(fs); err != nil { - fmt.Println("ERROR: ", err) - } - } - if err := fs.Parse([]string{"--verbose"}); err != nil { - fmt.Println("ERROR: ", err) - } - - if err := dealsListCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { - fmt.Println("ERROR: ", err) - } - } - - fmt.Println("\n#: Storage Deals JSON") - { - fs := &flag.FlagSet{} - for _, f := range dealsListCmd.Flags { - if err := f.Apply(fs); err != nil { - fmt.Println("ERROR: ", err) - } - } - if err := fs.Parse([]string{"--verbose", "--format=json"}); err != nil { - fmt.Println("ERROR: ", err) - } - - if err := dealsListCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { - fmt.Println("ERROR: ", err) - } - } - - fmt.Println("\n#: Data Transfers") - { - fs := &flag.FlagSet{} - for _, f := range transfersListCmd.Flags { - if err := f.Apply(fs); err != nil { - fmt.Println("ERROR: ", err) - } - } - if err := fs.Parse([]string{"--verbose", "--completed", "--show-failed"}); err != nil { - fmt.Println("ERROR: ", err) - } - - if err := transfersListCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { - fmt.Println("ERROR: ", err) - } - } - - fmt.Println("\n#: DAGStore shards") - if err := dagstoreListShardsCmd.Action(cctx); err != nil { - fmt.Println("ERROR: ", err) - } - - fmt.Println("\n#: Pending Batch Deals") - if err := dealsPendingPublish.Action(cctx); err != nil { - fmt.Println("ERROR: ", err) - } - fmt.Println("\n#: Pending Batch Terminations") if err := sectorsTerminatePendingCmd.Action(cctx); err != nil { fmt.Println("ERROR: ", err) @@ -217,11 +151,6 @@ var infoAllCmd = &cli.Command{ fmt.Println("ERROR: ", err) } - fmt.Println("\n#: Sector Refs") - if err := sectorsRefsCmd.Action(cctx); err != nil { - fmt.Println("ERROR: ", err) - } - // Very Very Verbose info fmt.Println("\n#: Per Sector Info") diff --git a/cmd/lotus-miner/main.go b/cmd/lotus-miner/main.go index 1fc7abfa8da..dafe65681b3 100644 --- a/cmd/lotus-miner/main.go +++ b/cmd/lotus-miner/main.go @@ -43,16 +43,10 @@ func main() { backupCmd, lcli.WithCategory("chain", actorCmd), lcli.WithCategory("chain", infoCmd), - lcli.WithCategory("market", setHidden(storageDealsCmd)), - lcli.WithCategory("market", setHidden(retrievalDealsCmd)), - lcli.WithCategory("market", setHidden(dataTransfersCmd)), - lcli.WithCategory("market", setHidden(dagstoreCmd)), - lcli.WithCategory("market", setHidden(indexProvCmd)), lcli.WithCategory("storage", sectorsCmd), lcli.WithCategory("storage", provingCmd), lcli.WithCategory("storage", storageCmd), lcli.WithCategory("storage", sealingCmd), - lcli.WithCategory("retrieval", setHidden(piecesCmd)), } jaeger := tracing.SetupJaegerTracing("lotus") diff --git a/cmd/lotus-miner/market.go b/cmd/lotus-miner/market.go deleted file mode 100644 index 29eb662a78d..00000000000 --- a/cmd/lotus-miner/market.go +++ /dev/null @@ -1,1039 +0,0 @@ -package main - -import ( - "bufio" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strconv" - "text/tabwriter" - "time" - - tm "github.com/buger/goterm" - "github.com/docker/go-units" - "github.com/ipfs/go-cid" - "github.com/ipfs/go-cidutil/cidenc" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/multiformats/go-multibase" - "github.com/urfave/cli/v2" - "golang.org/x/xerrors" - - cborutil "github.com/filecoin-project/go-cbor-util" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/types" - lcli "github.com/filecoin-project/lotus/cli" -) - -var CidBaseFlag = cli.StringFlag{ - Name: "cid-base", - Hidden: true, - Value: "base32", - Usage: "Multibase encoding used for version 1 CIDs in output.", - DefaultText: "base32", -} - -// GetCidEncoder returns an encoder using the `cid-base` flag if provided, or -// the default (Base32) encoder if not. -func GetCidEncoder(cctx *cli.Context) (cidenc.Encoder, error) { - val := cctx.String("cid-base") - - e := cidenc.Encoder{Base: multibase.MustNewEncoder(multibase.Base32)} - - if val != "" { - var err error - e.Base, err = multibase.EncoderByName(val) - if err != nil { - return e, err - } - } - - return e, nil -} - -var storageDealSelectionCmd = &cli.Command{ - Name: "selection", - Usage: "Configure acceptance criteria for storage deal proposals", - Subcommands: []*cli.Command{ - storageDealSelectionShowCmd, - storageDealSelectionResetCmd, - storageDealSelectionRejectCmd, - }, -} - -var storageDealSelectionShowCmd = &cli.Command{ - Name: "list", - Usage: "List storage deal proposal selection criteria", - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - onlineOk, err := smapi.DealsConsiderOnlineStorageDeals(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - offlineOk, err := smapi.DealsConsiderOfflineStorageDeals(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - fmt.Printf("considering online storage deals: %t\n", onlineOk) - fmt.Printf("considering offline storage deals: %t\n", offlineOk) - - return nil - }, -} - -var storageDealSelectionResetCmd = &cli.Command{ - Name: "reset", - Usage: "Reset storage deal proposal selection criteria to default values", - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - err = smapi.DealsSetConsiderOnlineStorageDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - err = smapi.DealsSetConsiderOfflineStorageDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - err = smapi.DealsSetConsiderVerifiedStorageDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - err = smapi.DealsSetConsiderUnverifiedStorageDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - return nil - }, -} - -var storageDealSelectionRejectCmd = &cli.Command{ - Name: "reject", - Usage: "Configure criteria which necessitate automatic rejection", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "online", - }, - &cli.BoolFlag{ - Name: "offline", - }, - &cli.BoolFlag{ - Name: "verified", - }, - &cli.BoolFlag{ - Name: "unverified", - }, - }, - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - if cctx.Bool("online") { - err = smapi.DealsSetConsiderOnlineStorageDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - if cctx.Bool("offline") { - err = smapi.DealsSetConsiderOfflineStorageDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - if cctx.Bool("verified") { - err = smapi.DealsSetConsiderVerifiedStorageDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - if cctx.Bool("unverified") { - err = smapi.DealsSetConsiderUnverifiedStorageDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - return nil - }, -} - -var setAskCmd = &cli.Command{ - Name: "set-ask", - Usage: "Configure the miner's ask", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "price", - Usage: "Set the price of the ask for unverified deals (specified as FIL / GiB / Epoch) to `PRICE`.", - Required: true, - }, - &cli.StringFlag{ - Name: "verified-price", - Usage: "Set the price of the ask for verified deals (specified as FIL / GiB / Epoch) to `PRICE`", - Required: true, - }, - &cli.StringFlag{ - Name: "min-piece-size", - Usage: "Set minimum piece size (w/bit-padding, in bytes) in ask to `SIZE`", - DefaultText: "256B", - Value: "256B", - }, - &cli.StringFlag{ - Name: "max-piece-size", - Usage: "Set maximum piece size (w/bit-padding, in bytes) in ask to `SIZE`", - DefaultText: "miner sector size", - Value: "0", - }, - }, - Action: func(cctx *cli.Context) error { - ctx := lcli.DaemonContext(cctx) - - minerApi, closer, err := lcli.GetStorageMinerAPI(cctx) - if err != nil { - return err - } - defer closer() - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - pri, err := types.ParseFIL(cctx.String("price")) - if err != nil { - return err - } - - vpri, err := types.ParseFIL(cctx.String("verified-price")) - if err != nil { - return err - } - - dur, err := time.ParseDuration("720h0m0s") - if err != nil { - return xerrors.Errorf("cannot parse duration: %w", err) - } - - qty := dur.Seconds() / float64(build.BlockDelaySecs) - - min, err := units.RAMInBytes(cctx.String("min-piece-size")) - if err != nil { - return xerrors.Errorf("cannot parse min-piece-size to quantity of bytes: %w", err) - } - - if min < 256 { - return xerrors.New("minimum piece size (w/bit-padding) is 256B") - } - - max, err := units.RAMInBytes(cctx.String("max-piece-size")) - if err != nil { - return xerrors.Errorf("cannot parse max-piece-size to quantity of bytes: %w", err) - } - - maddr, err := minerApi.ActorAddress(ctx) - if err != nil { - return err - } - - ssize, err := minerApi.ActorSectorSize(ctx, maddr) - if err != nil { - return err - } - - smax := int64(ssize) - - if max == 0 { - max = smax - } - - if max > smax { - return xerrors.Errorf("max piece size (w/bit-padding) %s cannot exceed miner sector size %s", types.SizeStr(types.NewInt(uint64(max))), types.SizeStr(types.NewInt(uint64(smax)))) - } - - return marketsApi.MarketSetAsk(ctx, types.BigInt(pri), types.BigInt(vpri), abi.ChainEpoch(qty), abi.PaddedPieceSize(min), abi.PaddedPieceSize(max)) - }, -} - -var getAskCmd = &cli.Command{ - Name: "get-ask", - Usage: "Print the miner's ask", - Flags: []cli.Flag{}, - Action: func(cctx *cli.Context) error { - ctx := lcli.DaemonContext(cctx) - - fnapi, closer, err := lcli.GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - sask, err := smapi.MarketGetAsk(ctx) - if err != nil { - return err - } - - var ask *storagemarket.StorageAsk - if sask != nil && sask.Ask != nil { - ask = sask.Ask - } - - w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0) - fmt.Fprintf(w, "Price per GiB/Epoch\tVerified\tMin. Piece Size (padded)\tMax. Piece Size (padded)\tExpiry (Epoch)\tExpiry (Appx. Rem. Time)\tSeq. No.\n") - if ask == nil { - fmt.Fprintf(w, "\n") - - return w.Flush() - } - - head, err := fnapi.ChainHead(ctx) - if err != nil { - return err - } - - dlt := ask.Expiry - head.Height() - rem := "" - if dlt > 0 { - rem = (time.Second * time.Duration(int64(dlt)*int64(build.BlockDelaySecs))).String() - } - - fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%d\t%s\t%d\n", types.FIL(ask.Price), types.FIL(ask.VerifiedPrice), types.SizeStr(types.NewInt(uint64(ask.MinPieceSize))), types.SizeStr(types.NewInt(uint64(ask.MaxPieceSize))), ask.Expiry, rem, ask.SeqNo) - - return w.Flush() - }, -} - -var storageDealsCmd = &cli.Command{ - Name: "storage-deals", - Usage: "Manage storage deals and related configuration", - Subcommands: []*cli.Command{ - dealsImportDataCmd, - dealsListCmd, - storageDealSelectionCmd, - setAskCmd, - getAskCmd, - setBlocklistCmd, - getBlocklistCmd, - resetBlocklistCmd, - setSealDurationCmd, - dealsPendingPublish, - dealsRetryPublish, - }, -} - -var dealsImportDataCmd = &cli.Command{ - Name: "import-data", - Usage: "Manually import data for a deal", - ArgsUsage: " ", - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.DaemonContext(cctx) - - if cctx.NArg() != 2 { - return lcli.IncorrectNumArgs(cctx) - } - - propCid, err := cid.Decode(cctx.Args().Get(0)) - if err != nil { - return err - } - - fpath := cctx.Args().Get(1) - - return api.DealsImportData(ctx, propCid, fpath) - - }, -} - -var dealsListCmd = &cli.Command{ - Name: "list", - Usage: "List all deals for this miner", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "format", - Usage: "output format of data, supported: table, json", - Value: "table", - }, - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - }, - &cli.BoolFlag{ - Name: "watch", - Usage: "watch deal updates in real-time, rather than a one time list", - }, - }, - Action: func(cctx *cli.Context) error { - switch cctx.String("format") { - case "table": - return listDealsWithTable(cctx) - case "json": - return listDealsWithJSON(cctx) - } - - return fmt.Errorf("unknown format: %s; use `table` or `json`", cctx.String("format")) - }, -} - -func listDealsWithTable(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.DaemonContext(cctx) - - deals, err := api.MarketListIncompleteDeals(ctx) - if err != nil { - return err - } - - verbose := cctx.Bool("verbose") - watch := cctx.Bool("watch") - - if watch { - updates, err := api.MarketGetDealUpdates(ctx) - if err != nil { - return err - } - - for { - tm.Clear() - tm.MoveCursor(1, 1) - - err = outputStorageDealsTable(tm.Output, deals, verbose) - if err != nil { - return err - } - - tm.Flush() - - select { - case <-ctx.Done(): - return nil - case updated := <-updates: - var found bool - for i, existing := range deals { - if existing.ProposalCid.Equals(updated.ProposalCid) { - deals[i] = updated - found = true - break - } - } - if !found { - deals = append(deals, updated) - } - } - } - } - - return outputStorageDealsTable(os.Stdout, deals, verbose) -} - -func outputStorageDealsTable(out io.Writer, deals []storagemarket.MinerDeal, verbose bool) error { - sort.Slice(deals, func(i, j int) bool { - return deals[i].CreationTime.Time().Before(deals[j].CreationTime.Time()) - }) - - w := tabwriter.NewWriter(out, 2, 4, 2, ' ', 0) - - if verbose { - _, _ = fmt.Fprintf(w, "Creation\tVerified\tProposalCid\tDealId\tState\tClient\tSize\tPrice\tDuration\tTransferChannelID\tMessage\n") - } else { - _, _ = fmt.Fprintf(w, "ProposalCid\tDealId\tState\tClient\tSize\tPrice\tDuration\n") - } - - for _, deal := range deals { - propcid := deal.ProposalCid.String() - if !verbose { - propcid = "..." + propcid[len(propcid)-8:] - } - - fil := types.FIL(types.BigMul(deal.Proposal.StoragePricePerEpoch, types.NewInt(uint64(deal.Proposal.Duration())))) - - if verbose { - _, _ = fmt.Fprintf(w, "%s\t%t\t", deal.CreationTime.Time().Format(time.Stamp), deal.Proposal.VerifiedDeal) - } - - _, _ = fmt.Fprintf(w, "%s\t%d\t%s\t%s\t%s\t%s\t%s", propcid, deal.DealID, storagemarket.DealStates[deal.State], deal.Proposal.Client, units.BytesSize(float64(deal.Proposal.PieceSize)), fil, deal.Proposal.Duration()) - if verbose { - tchid := "" - if deal.TransferChannelId != nil { - tchid = deal.TransferChannelId.String() - } - _, _ = fmt.Fprintf(w, "\t%s", tchid) - _, _ = fmt.Fprintf(w, "\t%s", deal.Message) - } - - _, _ = fmt.Fprintln(w) - } - - return w.Flush() -} - -var getBlocklistCmd = &cli.Command{ - Name: "get-blocklist", - Usage: "List the contents of the miner's piece CID blocklist", - Flags: []cli.Flag{ - &CidBaseFlag, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - blocklist, err := api.DealsPieceCidBlocklist(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - for idx := range blocklist { - fmt.Println(encoder.Encode(blocklist[idx])) - } - - return nil - }, -} - -var setBlocklistCmd = &cli.Command{ - Name: "set-blocklist", - Usage: "Set the miner's list of blocklisted piece CIDs", - ArgsUsage: "[ (optional, will read from stdin if omitted)]", - Flags: []cli.Flag{}, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - scanner := bufio.NewScanner(os.Stdin) - if cctx.Args().Present() && cctx.Args().First() != "-" { - absPath, err := filepath.Abs(cctx.Args().First()) - if err != nil { - return err - } - - file, err := os.Open(absPath) - if err != nil { - log.Fatal(err) - } - defer file.Close() //nolint:errcheck - - scanner = bufio.NewScanner(file) - } - - var blocklist []cid.Cid - for scanner.Scan() { - decoded, err := cid.Decode(scanner.Text()) - if err != nil { - return err - } - - blocklist = append(blocklist, decoded) - } - - err = scanner.Err() - if err != nil { - return err - } - - return api.DealsSetPieceCidBlocklist(lcli.DaemonContext(cctx), blocklist) - }, -} - -var resetBlocklistCmd = &cli.Command{ - Name: "reset-blocklist", - Usage: "Remove all entries from the miner's piece CID blocklist", - Flags: []cli.Flag{}, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - return api.DealsSetPieceCidBlocklist(lcli.DaemonContext(cctx), []cid.Cid{}) - }, -} - -var setSealDurationCmd = &cli.Command{ - Name: "set-seal-duration", - Usage: "Set the expected time, in minutes, that you expect sealing sectors to take. Deals that start before this duration will be rejected.", - ArgsUsage: "", - Action: func(cctx *cli.Context) error { - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - hs, err := strconv.ParseUint(cctx.Args().Get(0), 10, 64) - if err != nil { - return xerrors.Errorf("could not parse duration: %w", err) - } - - delay := hs * uint64(time.Minute) - - return nodeApi.SectorSetExpectedSealDuration(ctx, time.Duration(delay)) - }, -} - -var dataTransfersCmd = &cli.Command{ - Name: "data-transfers", - Usage: "Manage data transfers", - Subcommands: []*cli.Command{ - transfersListCmd, - marketRestartTransfer, - marketCancelTransfer, - transfersDiagnosticsCmd, - }, -} - -var marketRestartTransfer = &cli.Command{ - Name: "restart", - Usage: "Force restart a stalled data transfer", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "peerid", - Usage: "narrow to transfer with specific peer", - }, - &cli.BoolFlag{ - Name: "initiator", - Usage: "specify only transfers where peer is/is not initiator", - Value: false, - }, - }, - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return cli.ShowCommandHelp(cctx, cctx.Command.Name) - } - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - transferUint, err := strconv.ParseUint(cctx.Args().First(), 10, 64) - if err != nil { - return fmt.Errorf("Error reading transfer ID: %w", err) - } - transferID := datatransfer.TransferID(transferUint) - initiator := cctx.Bool("initiator") - var other peer.ID - if pidstr := cctx.String("peerid"); pidstr != "" { - p, err := peer.Decode(pidstr) - if err != nil { - return err - } - other = p - } else { - channels, err := nodeApi.MarketListDataTransfers(ctx) - if err != nil { - return err - } - found := false - for _, channel := range channels { - if channel.IsInitiator == initiator && channel.TransferID == transferID { - other = channel.OtherPeer - found = true - break - } - } - if !found { - return errors.New("unable to find matching data transfer") - } - } - - return nodeApi.MarketRestartDataTransfer(ctx, transferID, other, initiator) - }, -} - -var marketCancelTransfer = &cli.Command{ - Name: "cancel", - Usage: "Force cancel a data transfer", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "peerid", - Usage: "narrow to transfer with specific peer", - }, - &cli.BoolFlag{ - Name: "initiator", - Usage: "specify only transfers where peer is/is not initiator", - Value: false, - }, - &cli.DurationFlag{ - Name: "cancel-timeout", - Usage: "time to wait for cancel to be sent to client", - Value: 5 * time.Second, - }, - }, - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return cli.ShowCommandHelp(cctx, cctx.Command.Name) - } - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - transferUint, err := strconv.ParseUint(cctx.Args().First(), 10, 64) - if err != nil { - return fmt.Errorf("Error reading transfer ID: %w", err) - } - transferID := datatransfer.TransferID(transferUint) - initiator := cctx.Bool("initiator") - var other peer.ID - if pidstr := cctx.String("peerid"); pidstr != "" { - p, err := peer.Decode(pidstr) - if err != nil { - return err - } - other = p - } else { - channels, err := nodeApi.MarketListDataTransfers(ctx) - if err != nil { - return err - } - found := false - for _, channel := range channels { - if channel.IsInitiator == initiator && channel.TransferID == transferID { - other = channel.OtherPeer - found = true - break - } - } - if !found { - return errors.New("unable to find matching data transfer") - } - } - - timeoutCtx, cancel := context.WithTimeout(ctx, cctx.Duration("cancel-timeout")) - defer cancel() - return nodeApi.MarketCancelDataTransfer(timeoutCtx, transferID, other, initiator) - }, -} - -var transfersListCmd = &cli.Command{ - Name: "list", - Usage: "List ongoing data transfers for this miner", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - Usage: "print verbose transfer details", - }, - &cli.BoolFlag{ - Name: "completed", - Usage: "show completed data transfers", - }, - &cli.BoolFlag{ - Name: "watch", - Usage: "watch deal updates in real-time, rather than a one time list", - }, - &cli.BoolFlag{ - Name: "show-failed", - Usage: "show failed/cancelled transfers", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - channels, err := api.MarketListDataTransfers(ctx) - if err != nil { - return err - } - - verbose := cctx.Bool("verbose") - completed := cctx.Bool("completed") - watch := cctx.Bool("watch") - showFailed := cctx.Bool("show-failed") - if watch { - channelUpdates, err := api.MarketDataTransferUpdates(ctx) - if err != nil { - return err - } - - for { - tm.Clear() // Clear current screen - - tm.MoveCursor(1, 1) - - lcli.OutputDataTransferChannels(tm.Screen, channels, verbose, completed, showFailed) - - tm.Flush() - - select { - case <-ctx.Done(): - return nil - case channelUpdate := <-channelUpdates: - var found bool - for i, existing := range channels { - if existing.TransferID == channelUpdate.TransferID && - existing.OtherPeer == channelUpdate.OtherPeer && - existing.IsSender == channelUpdate.IsSender && - existing.IsInitiator == channelUpdate.IsInitiator { - channels[i] = channelUpdate - found = true - break - } - } - if !found { - channels = append(channels, channelUpdate) - } - } - } - } - lcli.OutputDataTransferChannels(os.Stdout, channels, verbose, completed, showFailed) - return nil - }, -} - -var transfersDiagnosticsCmd = &cli.Command{ - Name: "diagnostics", - Usage: "Get detailed diagnostics on active transfers with a specific peer", - Flags: []cli.Flag{}, - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return cli.ShowCommandHelp(cctx, cctx.Command.Name) - } - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - targetPeer, err := peer.Decode(cctx.Args().First()) - if err != nil { - return err - } - diagnostics, err := api.MarketDataTransferDiagnostics(ctx, targetPeer) - if err != nil { - return err - } - out, err := json.MarshalIndent(diagnostics, "", "\t") - if err != nil { - return err - } - fmt.Println(string(out)) - return nil - }, -} - -var dealsPendingPublish = &cli.Command{ - Name: "pending-publish", - Usage: "list deals waiting in publish queue", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "publish-now", - Usage: "send a publish message now", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - if cctx.Bool("publish-now") { - if err := api.MarketPublishPendingDeals(ctx); err != nil { - return xerrors.Errorf("publishing deals: %w", err) - } - fmt.Println("triggered deal publishing") - return nil - } - - pending, err := api.MarketPendingDeals(ctx) - if err != nil { - return xerrors.Errorf("getting pending deals: %w", err) - } - - if len(pending.Deals) > 0 { - endsIn := pending.PublishPeriodStart.Add(pending.PublishPeriod).Sub(time.Now()) - w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0) - _, _ = fmt.Fprintf(w, "Publish period: %s (ends in %s)\n", pending.PublishPeriod, endsIn.Round(time.Second)) - _, _ = fmt.Fprintf(w, "First deal queued at: %s\n", pending.PublishPeriodStart) - _, _ = fmt.Fprintf(w, "Deals will be published at: %s\n", pending.PublishPeriodStart.Add(pending.PublishPeriod)) - _, _ = fmt.Fprintf(w, "%d deals queued to be published:\n", len(pending.Deals)) - _, _ = fmt.Fprintf(w, "ProposalCID\tClient\tSize\n") - for _, deal := range pending.Deals { - proposalNd, err := cborutil.AsIpld(&deal) // nolint - if err != nil { - return err - } - - _, _ = fmt.Fprintf(w, "%s\t%s\t%s\n", proposalNd.Cid(), deal.Proposal.Client, units.BytesSize(float64(deal.Proposal.PieceSize))) - } - return w.Flush() - } - - fmt.Println("No deals queued to be published") - return nil - }, -} - -var dealsRetryPublish = &cli.Command{ - Name: "retry-publish", - Usage: "retry publishing a deal", - ArgsUsage: "", - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return cli.ShowCommandHelp(cctx, cctx.Command.Name) - } - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - propcid := cctx.Args().First() - fmt.Printf("retrying deal with proposal-cid: %s\n", propcid) - - cid, err := cid.Decode(propcid) - if err != nil { - return err - } - if err := api.MarketRetryPublishDeal(ctx, cid); err != nil { - return xerrors.Errorf("retrying publishing deal: %w", err) - } - fmt.Println("retried to publish deal") - return nil - }, -} - -func listDealsWithJSON(cctx *cli.Context) error { - node, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.DaemonContext(cctx) - - deals, err := node.MarketListIncompleteDeals(ctx) - if err != nil { - return err - } - - channels, err := node.MarketListDataTransfers(ctx) - if err != nil { - return err - } - - sort.Slice(deals, func(i, j int) bool { - return deals[i].CreationTime.Time().Before(deals[j].CreationTime.Time()) - }) - - channelsByTransferID := map[datatransfer.TransferID]api.DataTransferChannel{} - for _, c := range channels { - channelsByTransferID[c.TransferID] = c - } - - w := json.NewEncoder(os.Stdout) - - for _, deal := range deals { - val := struct { - DateTime string `json:"datetime"` - VerifiedDeal bool `json:"verified-deal"` - ProposalCID string `json:"proposal-cid"` - DealID abi.DealID `json:"deal-id"` - DealStatus string `json:"deal-status"` - Client string `json:"client"` - PieceSize string `json:"piece-size"` - Price types.FIL `json:"price"` - DurationEpochs abi.ChainEpoch `json:"duration-epochs"` - TransferID *datatransfer.TransferID `json:"transfer-id,omitempty"` - TransferStatus string `json:"transfer-status,omitempty"` - TransferredData string `json:"transferred-data,omitempty"` - }{} - - val.DateTime = deal.CreationTime.Time().Format(time.RFC3339) - val.VerifiedDeal = deal.Proposal.VerifiedDeal - val.ProposalCID = deal.ProposalCid.String() - val.DealID = deal.DealID - val.DealStatus = storagemarket.DealStates[deal.State] - val.Client = deal.Proposal.Client.String() - val.PieceSize = units.BytesSize(float64(deal.Proposal.PieceSize)) - val.Price = types.FIL(types.BigMul(deal.Proposal.StoragePricePerEpoch, types.NewInt(uint64(deal.Proposal.Duration())))) - val.DurationEpochs = deal.Proposal.Duration() - - if deal.TransferChannelId != nil { - if c, ok := channelsByTransferID[deal.TransferChannelId.ID]; ok { - val.TransferID = &c.TransferID - val.TransferStatus = datatransfer.Statuses[c.Status] - val.TransferredData = units.BytesSize(float64(c.Transferred)) - } - } - - err := w.Encode(val) - if err != nil { - return err - } - } - - return nil -} diff --git a/cmd/lotus-miner/pieces.go b/cmd/lotus-miner/pieces.go deleted file mode 100644 index a64142237c2..00000000000 --- a/cmd/lotus-miner/pieces.go +++ /dev/null @@ -1,193 +0,0 @@ -package main - -import ( - "fmt" - "os" - "text/tabwriter" - - "github.com/ipfs/go-cid" - "github.com/urfave/cli/v2" - - lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/lib/tablewriter" -) - -var piecesCmd = &cli.Command{ - Name: "pieces", - Usage: "interact with the piecestore", - Description: "The piecestore is a database that tracks and manages data that is made available to the retrieval market", - Subcommands: []*cli.Command{ - piecesListPiecesCmd, - piecesListCidInfosCmd, - piecesInfoCmd, - piecesCidInfoCmd, - }, -} - -var piecesListPiecesCmd = &cli.Command{ - Name: "list-pieces", - Usage: "list registered pieces", - Action: func(cctx *cli.Context) error { - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - pieceCids, err := nodeApi.PiecesListPieces(ctx) - if err != nil { - return err - } - - for _, pc := range pieceCids { - fmt.Println(pc) - } - return nil - }, -} - -var piecesListCidInfosCmd = &cli.Command{ - Name: "list-cids", - Usage: "list registered payload CIDs", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - }, - }, - Action: func(cctx *cli.Context) error { - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - cids, err := nodeApi.PiecesListCidInfos(ctx) - if err != nil { - return err - } - - w := tablewriter.New(tablewriter.Col("CID"), - tablewriter.Col("Piece"), - tablewriter.Col("BlockOffset"), - tablewriter.Col("BlockLen"), - tablewriter.Col("Deal"), - tablewriter.Col("Sector"), - tablewriter.Col("DealOffset"), - tablewriter.Col("DealLen"), - ) - - for _, c := range cids { - if !cctx.Bool("verbose") { - fmt.Println(c) - continue - } - - ci, err := nodeApi.PiecesGetCIDInfo(ctx, c) - if err != nil { - fmt.Printf("Error getting CID info: %s\n", err) - continue - } - - for _, location := range ci.PieceBlockLocations { - pi, err := nodeApi.PiecesGetPieceInfo(ctx, location.PieceCID) - if err != nil { - fmt.Printf("Error getting piece info: %s\n", err) - continue - } - - for _, deal := range pi.Deals { - w.Write(map[string]interface{}{ - "CID": c, - "Piece": location.PieceCID, - "BlockOffset": location.RelOffset, - "BlockLen": location.BlockSize, - "Deal": deal.DealID, - "Sector": deal.SectorID, - "DealOffset": deal.Offset, - "DealLen": deal.Length, - }) - } - } - } - - if cctx.Bool("verbose") { - return w.Flush(os.Stdout) - } - - return nil - }, -} - -var piecesInfoCmd = &cli.Command{ - Name: "piece-info", - Usage: "get registered information for a given piece CID", - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return lcli.ShowHelp(cctx, fmt.Errorf("must specify piece cid")) - } - - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - c, err := cid.Decode(cctx.Args().First()) - if err != nil { - return err - } - - pi, err := nodeApi.PiecesGetPieceInfo(ctx, c) - if err != nil { - return err - } - - fmt.Println("Piece: ", pi.PieceCID) - w := tabwriter.NewWriter(os.Stdout, 4, 4, 2, ' ', 0) - fmt.Fprintln(w, "Deals:\nDealID\tSectorID\tLength\tOffset") - for _, d := range pi.Deals { - fmt.Fprintf(w, "%d\t%d\t%d\t%d\n", d.DealID, d.SectorID, d.Length, d.Offset) - } - return w.Flush() - }, -} - -var piecesCidInfoCmd = &cli.Command{ - Name: "cid-info", - Usage: "get registered information for a given payload CID", - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return lcli.ShowHelp(cctx, fmt.Errorf("must specify payload cid")) - } - - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - c, err := cid.Decode(cctx.Args().First()) - if err != nil { - return err - } - - ci, err := nodeApi.PiecesGetCIDInfo(ctx, c) - if err != nil { - return err - } - - fmt.Println("Info for: ", ci.CID) - - w := tabwriter.NewWriter(os.Stdout, 4, 4, 2, ' ', 0) - fmt.Fprintf(w, "PieceCid\tOffset\tSize\n") - for _, loc := range ci.PieceBlockLocations { - fmt.Fprintf(w, "%s\t%d\t%d\n", loc.PieceCID, loc.RelOffset, loc.BlockSize) - } - return w.Flush() - }, -} diff --git a/cmd/lotus-miner/retrieval-deals.go b/cmd/lotus-miner/retrieval-deals.go deleted file mode 100644 index 42b0fa1f6f8..00000000000 --- a/cmd/lotus-miner/retrieval-deals.go +++ /dev/null @@ -1,231 +0,0 @@ -package main - -import ( - "fmt" - "os" - "text/tabwriter" - - "github.com/docker/go-units" - "github.com/urfave/cli/v2" - - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/chain/types" - lcli "github.com/filecoin-project/lotus/cli" -) - -var retrievalDealsCmd = &cli.Command{ - Name: "retrieval-deals", - Usage: "Manage retrieval deals and related configuration", - Subcommands: []*cli.Command{ - retrievalDealSelectionCmd, - retrievalSetAskCmd, - retrievalGetAskCmd, - }, -} - -var retrievalDealSelectionCmd = &cli.Command{ - Name: "selection", - Usage: "Configure acceptance criteria for retrieval deal proposals", - Subcommands: []*cli.Command{ - retrievalDealSelectionShowCmd, - retrievalDealSelectionResetCmd, - retrievalDealSelectionRejectCmd, - }, -} - -var retrievalDealSelectionShowCmd = &cli.Command{ - Name: "list", - Usage: "List retrieval deal proposal selection criteria", - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - onlineOk, err := smapi.DealsConsiderOnlineRetrievalDeals(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - offlineOk, err := smapi.DealsConsiderOfflineRetrievalDeals(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - fmt.Printf("considering online retrieval deals: %t\n", onlineOk) - fmt.Printf("considering offline retrieval deals: %t\n", offlineOk) - - return nil - }, -} - -var retrievalDealSelectionResetCmd = &cli.Command{ - Name: "reset", - Usage: "Reset retrieval deal proposal selection criteria to default values", - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - err = smapi.DealsSetConsiderOnlineRetrievalDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - err = smapi.DealsSetConsiderOfflineRetrievalDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - return nil - }, -} - -var retrievalDealSelectionRejectCmd = &cli.Command{ - Name: "reject", - Usage: "Configure criteria which necessitate automatic rejection", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "online", - }, - &cli.BoolFlag{ - Name: "offline", - }, - }, - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - if cctx.Bool("online") { - err = smapi.DealsSetConsiderOnlineRetrievalDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - if cctx.Bool("offline") { - err = smapi.DealsSetConsiderOfflineRetrievalDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - return nil - }, -} - -var retrievalSetAskCmd = &cli.Command{ - Name: "set-ask", - Usage: "Configure the provider's retrieval ask", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "price", - Usage: "Set the price of the ask for retrievals (FIL/GiB)", - }, - &cli.StringFlag{ - Name: "unseal-price", - Usage: "Set the price to unseal", - }, - &cli.StringFlag{ - Name: "payment-interval", - Usage: "Set the payment interval (in bytes) for retrieval", - DefaultText: "1MiB", - }, - &cli.StringFlag{ - Name: "payment-interval-increase", - Usage: "Set the payment interval increase (in bytes) for retrieval", - DefaultText: "1MiB", - }, - }, - Action: func(cctx *cli.Context) error { - ctx := lcli.DaemonContext(cctx) - - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ask, err := api.MarketGetRetrievalAsk(ctx) - if err != nil { - return err - } - - if cctx.IsSet("price") { - v, err := types.ParseFIL(cctx.String("price")) - if err != nil { - return err - } - ask.PricePerByte = types.BigDiv(types.BigInt(v), types.NewInt(1<<30)) - } - - if cctx.IsSet("unseal-price") { - v, err := types.ParseFIL(cctx.String("unseal-price")) - if err != nil { - return err - } - ask.UnsealPrice = abi.TokenAmount(v) - } - - if cctx.IsSet("payment-interval") { - v, err := units.RAMInBytes(cctx.String("payment-interval")) - if err != nil { - return err - } - ask.PaymentInterval = uint64(v) - } - - if cctx.IsSet("payment-interval-increase") { - v, err := units.RAMInBytes(cctx.String("payment-interval-increase")) - if err != nil { - return err - } - ask.PaymentIntervalIncrease = uint64(v) - } - - return api.MarketSetRetrievalAsk(ctx, ask) - }, -} - -var retrievalGetAskCmd = &cli.Command{ - Name: "get-ask", - Usage: "Get the provider's current retrieval ask configured by the provider in the ask-store using the set-ask CLI command", - Flags: []cli.Flag{}, - Action: func(cctx *cli.Context) error { - ctx := lcli.DaemonContext(cctx) - - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ask, err := api.MarketGetRetrievalAsk(ctx) - if err != nil { - return err - } - - w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0) - _, _ = fmt.Fprintf(w, "Price per Byte\tUnseal Price\tPayment Interval\tPayment Interval Increase\n") - if ask == nil { - _, _ = fmt.Fprintf(w, "\n") - return w.Flush() - } - - _, _ = fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", - types.FIL(ask.PricePerByte), - types.FIL(ask.UnsealPrice), - units.BytesSize(float64(ask.PaymentInterval)), - units.BytesSize(float64(ask.PaymentIntervalIncrease)), - ) - return w.Flush() - - }, -} diff --git a/cmd/lotus-miner/sectors.go b/cmd/lotus-miner/sectors.go index cf32f424895..c05cf37e614 100644 --- a/cmd/lotus-miner/sectors.go +++ b/cmd/lotus-miner/sectors.go @@ -45,7 +45,6 @@ var sectorsCmd = &cli.Command{ Subcommands: []*cli.Command{ spcli.SectorsStatusCmd(LMActorOrEnvGetter, getOnDiskInfo), sectorsListCmd, - sectorsRefsCmd, sectorsUpdateCmd, sectorsPledgeCmd, sectorsNumbersCmd, @@ -584,32 +583,6 @@ var sectorsListUpgradeBoundsCmd = &cli.Command{ }, } -var sectorsRefsCmd = &cli.Command{ - Name: "refs", - Usage: "List References to sectors", - Action: func(cctx *cli.Context) error { - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - refs, err := nodeApi.SectorsRefs(ctx) - if err != nil { - return err - } - - for name, refs := range refs { - fmt.Printf("Block %s:\n", name) - for _, ref := range refs { - fmt.Printf("\t%d+%d %d bytes\n", ref.SectorID, ref.Offset, ref.Size) - } - } - return nil - }, -} - var sectorsTerminateCmd = &cli.Command{ Name: "terminate", Usage: "Terminate sector on-chain then remove (WARNING: This means losing power and collateral for the removed sector)", diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index eb20c634bbd..917d9f7dcc7 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -598,7 +598,6 @@ USAGE: COMMANDS: status Get the seal status of a sector by its number list List sectors - refs List References to sectors update-state ADVANCED: manually update the state of a sector, this may aid in error recovery pledge store random data in a sector numbers manage sector number assignments @@ -678,18 +677,6 @@ OPTIONS: --help, -h show help ``` -### lotus-miner sectors refs -``` -NAME: - lotus-miner sectors refs - List References to sectors - -USAGE: - lotus-miner sectors refs [command options] [arguments...] - -OPTIONS: - --help, -h show help -``` - ### lotus-miner sectors update-state ``` NAME: diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md index 36e28948c0f..3074f68fee8 100644 --- a/documentation/en/cli-lotus.md +++ b/documentation/en/cli-lotus.md @@ -19,7 +19,6 @@ COMMANDS: send Send funds between accounts wallet Manage wallet info Print node info - client Make deals, store data, retrieve data msig Interact with a multisig wallet filplus Interact with the verified registry actor used by Filplus paych Manage payment channels @@ -403,515 +402,6 @@ OPTIONS: --help, -h show help ``` -## lotus client -``` -NAME: - lotus client - Make deals, store data, retrieve data - -USAGE: - lotus client command [command options] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - DATA: - import Import data - drop Remove import - local List locally imported data - stat Print information about a locally stored file (piece size, etc) - RETRIEVAL: - find Find data in the network - retrieval-ask Get a miner's retrieval ask - retrieve Retrieve data from network - cat Show data from network - ls List object links - cancel-retrieval Cancel a retrieval deal by deal ID; this also cancels the associated transfer - list-retrievals List retrieval market deals - STORAGE: - deal Initialize storage deal with a miner - query-ask Find a miners ask - list-deals List storage market deals - get-deal Print detailed deal information - list-asks List asks for top miners - deal-stats Print statistics about local storage deals - inspect-deal Inspect detailed information about deal's lifecycle and the various stages it goes through - UTIL: - commP Calculate the piece-cid (commP) of a CAR file - generate-car Generate a car file from input - balances Print storage market client balances - list-transfers List ongoing data transfers for deals - restart-transfer Force restart a stalled data transfer - cancel-transfer Force cancel a data transfer - -OPTIONS: - --help, -h show help -``` - -### lotus client import -``` -NAME: - lotus client import - Import data - -USAGE: - lotus client import [command options] [inputPath] - -CATEGORY: - DATA - -OPTIONS: - --car import from a car file instead of a regular file (default: false) - --quiet, -q Output root CID only (default: false) - --help, -h show help -``` - -### lotus client drop -``` -NAME: - lotus client drop - Remove import - -USAGE: - lotus client drop [command options] [import ID...] - -CATEGORY: - DATA - -OPTIONS: - --help, -h show help -``` - -### lotus client local -``` -NAME: - lotus client local - List locally imported data - -USAGE: - lotus client local [command options] [arguments...] - -CATEGORY: - DATA - -OPTIONS: - --help, -h show help -``` - -### lotus client stat -``` -NAME: - lotus client stat - Print information about a locally stored file (piece size, etc) - -USAGE: - lotus client stat [command options] - -CATEGORY: - DATA - -OPTIONS: - --help, -h show help -``` - -### lotus client find -``` -NAME: - lotus client find - Find data in the network - -USAGE: - lotus client find [command options] [dataCid] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --pieceCid value require data to be retrieved from a specific Piece CID - --help, -h show help -``` - -### lotus client retrieval-ask -``` -NAME: - lotus client retrieval-ask - Get a miner's retrieval ask - -USAGE: - lotus client retrieval-ask [command options] [minerAddress] [data CID] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --size value data size in bytes (default: 0) - --help, -h show help -``` - -### lotus client retrieve -``` -NAME: - lotus client retrieve - Retrieve data from network - -USAGE: - lotus client retrieve [command options] [dataCid outputPath] - -CATEGORY: - RETRIEVAL - -DESCRIPTION: - Retrieve data from the Filecoin network. - - The retrieve command will attempt to find a provider make a retrieval deal with - them. In case a provider can't be found, it can be specified with the --provider - flag. - - By default the data will be interpreted as DAG-PB UnixFSv1 File. Alternatively - a CAR file containing the raw IPLD graph can be exported by setting the --car - flag. - - Partial Retrieval: - - The --data-selector flag can be used to specify a sub-graph to fetch. The - selector can be specified as either IPLD datamodel text-path selector, or IPLD - json selector. - - In case of unixfs retrieval, the selector must point at a single root node, and - match the entire graph under that node. - - In case of CAR retrieval, the selector must have one common "sub-root" node. - - Examples: - - - Retrieve a file by CID - $ lotus client retrieve Qm... my-file.txt - - - Retrieve a file by CID from f0123 - $ lotus client retrieve --provider f0123 Qm... my-file.txt - - - Retrieve a first file from a specified directory - $ lotus client retrieve --data-selector /Links/0/Hash Qm... my-file.txt - - -OPTIONS: - --car Export to a car file instead of a regular file (default: false) - --data-selector value, --datamodel-path-selector value IPLD datamodel text-path selector, or IPLD json selector - --car-export-merkle-proof (requires --data-selector and --car) Export data-selector merkle proof (default: false) - --from value address to send transactions from - --provider value, --miner value provider to use for retrieval, if not present it'll use local discovery - --maxPrice value maximum price the client is willing to consider (default: 0 FIL) - --pieceCid value require data to be retrieved from a specific Piece CID - --allow-local (default: false) - --help, -h show help -``` - -### lotus client cat -``` -NAME: - lotus client cat - Show data from network - -USAGE: - lotus client cat [command options] [dataCid] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --ipld list IPLD datamodel links (default: false) - --data-selector value IPLD datamodel text-path selector, or IPLD json selector - --from value address to send transactions from - --provider value, --miner value provider to use for retrieval, if not present it'll use local discovery - --maxPrice value maximum price the client is willing to consider (default: 0 FIL) - --pieceCid value require data to be retrieved from a specific Piece CID - --allow-local (default: false) - --help, -h show help -``` - -### lotus client ls -``` -NAME: - lotus client ls - List object links - -USAGE: - lotus client ls [command options] [dataCid] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --ipld list IPLD datamodel links (default: false) - --depth value list links recursively up to the specified depth (default: 1) - --data-selector value IPLD datamodel text-path selector, or IPLD json selector - --from value address to send transactions from - --provider value, --miner value provider to use for retrieval, if not present it'll use local discovery - --maxPrice value maximum price the client is willing to consider (default: 0 FIL) - --pieceCid value require data to be retrieved from a specific Piece CID - --allow-local (default: false) - --help, -h show help -``` - -### lotus client cancel-retrieval -``` -NAME: - lotus client cancel-retrieval - Cancel a retrieval deal by deal ID; this also cancels the associated transfer - -USAGE: - lotus client cancel-retrieval [command options] [arguments...] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --deal-id value specify retrieval deal by deal ID (default: 0) - --help, -h show help -``` - -### lotus client list-retrievals -``` -NAME: - lotus client list-retrievals - List retrieval market deals - -USAGE: - lotus client list-retrievals [command options] [arguments...] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --verbose, -v print verbose deal details (default: false) - --show-failed show failed/failing deals (default: true) - --completed show completed retrievals (default: false) - --watch watch deal updates in real-time, rather than a one time list (default: false) - --help, -h show help -``` - -### lotus client deal -``` -NAME: - lotus client deal - Initialize storage deal with a miner - -USAGE: - lotus client deal [command options] [dataCid miner price duration] - -CATEGORY: - STORAGE - -DESCRIPTION: - Make a deal with a miner. - dataCid comes from running 'lotus client import'. - miner is the address of the miner you wish to make a deal with. - price is measured in FIL/Epoch. Miners usually don't accept a bid - lower than their advertised ask (which is in FIL/GiB/Epoch). You can check a miners listed price - with 'lotus client query-ask '. - duration is how long the miner should store the data for, in blocks. - The minimum value is 518400 (6 months). - -OPTIONS: - --manual-piece-cid value manually specify piece commitment for data (dataCid must be to a car file) - --manual-piece-size value if manually specifying piece cid, used to specify size (dataCid must be to a car file) (default: 0) - --manual-stateless-deal instructs the node to send an offline deal without registering it with the deallist/fsm (default: false) - --from value specify address to fund the deal with - --start-epoch value specify the epoch that the deal should start at (default: -1) - --fast-retrieval indicates that data should be available for fast retrieval (default: true) - --verified-deal indicate that the deal counts towards verified client total (default: true if client is verified, false otherwise) - --provider-collateral value specify the requested provider collateral the miner should put up - --help, -h show help -``` - -### lotus client query-ask -``` -NAME: - lotus client query-ask - Find a miners ask - -USAGE: - lotus client query-ask [command options] [minerAddress] - -CATEGORY: - STORAGE - -OPTIONS: - --peerid value specify peer ID of node to make query against - --size value data size in bytes (default: 0) - --duration value deal duration (default: 0) - --help, -h show help -``` - -### lotus client list-deals -``` -NAME: - lotus client list-deals - List storage market deals - -USAGE: - lotus client list-deals [command options] [arguments...] - -CATEGORY: - STORAGE - -OPTIONS: - --verbose, -v print verbose deal details (default: false) - --show-failed show failed/failing deals (default: false) - --watch watch deal updates in real-time, rather than a one time list (default: false) - --help, -h show help -``` - -### lotus client get-deal -``` -NAME: - lotus client get-deal - Print detailed deal information - -USAGE: - lotus client get-deal [command options] [proposalCID] - -CATEGORY: - STORAGE - -OPTIONS: - --help, -h show help -``` - -### lotus client list-asks -``` -NAME: - lotus client list-asks - List asks for top miners - -USAGE: - lotus client list-asks [command options] [arguments...] - -CATEGORY: - STORAGE - -OPTIONS: - --by-ping sort by ping (default: false) - --output-format value Either 'text' or 'csv' (default: "text") - --protocols Output supported deal protocols (default: false) - --help, -h show help -``` - -### lotus client deal-stats -``` -NAME: - lotus client deal-stats - Print statistics about local storage deals - -USAGE: - lotus client deal-stats [command options] [arguments...] - -CATEGORY: - STORAGE - -OPTIONS: - --newer-than value (default: 0s) - --help, -h show help -``` - -### lotus client inspect-deal -``` -NAME: - lotus client inspect-deal - Inspect detailed information about deal's lifecycle and the various stages it goes through - -USAGE: - lotus client inspect-deal [command options] [arguments...] - -CATEGORY: - STORAGE - -OPTIONS: - --deal-id value (default: 0) - --proposal-cid value - --help, -h show help -``` - -### lotus client commP -``` -NAME: - lotus client commP - Calculate the piece-cid (commP) of a CAR file - -USAGE: - lotus client commP [command options] [inputFile] - -CATEGORY: - UTIL - -OPTIONS: - --help, -h show help -``` - -### lotus client generate-car -``` -NAME: - lotus client generate-car - Generate a car file from input - -USAGE: - lotus client generate-car [command options] [inputPath outputPath] - -CATEGORY: - UTIL - -OPTIONS: - --help, -h show help -``` - -### lotus client balances -``` -NAME: - lotus client balances - Print storage market client balances - -USAGE: - lotus client balances [command options] [arguments...] - -CATEGORY: - UTIL - -OPTIONS: - --client value specify storage client address - --help, -h show help -``` - -### lotus client list-transfers -``` -NAME: - lotus client list-transfers - List ongoing data transfers for deals - -USAGE: - lotus client list-transfers [command options] [arguments...] - -CATEGORY: - UTIL - -OPTIONS: - --verbose, -v print verbose transfer details (default: false) - --completed show completed data transfers (default: false) - --watch watch deal updates in real-time, rather than a one time list (default: false) - --show-failed show failed/cancelled transfers (default: false) - --help, -h show help -``` - -### lotus client restart-transfer -``` -NAME: - lotus client restart-transfer - Force restart a stalled data transfer - -USAGE: - lotus client restart-transfer [command options] [transferID] - -CATEGORY: - UTIL - -OPTIONS: - --peerid value narrow to transfer with specific peer - --initiator specify only transfers where peer is/is not initiator (default: true) - --help, -h show help -``` - -### lotus client cancel-transfer -``` -NAME: - lotus client cancel-transfer - Force cancel a data transfer - -USAGE: - lotus client cancel-transfer [command options] [transferID] - -CATEGORY: - UTIL - -OPTIONS: - --peerid value narrow to transfer with specific peer - --initiator specify only transfers where peer is/is not initiator (default: true) - --cancel-timeout value time to wait for cancel to be sent to storage provider (default: 5s) - --help, -h show help -``` - ## lotus msig ``` NAME: From 74dbabb8f3d71045a3aa74e9012b66e329a0511e Mon Sep 17 00:00:00 2001 From: aarshkshah1992 Date: Thu, 16 May 2024 11:41:32 +0530 Subject: [PATCH 3/6] remove markets from all CLI --- cli/client_retr.go | 550 ----------------------------------------- cli/info.go | 54 ---- cmd/lotus-shed/main.go | 1 - cmd/lotus-shed/misc.go | 40 --- 4 files changed, 645 deletions(-) delete mode 100644 cli/client_retr.go delete mode 100644 cmd/lotus-shed/misc.go diff --git a/cli/client_retr.go b/cli/client_retr.go deleted file mode 100644 index fa8164ab5ef..00000000000 --- a/cli/client_retr.go +++ /dev/null @@ -1,550 +0,0 @@ -package cli - -import ( - "bytes" - "context" - "fmt" - "io" - "os" - "sort" - "strings" - "time" - - "github.com/ipfs/boxo/blockservice" - offline "github.com/ipfs/boxo/exchange/offline" - "github.com/ipfs/boxo/ipld/merkledag" - "github.com/ipfs/go-cid" - carv2 "github.com/ipld/go-car/v2" - "github.com/ipld/go-car/v2/blockstore" - "github.com/ipld/go-ipld-prime" - "github.com/ipld/go-ipld-prime/codec/dagjson" - basicnode "github.com/ipld/go-ipld-prime/node/basic" - "github.com/ipld/go-ipld-prime/traversal" - "github.com/ipld/go-ipld-prime/traversal/selector" - "github.com/ipld/go-ipld-prime/traversal/selector/builder" - selectorparse "github.com/ipld/go-ipld-prime/traversal/selector/parse" - textselector "github.com/ipld/go-ipld-selector-text-lite" - "github.com/urfave/cli/v2" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-state-types/big" - - lapi "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/chain/types" - cliutil "github.com/filecoin-project/lotus/cli/util" - "github.com/filecoin-project/lotus/markets/utils" - "github.com/filecoin-project/lotus/node/repo" -) - -const DefaultMaxRetrievePrice = "0" - -func retrieve(ctx context.Context, cctx *cli.Context, fapi lapi.FullNode, sel *lapi.Selector, printf func(string, ...interface{})) (*lapi.ExportRef, error) { - var payer address.Address - var err error - if cctx.String("from") != "" { - payer, err = address.NewFromString(cctx.String("from")) - } else { - payer, err = fapi.WalletDefaultAddress(ctx) - } - if err != nil { - return nil, err - } - - file, err := cid.Parse(cctx.Args().Get(0)) - if err != nil { - return nil, err - } - - var pieceCid *cid.Cid - if cctx.String("pieceCid") != "" { - parsed, err := cid.Parse(cctx.String("pieceCid")) - if err != nil { - return nil, err - } - pieceCid = &parsed - } - - var eref *lapi.ExportRef - if cctx.Bool("allow-local") { - imports, err := fapi.ClientListImports(ctx) - if err != nil { - return nil, err - } - - for _, i := range imports { - if i.Root != nil && i.Root.Equals(file) { - eref = &lapi.ExportRef{ - Root: file, - FromLocalCAR: i.CARPath, - } - break - } - } - } - - // no local found, so make a retrieval - if eref == nil { - var offer lapi.QueryOffer - minerStrAddr := cctx.String("provider") - if minerStrAddr == "" { // Local discovery - offers, err := fapi.ClientFindData(ctx, file, pieceCid) - - var cleaned []lapi.QueryOffer - // filter out offers that errored - for _, o := range offers { - if o.Err == "" { - cleaned = append(cleaned, o) - } - } - - offers = cleaned - - // sort by price low to high - sort.Slice(offers, func(i, j int) bool { - return offers[i].MinPrice.LessThan(offers[j].MinPrice) - }) - if err != nil { - return nil, err - } - - // TODO: parse offer strings from `client find`, make this smarter - if len(offers) < 1 { - fmt.Println("Failed to find file") - return nil, nil - } - offer = offers[0] - } else { // Directed retrieval - minerAddr, err := address.NewFromString(minerStrAddr) - if err != nil { - return nil, err - } - offer, err = fapi.ClientMinerQueryOffer(ctx, minerAddr, file, pieceCid) - if err != nil { - return nil, err - } - } - if offer.Err != "" { - return nil, fmt.Errorf("offer error: %s", offer.Err) - } - - maxPrice := types.MustParseFIL(DefaultMaxRetrievePrice) - - if cctx.String("maxPrice") != "" { - maxPrice, err = types.ParseFIL(cctx.String("maxPrice")) - if err != nil { - return nil, xerrors.Errorf("parsing maxPrice: %w", err) - } - } - - if offer.MinPrice.GreaterThan(big.Int(maxPrice)) { - return nil, xerrors.Errorf("failed to find offer satisfying maxPrice: %s. Try increasing maxPrice", maxPrice) - } - - o := offer.Order(payer) - o.DataSelector = sel - - subscribeEvents, err := fapi.ClientGetRetrievalUpdates(ctx) - if err != nil { - return nil, xerrors.Errorf("error setting up retrieval updates: %w", err) - } - retrievalRes, err := fapi.ClientRetrieve(ctx, o) - if err != nil { - return nil, xerrors.Errorf("error setting up retrieval: %w", err) - } - - start := time.Now() - readEvents: - for { - var evt lapi.RetrievalInfo - select { - case <-ctx.Done(): - return nil, xerrors.New("Retrieval Timed Out") - case evt = <-subscribeEvents: - if evt.ID != retrievalRes.DealID { - // we can't check the deal ID ahead of time because: - // 1. We need to subscribe before retrieving. - // 2. We won't know the deal ID until after retrieving. - continue - } - } - - event := "New" - if evt.Event != nil { - event = retrievalmarket.ClientEvents[*evt.Event] - } - - printf("Recv %s, Paid %s, %s (%s), %s [%d|%d]\n", - types.SizeStr(types.NewInt(evt.BytesReceived)), - types.FIL(evt.TotalPaid), - strings.TrimPrefix(event, "ClientEvent"), - strings.TrimPrefix(retrievalmarket.DealStatuses[evt.Status], "DealStatus"), - time.Now().Sub(start).Truncate(time.Millisecond), - evt.ID, - types.NewInt(evt.BytesReceived), - ) - - switch evt.Status { - case retrievalmarket.DealStatusCompleted: - break readEvents - case retrievalmarket.DealStatusRejected: - return nil, xerrors.Errorf("Retrieval Proposal Rejected: %s", evt.Message) - case retrievalmarket.DealStatusCancelled: - return nil, xerrors.Errorf("Retrieval Proposal Cancelled: %s", evt.Message) - case - retrievalmarket.DealStatusDealNotFound, - retrievalmarket.DealStatusErrored: - return nil, xerrors.Errorf("Retrieval Error: %s", evt.Message) - } - } - - eref = &lapi.ExportRef{ - Root: file, - DealID: retrievalRes.DealID, - } - } - - return eref, nil -} - -var retrFlagsCommon = []cli.Flag{ - &cli.StringFlag{ - Name: "from", - Usage: "address to send transactions from", - }, - &cli.StringFlag{ - Name: "provider", - Usage: "provider to use for retrieval, if not present it'll use local discovery", - Aliases: []string{"miner"}, - }, - &cli.StringFlag{ - Name: "maxPrice", - Usage: fmt.Sprintf("maximum price the client is willing to consider (default: %s FIL)", DefaultMaxRetrievePrice), - }, - &cli.StringFlag{ - Name: "pieceCid", - Usage: "require data to be retrieved from a specific Piece CID", - }, - &cli.BoolFlag{ - Name: "allow-local", - // todo: default to true? - }, -} - -var clientRetrieveCmd = &cli.Command{ - Name: "retrieve", - Usage: "Retrieve data from network", - ArgsUsage: "[dataCid outputPath]", - Description: `Retrieve data from the Filecoin network. - -The retrieve command will attempt to find a provider make a retrieval deal with -them. In case a provider can't be found, it can be specified with the --provider -flag. - -By default the data will be interpreted as DAG-PB UnixFSv1 File. Alternatively -a CAR file containing the raw IPLD graph can be exported by setting the --car -flag. - -Partial Retrieval: - -The --data-selector flag can be used to specify a sub-graph to fetch. The -selector can be specified as either IPLD datamodel text-path selector, or IPLD -json selector. - -In case of unixfs retrieval, the selector must point at a single root node, and -match the entire graph under that node. - -In case of CAR retrieval, the selector must have one common "sub-root" node. - -Examples: - -- Retrieve a file by CID - $ lotus client retrieve Qm... my-file.txt - -- Retrieve a file by CID from f0123 - $ lotus client retrieve --provider f0123 Qm... my-file.txt - -- Retrieve a first file from a specified directory - $ lotus client retrieve --data-selector /Links/0/Hash Qm... my-file.txt -`, - Flags: append([]cli.Flag{ - &cli.BoolFlag{ - Name: "car", - Usage: "Export to a car file instead of a regular file", - }, - &cli.StringFlag{ - Name: "data-selector", - Aliases: []string{"datamodel-path-selector"}, - Usage: "IPLD datamodel text-path selector, or IPLD json selector", - }, - &cli.BoolFlag{ - Name: "car-export-merkle-proof", - Usage: "(requires --data-selector and --car) Export data-selector merkle proof", - }, - }, retrFlagsCommon...), - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 2 { - return IncorrectNumArgs(cctx) - } - - if cctx.Bool("car-export-merkle-proof") { - if !cctx.Bool("car") || !cctx.IsSet("data-selector") { - return ShowHelp(cctx, fmt.Errorf("--car-export-merkle-proof requires --car and --data-selector")) - } - } - - fapi, closer, err := GetFullNodeAPIV1(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - afmt := NewAppFmt(cctx.App) - - var s *lapi.Selector - if sel := lapi.Selector(cctx.String("data-selector")); sel != "" { - s = &sel - } - - eref, err := retrieve(ctx, cctx, fapi, s, afmt.Printf) - if err != nil { - return err - } - if eref == nil { - return xerrors.Errorf("failed to find providers") - } - - if s != nil { - eref.DAGs = append(eref.DAGs, lapi.DagSpec{DataSelector: s, ExportMerkleProof: cctx.Bool("car-export-merkle-proof")}) - } - - err = fapi.ClientExport(ctx, *eref, lapi.FileRef{ - Path: cctx.Args().Get(1), - IsCAR: cctx.Bool("car"), - }) - if err != nil { - return err - } - afmt.Println("Success") - return nil - }, -} - -var clientRetrieveCatCmd = &cli.Command{ - Name: "cat", - Usage: "Show data from network", - ArgsUsage: "[dataCid]", - Flags: append([]cli.Flag{ - &cli.BoolFlag{ - Name: "ipld", - Usage: "list IPLD datamodel links", - }, - &cli.StringFlag{ - Name: "data-selector", - Usage: "IPLD datamodel text-path selector, or IPLD json selector", - }, - }, retrFlagsCommon...), - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - ainfo, err := GetAPIInfo(cctx, repo.FullNode) - if err != nil { - return xerrors.Errorf("could not get API info: %w", err) - } - - fapi, closer, err := GetFullNodeAPIV1(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - afmt := NewAppFmt(cctx.App) - - sel := lapi.Selector(cctx.String("data-selector")) - selp := &sel - if sel == "" { - selp = nil - } - - eref, err := retrieve(ctx, cctx, fapi, selp, afmt.Printf) - if err != nil { - return err - } - - fmt.Println() // separate retrieval events from results - - if sel != "" { - eref.DAGs = append(eref.DAGs, lapi.DagSpec{DataSelector: &sel}) - } - - rc, err := cliutil.ClientExportStream(ainfo.Addr, ainfo.AuthHeader(), *eref, false) - if err != nil { - return err - } - defer rc.Close() // nolint - - _, err = io.Copy(os.Stdout, rc) - return err - }, -} - -func pathToSel(psel string, matchTraversal bool, sub builder.SelectorSpec) (lapi.Selector, error) { - rs, err := textselector.SelectorSpecFromPath(textselector.Expression(psel), matchTraversal, sub) - if err != nil { - return "", xerrors.Errorf("failed to parse path-selector: %w", err) - } - - var b bytes.Buffer - if err := dagjson.Encode(rs.Node(), &b); err != nil { - return "", err - } - - return lapi.Selector(b.String()), nil -} - -var clientRetrieveLsCmd = &cli.Command{ - Name: "ls", - Usage: "List object links", - ArgsUsage: "[dataCid]", - Flags: append([]cli.Flag{ - &cli.BoolFlag{ - Name: "ipld", - Usage: "list IPLD datamodel links", - }, - &cli.IntFlag{ - Name: "depth", - Usage: "list links recursively up to the specified depth", - Value: 1, - }, - &cli.StringFlag{ - Name: "data-selector", - Usage: "IPLD datamodel text-path selector, or IPLD json selector", - }, - }, retrFlagsCommon...), - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - ainfo, err := GetAPIInfo(cctx, repo.FullNode) - if err != nil { - return xerrors.Errorf("could not get API info: %w", err) - } - - fapi, closer, err := GetFullNodeAPIV1(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - afmt := NewAppFmt(cctx.App) - - dataSelector := lapi.Selector(fmt.Sprintf(`{"R":{"l":{"depth":%d},":>":{"a":{">":{"|":[{"@":{}},{".":{}}]}}}}}`, cctx.Int("depth"))) - - if cctx.IsSet("data-selector") { - ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any) - dataSelector, err = pathToSel(cctx.String("data-selector"), cctx.Bool("ipld"), - ssb.ExploreUnion( - ssb.Matcher(), - ssb.ExploreAll( - ssb.ExploreRecursive(selector.RecursionLimitDepth(int64(cctx.Int("depth"))), ssb.ExploreAll(ssb.ExploreUnion(ssb.Matcher(), ssb.ExploreRecursiveEdge()))), - ))) - if err != nil { - return xerrors.Errorf("parsing datamodel path: %w", err) - } - } - - eref, err := retrieve(ctx, cctx, fapi, &dataSelector, afmt.Printf) - if err != nil { - return xerrors.Errorf("retrieve: %w", err) - } - - fmt.Println() // separate retrieval events from results - - eref.DAGs = append(eref.DAGs, lapi.DagSpec{ - DataSelector: &dataSelector, - }) - - rc, err := cliutil.ClientExportStream(ainfo.Addr, ainfo.AuthHeader(), *eref, true) - if err != nil { - return xerrors.Errorf("export: %w", err) - } - defer rc.Close() // nolint - - var memcar bytes.Buffer - _, err = io.Copy(&memcar, rc) - if err != nil { - return err - } - - cbs, err := blockstore.NewReadOnly(&bytesReaderAt{bytes.NewReader(memcar.Bytes())}, nil, - carv2.ZeroLengthSectionAsEOF(true), - blockstore.UseWholeCIDs(true)) - if err != nil { - return xerrors.Errorf("opening car blockstore: %w", err) - } - - roots, err := cbs.Roots() - if err != nil { - return xerrors.Errorf("getting roots: %w", err) - } - - if len(roots) != 1 { - return xerrors.Errorf("expected 1 car root, got %d", len(roots)) - } - dserv := merkledag.NewDAGService(blockservice.New(cbs, offline.Exchange(cbs))) - - if !cctx.Bool("ipld") { - links, err := dserv.GetLinks(ctx, roots[0]) - if err != nil { - return xerrors.Errorf("getting links: %w", err) - } - - for _, link := range links { - fmt.Printf("%s %s\t%d\n", link.Cid, link.Name, link.Size) - } - } else { - jsel := lapi.Selector(fmt.Sprintf(`{"R":{"l":{"depth":%d},":>":{"a":{">":{"|":[{"@":{}},{".":{}}]}}}}}`, cctx.Int("depth"))) - - if cctx.IsSet("data-selector") { - ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any) - jsel, err = pathToSel(cctx.String("data-selector"), false, - ssb.ExploreRecursive(selector.RecursionLimitDepth(int64(cctx.Int("depth"))), ssb.ExploreAll(ssb.ExploreUnion(ssb.Matcher(), ssb.ExploreRecursiveEdge()))), - ) - } - - sel, _ := selectorparse.ParseJSONSelector(string(jsel)) - - if err := utils.TraverseDag( - ctx, - dserv, - roots[0], - sel, - nil, - func(p traversal.Progress, n ipld.Node, r traversal.VisitReason) error { - if r == traversal.VisitReason_SelectionMatch { - fmt.Println(p.Path) - } - return nil - }, - ); err != nil { - return err - } - } - - return err - }, -} - -type bytesReaderAt struct { - btr *bytes.Reader -} - -func (b bytesReaderAt) ReadAt(p []byte, off int64) (n int, err error) { - return b.btr.ReadAt(p, off) -} - -var _ io.ReaderAt = &bytesReaderAt{} diff --git a/cli/info.go b/cli/info.go index 01f64dee9b4..4b87c5dcafa 100644 --- a/cli/info.go +++ b/cli/info.go @@ -3,9 +3,7 @@ package cli import ( "context" "fmt" - "math" "os" - "sort" "strings" "text/tabwriter" "time" @@ -14,7 +12,6 @@ import ( "github.com/fatih/color" "github.com/urfave/cli/v2" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/lotus/api/v1api" @@ -155,57 +152,6 @@ func infoCmdAct(cctx *cli.Context) error { fmt.Printf("Payment Channels: %v channels\n", len(chs)) } fmt.Println() - - localDeals, err := fullapi.ClientListDeals(ctx) - if err != nil { - return err - } - - var totalSize uint64 - byState := map[storagemarket.StorageDealStatus][]uint64{} - for _, deal := range localDeals { - totalSize += deal.Size - byState[deal.State] = append(byState[deal.State], deal.Size) - } - - fmt.Printf("Deals: %d, %s\n", len(localDeals), types.SizeStr(types.NewInt(totalSize))) - - type stateStat struct { - state storagemarket.StorageDealStatus - count int - bytes uint64 - } - - stateStats := make([]stateStat, 0, len(byState)) - for state, deals := range byState { - if state == storagemarket.StorageDealActive { - state = math.MaxUint64 // for sort - } - - st := stateStat{ - state: state, - count: len(deals), - } - for _, b := range deals { - st.bytes += b - } - - stateStats = append(stateStats, st) - } - - sort.Slice(stateStats, func(i, j int) bool { - return int64(stateStats[i].state) < int64(stateStats[j].state) - }) - - for _, st := range stateStats { - if st.state == math.MaxUint64 { - st.state = storagemarket.StorageDealActive - } - fmt.Printf(" %s: %d deals, %s\n", storagemarket.DealStates[st.state], st.count, types.SizeStr(types.NewInt(st.bytes))) - } - - fmt.Println() - tw := tabwriter.NewWriter(os.Stdout, 6, 6, 2, ' ', 0) s, err := fullapi.NetBandwidthStats(ctx) diff --git a/cmd/lotus-shed/main.go b/cmd/lotus-shed/main.go index b04b271def8..1ecd5122b54 100644 --- a/cmd/lotus-shed/main.go +++ b/cmd/lotus-shed/main.go @@ -48,7 +48,6 @@ func main() { proofsCmd, verifRegCmd, marketCmd, - miscCmd, mpoolCmd, helloCmd, genesisVerifyCmd, diff --git a/cmd/lotus-shed/misc.go b/cmd/lotus-shed/misc.go deleted file mode 100644 index cfda362c497..00000000000 --- a/cmd/lotus-shed/misc.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import ( - "fmt" - "strconv" - - "github.com/urfave/cli/v2" - - "github.com/filecoin-project/go-fil-markets/storagemarket" -) - -var miscCmd = &cli.Command{ - Name: "misc", - Usage: "Assorted unsorted commands for various purposes", - Flags: []cli.Flag{}, - Subcommands: []*cli.Command{ - dealStateMappingCmd, - }, -} - -var dealStateMappingCmd = &cli.Command{ - Name: "deal-state", - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return cli.ShowCommandHelp(cctx, cctx.Command.Name) - } - - num, err := strconv.Atoi(cctx.Args().First()) - if err != nil { - return err - } - - ststr, ok := storagemarket.DealStates[uint64(num)] - if !ok { - return fmt.Errorf("no such deal state %d", num) - } - fmt.Println(ststr) - return nil - }, -} From 2c4d1bd0fc9c664c120746a7e78eb9a38c9bfded Mon Sep 17 00:00:00 2001 From: aarshkshah1992 Date: Thu, 16 May 2024 12:52:29 +0530 Subject: [PATCH 4/6] remove client API --- .circleci/config.yml | 115 - api/api_full.go | 69 - api/mocks/mock_full.go | 415 --- api/proxy_gen.go | 365 -- api/v0api/full.go | 73 - api/v0api/proxy_gen.go | 357 -- api/v0api/v0mocks/mock_full.go | 404 --- api/v0api/v1_wrapper.go | 153 - build/openrpc/full.json | 3177 ++--------------- build/openrpc/gateway.json | 196 +- build/openrpc/miner.json | 260 +- build/openrpc/worker.json | 74 +- chain/sub/incoming.go | 5 +- cli/paych.go | 9 - cmd/lotus-miner/allinfo_test.go | 7 - cmd/lotus-miner/main.go | 5 - documentation/en/api-v0-methods.md | 1079 ------ documentation/en/api-v1-unstable-methods.md | 1077 ------ documentation/en/cli-lotus.md | 5 +- itests/batch_deal_test.go | 147 - itests/cli_test.go | 27 - itests/deals_512mb_test.go | 51 - itests/deals_anycid_test.go | 162 - itests/deals_concurrent_test.go | 212 -- itests/deals_max_staging_deals_test.go | 70 - itests/deals_offline_test.go | 107 - itests/deals_padding_test.go | 84 - .../deals_partial_retrieval_dm-level_test.go | 267 -- itests/deals_partial_retrieval_test.go | 256 -- itests/deals_power_test.go | 70 - itests/deals_pricing_test.go | 150 - itests/deals_publish_test.go | 143 - itests/deals_remote_retrieval_test.go | 104 - itests/deals_retry_deal_no_funds_test.go | 188 - itests/deals_test.go | 45 - itests/gateway_test.go | 41 - itests/kit/client.go | 161 - itests/kit/deals.go | 483 --- itests/kit/node_full.go | 16 - itests/path_type_filters_test.go | 200 -- itests/sector_finalize_early_test.go | 72 - itests/worker_test.go | 79 - itests/worker_upgrade_test.go | 170 - node/impl/client/car_helpers.go | 91 - node/impl/client/client.go | 1536 -------- node/impl/client/client_test.go | 136 - .../impl/client/testdata/duplicate_blocks.txt | 1 - node/impl/client/testdata/payload.txt | 49 - node/impl/client/testdata/payload2.txt | 49 - node/impl/full.go | 2 - node/rpc.go | 120 - 51 files changed, 488 insertions(+), 12646 deletions(-) delete mode 100644 itests/batch_deal_test.go delete mode 100644 itests/cli_test.go delete mode 100644 itests/deals_512mb_test.go delete mode 100644 itests/deals_anycid_test.go delete mode 100644 itests/deals_concurrent_test.go delete mode 100644 itests/deals_max_staging_deals_test.go delete mode 100644 itests/deals_offline_test.go delete mode 100644 itests/deals_padding_test.go delete mode 100644 itests/deals_partial_retrieval_dm-level_test.go delete mode 100644 itests/deals_partial_retrieval_test.go delete mode 100644 itests/deals_power_test.go delete mode 100644 itests/deals_pricing_test.go delete mode 100644 itests/deals_publish_test.go delete mode 100644 itests/deals_remote_retrieval_test.go delete mode 100644 itests/deals_retry_deal_no_funds_test.go delete mode 100644 itests/deals_test.go delete mode 100644 itests/kit/client.go delete mode 100644 itests/kit/deals.go delete mode 100644 itests/path_type_filters_test.go delete mode 100644 itests/sector_finalize_early_test.go delete mode 100644 itests/worker_upgrade_test.go delete mode 100644 node/impl/client/car_helpers.go delete mode 100644 node/impl/client/client.go delete mode 100644 node/impl/client/client_test.go delete mode 100644 node/impl/client/testdata/duplicate_blocks.txt delete mode 100644 node/impl/client/testdata/payload.txt delete mode 100644 node/impl/client/testdata/payload2.txt diff --git a/.circleci/config.yml b/.circleci/config.yml index 75d747c6979..b5ed45a0744 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -542,18 +542,6 @@ workflows: - build suite: itest-api target: "./itests/api_test.go" - - test: - name: test-itest-batch_deal - requires: - - build - suite: itest-batch_deal - target: "./itests/batch_deal_test.go" - - test: - name: test-itest-cli - requires: - - build - suite: itest-cli - target: "./itests/cli_test.go" - test: name: test-itest-curio requires: @@ -566,97 +554,12 @@ workflows: - build suite: itest-deadlines target: "./itests/deadlines_test.go" - - test: - name: test-itest-deals_512mb - requires: - - build - suite: itest-deals_512mb - target: "./itests/deals_512mb_test.go" - - test: - name: test-itest-deals_anycid - requires: - - build - suite: itest-deals_anycid - target: "./itests/deals_anycid_test.go" - - test: - name: test-itest-deals_concurrent - requires: - - build - suite: itest-deals_concurrent - target: "./itests/deals_concurrent_test.go" - resource_class: 2xlarge - test: name: test-itest-deals_invalid_utf8_label requires: - build suite: itest-deals_invalid_utf8_label target: "./itests/deals_invalid_utf8_label_test.go" - - test: - name: test-itest-deals_max_staging_deals - requires: - - build - suite: itest-deals_max_staging_deals - target: "./itests/deals_max_staging_deals_test.go" - - test: - name: test-itest-deals_offline - requires: - - build - suite: itest-deals_offline - target: "./itests/deals_offline_test.go" - - test: - name: test-itest-deals_padding - requires: - - build - suite: itest-deals_padding - target: "./itests/deals_padding_test.go" - - test: - name: test-itest-deals_partial_retrieval_dm-level - requires: - - build - suite: itest-deals_partial_retrieval_dm-level - target: "./itests/deals_partial_retrieval_dm-level_test.go" - - test: - name: test-itest-deals_partial_retrieval - requires: - - build - suite: itest-deals_partial_retrieval - target: "./itests/deals_partial_retrieval_test.go" - - test: - name: test-itest-deals_power - requires: - - build - suite: itest-deals_power - target: "./itests/deals_power_test.go" - - test: - name: test-itest-deals_pricing - requires: - - build - suite: itest-deals_pricing - target: "./itests/deals_pricing_test.go" - - test: - name: test-itest-deals_publish - requires: - - build - suite: itest-deals_publish - target: "./itests/deals_publish_test.go" - - test: - name: test-itest-deals_remote_retrieval - requires: - - build - suite: itest-deals_remote_retrieval - target: "./itests/deals_remote_retrieval_test.go" - - test: - name: test-itest-deals_retry_deal_no_funds - requires: - - build - suite: itest-deals_retry_deal_no_funds - target: "./itests/deals_retry_deal_no_funds_test.go" - - test: - name: test-itest-deals - requires: - - build - suite: itest-deals - target: "./itests/deals_test.go" - test: name: test-itest-decode_params requires: @@ -867,12 +770,6 @@ workflows: - build suite: itest-path_detach_redeclare target: "./itests/path_detach_redeclare_test.go" - - test: - name: test-itest-path_type_filters - requires: - - build - suite: itest-path_type_filters - target: "./itests/path_type_filters_test.go" - test: name: test-itest-paych_api requires: @@ -903,12 +800,6 @@ workflows: - build suite: itest-sealing_resources target: "./itests/sealing_resources_test.go" - - test: - name: test-itest-sector_finalize_early - requires: - - build - suite: itest-sector_finalize_early - target: "./itests/sector_finalize_early_test.go" - test: name: test-itest-sector_import_full requires: @@ -1018,12 +909,6 @@ workflows: suite: itest-worker target: "./itests/worker_test.go" resource_class: 2xlarge - - test: - name: test-itest-worker_upgrade - requires: - - build - suite: itest-worker_upgrade - target: "./itests/worker_upgrade_test.go" - test: name: test-unit-cli requires: diff --git a/api/api_full.go b/api/api_full.go index bbfcae0a2eb..ee826f8da50 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -9,7 +9,6 @@ import ( "github.com/google/uuid" blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p/core/peer" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" @@ -348,74 +347,6 @@ type FullNode interface { // Other - // MethodGroup: Client - // The Client methods all have to do with interacting with the storage and - // retrieval markets as a client - - // ClientImport imports file under the specified path into filestore. - ClientImport(ctx context.Context, ref FileRef) (*ImportRes, error) //perm:admin - // ClientRemoveImport removes file import - ClientRemoveImport(ctx context.Context, importID imports.ID) error //perm:admin - // ClientStartDeal proposes a deal with a miner. - ClientStartDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error) //perm:admin - // ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking. - ClientStatelessDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error) //perm:write - // ClientGetDealInfo returns the latest information about a given deal. - ClientGetDealInfo(context.Context, cid.Cid) (*DealInfo, error) //perm:read - // ClientListDeals returns information about the deals made by the local client. - ClientListDeals(ctx context.Context) ([]DealInfo, error) //perm:write - // ClientGetDealUpdates returns the status of updated deals - ClientGetDealUpdates(ctx context.Context) (<-chan DealInfo, error) //perm:write - // ClientGetDealStatus returns status given a code - ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) //perm:read - // ClientHasLocal indicates whether a certain CID is locally stored. - ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error) //perm:write - // ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer). - ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]QueryOffer, error) //perm:read - // ClientMinerQueryOffer returns a QueryOffer for the specific miner and file. - ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (QueryOffer, error) //perm:read - // ClientRetrieve initiates the retrieval of a file, as specified in the order. - ClientRetrieve(ctx context.Context, params RetrievalOrder) (*RestrievalRes, error) //perm:admin - // ClientRetrieveWait waits for retrieval to be complete - ClientRetrieveWait(ctx context.Context, deal retrievalmarket.DealID) error //perm:admin - // ClientExport exports a file stored in the local filestore to a system file - ClientExport(ctx context.Context, exportRef ExportRef, fileRef FileRef) error //perm:admin - // ClientListRetrievals returns information about retrievals made by the local client - ClientListRetrievals(ctx context.Context) ([]RetrievalInfo, error) //perm:write - // ClientGetRetrievalUpdates returns status of updated retrieval deals - ClientGetRetrievalUpdates(ctx context.Context) (<-chan RetrievalInfo, error) //perm:write - // ClientQueryAsk returns a signed StorageAsk from the specified miner. - ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*StorageAsk, error) //perm:read - // ClientCalcCommP calculates the CommP and data size of the specified CID - ClientDealPieceCID(ctx context.Context, root cid.Cid) (DataCIDSize, error) //perm:read - // ClientCalcCommP calculates the CommP for a specified file - ClientCalcCommP(ctx context.Context, inpath string) (*CommPRet, error) //perm:write - // ClientGenCar generates a CAR file for the specified file. - ClientGenCar(ctx context.Context, ref FileRef, outpath string) error //perm:write - // ClientDealSize calculates real deal data size - ClientDealSize(ctx context.Context, root cid.Cid) (DataSize, error) //perm:read - // ClientListTransfers returns the status of all ongoing transfers of data - ClientListDataTransfers(ctx context.Context) ([]DataTransferChannel, error) //perm:write - ClientDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error) //perm:write - // ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer - ClientRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write - // ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer - ClientCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write - // ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel - // which are stuck due to insufficient funds - ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error //perm:write - - // ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID - ClientCancelRetrievalDeal(ctx context.Context, dealid retrievalmarket.DealID) error //perm:write - - // ClientUnimport removes references to the specified file from filestore - // ClientUnimport(path string) - - // ClientListImports lists imported files and their root CIDs - ClientListImports(ctx context.Context) ([]Import, error) //perm:write - - // ClientListAsks() []Ask - // MethodGroup: State // The State methods are used to query, inspect, and interact with chain state. // Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset. diff --git a/api/mocks/mock_full.go b/api/mocks/mock_full.go index 9960faeffe5..4bbd798a87a 100644 --- a/api/mocks/mock_full.go +++ b/api/mocks/mock_full.go @@ -21,8 +21,6 @@ import ( address "github.com/filecoin-project/go-address" bitfield "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - retrievalmarket "github.com/filecoin-project/go-fil-markets/retrievalmarket" jsonrpc "github.com/filecoin-project/go-jsonrpc" auth "github.com/filecoin-project/go-jsonrpc/auth" abi "github.com/filecoin-project/go-state-types/abi" @@ -42,7 +40,6 @@ import ( ethtypes "github.com/filecoin-project/lotus/chain/types/ethtypes" alerting "github.com/filecoin-project/lotus/journal/alerting" dtypes "github.com/filecoin-project/lotus/node/modules/dtypes" - imports "github.com/filecoin-project/lotus/node/repo/imports" ) // MockFullNode is a mock of FullNode interface. @@ -511,418 +508,6 @@ func (mr *MockFullNodeMockRecorder) ChainTipSetWeight(arg0, arg1 interface{}) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainTipSetWeight", reflect.TypeOf((*MockFullNode)(nil).ChainTipSetWeight), arg0, arg1) } -// ClientCalcCommP mocks base method. -func (m *MockFullNode) ClientCalcCommP(arg0 context.Context, arg1 string) (*api.CommPRet, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCalcCommP", arg0, arg1) - ret0, _ := ret[0].(*api.CommPRet) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientCalcCommP indicates an expected call of ClientCalcCommP. -func (mr *MockFullNodeMockRecorder) ClientCalcCommP(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCalcCommP", reflect.TypeOf((*MockFullNode)(nil).ClientCalcCommP), arg0, arg1) -} - -// ClientCancelDataTransfer mocks base method. -func (m *MockFullNode) ClientCancelDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCancelDataTransfer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientCancelDataTransfer indicates an expected call of ClientCancelDataTransfer. -func (mr *MockFullNodeMockRecorder) ClientCancelDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientCancelDataTransfer), arg0, arg1, arg2, arg3) -} - -// ClientCancelRetrievalDeal mocks base method. -func (m *MockFullNode) ClientCancelRetrievalDeal(arg0 context.Context, arg1 retrievalmarket.DealID) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCancelRetrievalDeal", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientCancelRetrievalDeal indicates an expected call of ClientCancelRetrievalDeal. -func (mr *MockFullNodeMockRecorder) ClientCancelRetrievalDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelRetrievalDeal", reflect.TypeOf((*MockFullNode)(nil).ClientCancelRetrievalDeal), arg0, arg1) -} - -// ClientDataTransferUpdates mocks base method. -func (m *MockFullNode) ClientDataTransferUpdates(arg0 context.Context) (<-chan api.DataTransferChannel, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDataTransferUpdates", arg0) - ret0, _ := ret[0].(<-chan api.DataTransferChannel) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDataTransferUpdates indicates an expected call of ClientDataTransferUpdates. -func (mr *MockFullNodeMockRecorder) ClientDataTransferUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDataTransferUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientDataTransferUpdates), arg0) -} - -// ClientDealPieceCID mocks base method. -func (m *MockFullNode) ClientDealPieceCID(arg0 context.Context, arg1 cid.Cid) (api.DataCIDSize, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDealPieceCID", arg0, arg1) - ret0, _ := ret[0].(api.DataCIDSize) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDealPieceCID indicates an expected call of ClientDealPieceCID. -func (mr *MockFullNodeMockRecorder) ClientDealPieceCID(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealPieceCID", reflect.TypeOf((*MockFullNode)(nil).ClientDealPieceCID), arg0, arg1) -} - -// ClientDealSize mocks base method. -func (m *MockFullNode) ClientDealSize(arg0 context.Context, arg1 cid.Cid) (api.DataSize, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDealSize", arg0, arg1) - ret0, _ := ret[0].(api.DataSize) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDealSize indicates an expected call of ClientDealSize. -func (mr *MockFullNodeMockRecorder) ClientDealSize(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealSize", reflect.TypeOf((*MockFullNode)(nil).ClientDealSize), arg0, arg1) -} - -// ClientExport mocks base method. -func (m *MockFullNode) ClientExport(arg0 context.Context, arg1 api.ExportRef, arg2 api.FileRef) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientExport", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientExport indicates an expected call of ClientExport. -func (mr *MockFullNodeMockRecorder) ClientExport(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientExport", reflect.TypeOf((*MockFullNode)(nil).ClientExport), arg0, arg1, arg2) -} - -// ClientFindData mocks base method. -func (m *MockFullNode) ClientFindData(arg0 context.Context, arg1 cid.Cid, arg2 *cid.Cid) ([]api.QueryOffer, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientFindData", arg0, arg1, arg2) - ret0, _ := ret[0].([]api.QueryOffer) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientFindData indicates an expected call of ClientFindData. -func (mr *MockFullNodeMockRecorder) ClientFindData(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientFindData", reflect.TypeOf((*MockFullNode)(nil).ClientFindData), arg0, arg1, arg2) -} - -// ClientGenCar mocks base method. -func (m *MockFullNode) ClientGenCar(arg0 context.Context, arg1 api.FileRef, arg2 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGenCar", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientGenCar indicates an expected call of ClientGenCar. -func (mr *MockFullNodeMockRecorder) ClientGenCar(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGenCar", reflect.TypeOf((*MockFullNode)(nil).ClientGenCar), arg0, arg1, arg2) -} - -// ClientGetDealInfo mocks base method. -func (m *MockFullNode) ClientGetDealInfo(arg0 context.Context, arg1 cid.Cid) (*api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealInfo", arg0, arg1) - ret0, _ := ret[0].(*api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealInfo indicates an expected call of ClientGetDealInfo. -func (mr *MockFullNodeMockRecorder) ClientGetDealInfo(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealInfo", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealInfo), arg0, arg1) -} - -// ClientGetDealStatus mocks base method. -func (m *MockFullNode) ClientGetDealStatus(arg0 context.Context, arg1 uint64) (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealStatus", arg0, arg1) - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealStatus indicates an expected call of ClientGetDealStatus. -func (mr *MockFullNodeMockRecorder) ClientGetDealStatus(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealStatus", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealStatus), arg0, arg1) -} - -// ClientGetDealUpdates mocks base method. -func (m *MockFullNode) ClientGetDealUpdates(arg0 context.Context) (<-chan api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealUpdates", arg0) - ret0, _ := ret[0].(<-chan api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealUpdates indicates an expected call of ClientGetDealUpdates. -func (mr *MockFullNodeMockRecorder) ClientGetDealUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealUpdates), arg0) -} - -// ClientGetRetrievalUpdates mocks base method. -func (m *MockFullNode) ClientGetRetrievalUpdates(arg0 context.Context) (<-chan api.RetrievalInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetRetrievalUpdates", arg0) - ret0, _ := ret[0].(<-chan api.RetrievalInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetRetrievalUpdates indicates an expected call of ClientGetRetrievalUpdates. -func (mr *MockFullNodeMockRecorder) ClientGetRetrievalUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetRetrievalUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetRetrievalUpdates), arg0) -} - -// ClientHasLocal mocks base method. -func (m *MockFullNode) ClientHasLocal(arg0 context.Context, arg1 cid.Cid) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientHasLocal", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientHasLocal indicates an expected call of ClientHasLocal. -func (mr *MockFullNodeMockRecorder) ClientHasLocal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientHasLocal", reflect.TypeOf((*MockFullNode)(nil).ClientHasLocal), arg0, arg1) -} - -// ClientImport mocks base method. -func (m *MockFullNode) ClientImport(arg0 context.Context, arg1 api.FileRef) (*api.ImportRes, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientImport", arg0, arg1) - ret0, _ := ret[0].(*api.ImportRes) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientImport indicates an expected call of ClientImport. -func (mr *MockFullNodeMockRecorder) ClientImport(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientImport", reflect.TypeOf((*MockFullNode)(nil).ClientImport), arg0, arg1) -} - -// ClientListDataTransfers mocks base method. -func (m *MockFullNode) ClientListDataTransfers(arg0 context.Context) ([]api.DataTransferChannel, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListDataTransfers", arg0) - ret0, _ := ret[0].([]api.DataTransferChannel) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListDataTransfers indicates an expected call of ClientListDataTransfers. -func (mr *MockFullNodeMockRecorder) ClientListDataTransfers(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDataTransfers", reflect.TypeOf((*MockFullNode)(nil).ClientListDataTransfers), arg0) -} - -// ClientListDeals mocks base method. -func (m *MockFullNode) ClientListDeals(arg0 context.Context) ([]api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListDeals", arg0) - ret0, _ := ret[0].([]api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListDeals indicates an expected call of ClientListDeals. -func (mr *MockFullNodeMockRecorder) ClientListDeals(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDeals", reflect.TypeOf((*MockFullNode)(nil).ClientListDeals), arg0) -} - -// ClientListImports mocks base method. -func (m *MockFullNode) ClientListImports(arg0 context.Context) ([]api.Import, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListImports", arg0) - ret0, _ := ret[0].([]api.Import) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListImports indicates an expected call of ClientListImports. -func (mr *MockFullNodeMockRecorder) ClientListImports(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListImports", reflect.TypeOf((*MockFullNode)(nil).ClientListImports), arg0) -} - -// ClientListRetrievals mocks base method. -func (m *MockFullNode) ClientListRetrievals(arg0 context.Context) ([]api.RetrievalInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListRetrievals", arg0) - ret0, _ := ret[0].([]api.RetrievalInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListRetrievals indicates an expected call of ClientListRetrievals. -func (mr *MockFullNodeMockRecorder) ClientListRetrievals(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListRetrievals", reflect.TypeOf((*MockFullNode)(nil).ClientListRetrievals), arg0) -} - -// ClientMinerQueryOffer mocks base method. -func (m *MockFullNode) ClientMinerQueryOffer(arg0 context.Context, arg1 address.Address, arg2 cid.Cid, arg3 *cid.Cid) (api.QueryOffer, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientMinerQueryOffer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(api.QueryOffer) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientMinerQueryOffer indicates an expected call of ClientMinerQueryOffer. -func (mr *MockFullNodeMockRecorder) ClientMinerQueryOffer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientMinerQueryOffer", reflect.TypeOf((*MockFullNode)(nil).ClientMinerQueryOffer), arg0, arg1, arg2, arg3) -} - -// ClientQueryAsk mocks base method. -func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 address.Address) (*api.StorageAsk, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientQueryAsk", arg0, arg1, arg2) - ret0, _ := ret[0].(*api.StorageAsk) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientQueryAsk indicates an expected call of ClientQueryAsk. -func (mr *MockFullNodeMockRecorder) ClientQueryAsk(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientQueryAsk", reflect.TypeOf((*MockFullNode)(nil).ClientQueryAsk), arg0, arg1, arg2) -} - -// ClientRemoveImport mocks base method. -func (m *MockFullNode) ClientRemoveImport(arg0 context.Context, arg1 imports.ID) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRemoveImport", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRemoveImport indicates an expected call of ClientRemoveImport. -func (mr *MockFullNodeMockRecorder) ClientRemoveImport(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRemoveImport", reflect.TypeOf((*MockFullNode)(nil).ClientRemoveImport), arg0, arg1) -} - -// ClientRestartDataTransfer mocks base method. -func (m *MockFullNode) ClientRestartDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRestartDataTransfer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRestartDataTransfer indicates an expected call of ClientRestartDataTransfer. -func (mr *MockFullNodeMockRecorder) ClientRestartDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRestartDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientRestartDataTransfer), arg0, arg1, arg2, arg3) -} - -// ClientRetrieve mocks base method. -func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOrder) (*api.RestrievalRes, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1) - ret0, _ := ret[0].(*api.RestrievalRes) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientRetrieve indicates an expected call of ClientRetrieve. -func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1) -} - -// ClientRetrieveTryRestartInsufficientFunds mocks base method. -func (m *MockFullNode) ClientRetrieveTryRestartInsufficientFunds(arg0 context.Context, arg1 address.Address) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieveTryRestartInsufficientFunds", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRetrieveTryRestartInsufficientFunds indicates an expected call of ClientRetrieveTryRestartInsufficientFunds. -func (mr *MockFullNodeMockRecorder) ClientRetrieveTryRestartInsufficientFunds(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveTryRestartInsufficientFunds", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveTryRestartInsufficientFunds), arg0, arg1) -} - -// ClientRetrieveWait mocks base method. -func (m *MockFullNode) ClientRetrieveWait(arg0 context.Context, arg1 retrievalmarket.DealID) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieveWait", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRetrieveWait indicates an expected call of ClientRetrieveWait. -func (mr *MockFullNodeMockRecorder) ClientRetrieveWait(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWait", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWait), arg0, arg1) -} - -// ClientStartDeal mocks base method. -func (m *MockFullNode) ClientStartDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientStartDeal", arg0, arg1) - ret0, _ := ret[0].(*cid.Cid) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientStartDeal indicates an expected call of ClientStartDeal. -func (mr *MockFullNodeMockRecorder) ClientStartDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStartDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStartDeal), arg0, arg1) -} - -// ClientStatelessDeal mocks base method. -func (m *MockFullNode) ClientStatelessDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientStatelessDeal", arg0, arg1) - ret0, _ := ret[0].(*cid.Cid) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientStatelessDeal indicates an expected call of ClientStatelessDeal. -func (mr *MockFullNodeMockRecorder) ClientStatelessDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStatelessDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStatelessDeal), arg0, arg1) -} - // Closing mocks base method. func (m *MockFullNode) Closing(arg0 context.Context) (<-chan struct{}, error) { m.ctrl.T.Helper() diff --git a/api/proxy_gen.go b/api/proxy_gen.go index cde8230c4a7..b47708e944d 100644 --- a/api/proxy_gen.go +++ b/api/proxy_gen.go @@ -42,7 +42,6 @@ import ( "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/journal/alerting" "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo/imports" "github.com/filecoin-project/lotus/storage/pipeline/piece" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" "github.com/filecoin-project/lotus/storage/sealer/fsutil" @@ -226,62 +225,6 @@ type FullNodeMethods struct { ChainTipSetWeight func(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) `perm:"read"` - ClientCalcCommP func(p0 context.Context, p1 string) (*CommPRet, error) `perm:"write"` - - ClientCancelDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` - - ClientCancelRetrievalDeal func(p0 context.Context, p1 retrievalmarket.DealID) error `perm:"write"` - - ClientDataTransferUpdates func(p0 context.Context) (<-chan DataTransferChannel, error) `perm:"write"` - - ClientDealPieceCID func(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) `perm:"read"` - - ClientDealSize func(p0 context.Context, p1 cid.Cid) (DataSize, error) `perm:"read"` - - ClientExport func(p0 context.Context, p1 ExportRef, p2 FileRef) error `perm:"admin"` - - ClientFindData func(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) `perm:"read"` - - ClientGenCar func(p0 context.Context, p1 FileRef, p2 string) error `perm:"write"` - - ClientGetDealInfo func(p0 context.Context, p1 cid.Cid) (*DealInfo, error) `perm:"read"` - - ClientGetDealStatus func(p0 context.Context, p1 uint64) (string, error) `perm:"read"` - - ClientGetDealUpdates func(p0 context.Context) (<-chan DealInfo, error) `perm:"write"` - - ClientGetRetrievalUpdates func(p0 context.Context) (<-chan RetrievalInfo, error) `perm:"write"` - - ClientHasLocal func(p0 context.Context, p1 cid.Cid) (bool, error) `perm:"write"` - - ClientImport func(p0 context.Context, p1 FileRef) (*ImportRes, error) `perm:"admin"` - - ClientListDataTransfers func(p0 context.Context) ([]DataTransferChannel, error) `perm:"write"` - - ClientListDeals func(p0 context.Context) ([]DealInfo, error) `perm:"write"` - - ClientListImports func(p0 context.Context) ([]Import, error) `perm:"write"` - - ClientListRetrievals func(p0 context.Context) ([]RetrievalInfo, error) `perm:"write"` - - ClientMinerQueryOffer func(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) `perm:"read"` - - ClientQueryAsk func(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) `perm:"read"` - - ClientRemoveImport func(p0 context.Context, p1 imports.ID) error `perm:"admin"` - - ClientRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` - - ClientRetrieve func(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) `perm:"admin"` - - ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"` - - ClientRetrieveWait func(p0 context.Context, p1 retrievalmarket.DealID) error `perm:"admin"` - - ClientStartDeal func(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) `perm:"admin"` - - ClientStatelessDeal func(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) `perm:"write"` - CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"` EthAccounts func(p0 context.Context) ([]ethtypes.EthAddress, error) `perm:"read"` @@ -1960,314 +1903,6 @@ func (s *FullNodeStub) ChainTipSetWeight(p0 context.Context, p1 types.TipSetKey) return *new(types.BigInt), ErrNotSupported } -func (s *FullNodeStruct) ClientCalcCommP(p0 context.Context, p1 string) (*CommPRet, error) { - if s.Internal.ClientCalcCommP == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientCalcCommP(p0, p1) -} - -func (s *FullNodeStub) ClientCalcCommP(p0 context.Context, p1 string) (*CommPRet, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - if s.Internal.ClientCancelDataTransfer == nil { - return ErrNotSupported - } - return s.Internal.ClientCancelDataTransfer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error { - if s.Internal.ClientCancelRetrievalDeal == nil { - return ErrNotSupported - } - return s.Internal.ClientCancelRetrievalDeal(p0, p1) -} - -func (s *FullNodeStub) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) { - if s.Internal.ClientDataTransferUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientDataTransferUpdates(p0) -} - -func (s *FullNodeStub) ClientDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) { - if s.Internal.ClientDealPieceCID == nil { - return *new(DataCIDSize), ErrNotSupported - } - return s.Internal.ClientDealPieceCID(p0, p1) -} - -func (s *FullNodeStub) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) { - return *new(DataCIDSize), ErrNotSupported -} - -func (s *FullNodeStruct) ClientDealSize(p0 context.Context, p1 cid.Cid) (DataSize, error) { - if s.Internal.ClientDealSize == nil { - return *new(DataSize), ErrNotSupported - } - return s.Internal.ClientDealSize(p0, p1) -} - -func (s *FullNodeStub) ClientDealSize(p0 context.Context, p1 cid.Cid) (DataSize, error) { - return *new(DataSize), ErrNotSupported -} - -func (s *FullNodeStruct) ClientExport(p0 context.Context, p1 ExportRef, p2 FileRef) error { - if s.Internal.ClientExport == nil { - return ErrNotSupported - } - return s.Internal.ClientExport(p0, p1, p2) -} - -func (s *FullNodeStub) ClientExport(p0 context.Context, p1 ExportRef, p2 FileRef) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) { - if s.Internal.ClientFindData == nil { - return *new([]QueryOffer), ErrNotSupported - } - return s.Internal.ClientFindData(p0, p1, p2) -} - -func (s *FullNodeStub) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) { - return *new([]QueryOffer), ErrNotSupported -} - -func (s *FullNodeStruct) ClientGenCar(p0 context.Context, p1 FileRef, p2 string) error { - if s.Internal.ClientGenCar == nil { - return ErrNotSupported - } - return s.Internal.ClientGenCar(p0, p1, p2) -} - -func (s *FullNodeStub) ClientGenCar(p0 context.Context, p1 FileRef, p2 string) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*DealInfo, error) { - if s.Internal.ClientGetDealInfo == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetDealInfo(p0, p1) -} - -func (s *FullNodeStub) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*DealInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) { - if s.Internal.ClientGetDealStatus == nil { - return "", ErrNotSupported - } - return s.Internal.ClientGetDealStatus(p0, p1) -} - -func (s *FullNodeStub) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) { - return "", ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealUpdates(p0 context.Context) (<-chan DealInfo, error) { - if s.Internal.ClientGetDealUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetDealUpdates(p0) -} - -func (s *FullNodeStub) ClientGetDealUpdates(p0 context.Context) (<-chan DealInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetRetrievalUpdates(p0 context.Context) (<-chan RetrievalInfo, error) { - if s.Internal.ClientGetRetrievalUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetRetrievalUpdates(p0) -} - -func (s *FullNodeStub) ClientGetRetrievalUpdates(p0 context.Context) (<-chan RetrievalInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) { - if s.Internal.ClientHasLocal == nil { - return false, ErrNotSupported - } - return s.Internal.ClientHasLocal(p0, p1) -} - -func (s *FullNodeStub) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) { - return false, ErrNotSupported -} - -func (s *FullNodeStruct) ClientImport(p0 context.Context, p1 FileRef) (*ImportRes, error) { - if s.Internal.ClientImport == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientImport(p0, p1) -} - -func (s *FullNodeStub) ClientImport(p0 context.Context, p1 FileRef) (*ImportRes, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) { - if s.Internal.ClientListDataTransfers == nil { - return *new([]DataTransferChannel), ErrNotSupported - } - return s.Internal.ClientListDataTransfers(p0) -} - -func (s *FullNodeStub) ClientListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) { - return *new([]DataTransferChannel), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListDeals(p0 context.Context) ([]DealInfo, error) { - if s.Internal.ClientListDeals == nil { - return *new([]DealInfo), ErrNotSupported - } - return s.Internal.ClientListDeals(p0) -} - -func (s *FullNodeStub) ClientListDeals(p0 context.Context) ([]DealInfo, error) { - return *new([]DealInfo), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListImports(p0 context.Context) ([]Import, error) { - if s.Internal.ClientListImports == nil { - return *new([]Import), ErrNotSupported - } - return s.Internal.ClientListImports(p0) -} - -func (s *FullNodeStub) ClientListImports(p0 context.Context) ([]Import, error) { - return *new([]Import), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListRetrievals(p0 context.Context) ([]RetrievalInfo, error) { - if s.Internal.ClientListRetrievals == nil { - return *new([]RetrievalInfo), ErrNotSupported - } - return s.Internal.ClientListRetrievals(p0) -} - -func (s *FullNodeStub) ClientListRetrievals(p0 context.Context) ([]RetrievalInfo, error) { - return *new([]RetrievalInfo), ErrNotSupported -} - -func (s *FullNodeStruct) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) { - if s.Internal.ClientMinerQueryOffer == nil { - return *new(QueryOffer), ErrNotSupported - } - return s.Internal.ClientMinerQueryOffer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) { - return *new(QueryOffer), ErrNotSupported -} - -func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) { - if s.Internal.ClientQueryAsk == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientQueryAsk(p0, p1, p2) -} - -func (s *FullNodeStub) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientRemoveImport(p0 context.Context, p1 imports.ID) error { - if s.Internal.ClientRemoveImport == nil { - return ErrNotSupported - } - return s.Internal.ClientRemoveImport(p0, p1) -} - -func (s *FullNodeStub) ClientRemoveImport(p0 context.Context, p1 imports.ID) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - if s.Internal.ClientRestartDataTransfer == nil { - return ErrNotSupported - } - return s.Internal.ClientRestartDataTransfer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) { - if s.Internal.ClientRetrieve == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientRetrieve(p0, p1) -} - -func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error { - if s.Internal.ClientRetrieveTryRestartInsufficientFunds == nil { - return ErrNotSupported - } - return s.Internal.ClientRetrieveTryRestartInsufficientFunds(p0, p1) -} - -func (s *FullNodeStub) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieveWait(p0 context.Context, p1 retrievalmarket.DealID) error { - if s.Internal.ClientRetrieveWait == nil { - return ErrNotSupported - } - return s.Internal.ClientRetrieveWait(p0, p1) -} - -func (s *FullNodeStub) ClientRetrieveWait(p0 context.Context, p1 retrievalmarket.DealID) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) { - if s.Internal.ClientStartDeal == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientStartDeal(p0, p1) -} - -func (s *FullNodeStub) ClientStartDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientStatelessDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) { - if s.Internal.ClientStatelessDeal == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientStatelessDeal(p0, p1) -} - -func (s *FullNodeStub) ClientStatelessDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) { - return nil, ErrNotSupported -} - func (s *FullNodeStruct) CreateBackup(p0 context.Context, p1 string) error { if s.Internal.CreateBackup == nil { return ErrNotSupported diff --git a/api/v0api/full.go b/api/v0api/full.go index b61fc157025..da13444f550 100644 --- a/api/v0api/full.go +++ b/api/v0api/full.go @@ -6,13 +6,10 @@ import ( blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" textselector "github.com/ipld/go-ipld-selector-text-lite" - "github.com/libp2p/go-libp2p/core/peer" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/builtin/v8/paych" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" @@ -24,9 +21,7 @@ import ( apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" - marketevents "github.com/filecoin-project/lotus/markets/loggers" "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo/imports" ) //go:generate go run github.com/golang/mock/mockgen -destination=v0mocks/mock_full.go -package=v0mocks . FullNode @@ -305,74 +300,6 @@ type FullNode interface { WalletValidateAddress(context.Context, string) (address.Address, error) //perm:read // Other - - // MethodGroup: Client - // The Client methods all have to do with interacting with the storage and - // retrieval markets as a client - - // ClientImport imports file under the specified path into filestore. - ClientImport(ctx context.Context, ref api.FileRef) (*api.ImportRes, error) //perm:admin - // ClientRemoveImport removes file import - ClientRemoveImport(ctx context.Context, importID imports.ID) error //perm:admin - // ClientStartDeal proposes a deal with a miner. - ClientStartDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) //perm:admin - // ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking. - ClientStatelessDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) //perm:write - // ClientGetDealInfo returns the latest information about a given deal. - ClientGetDealInfo(context.Context, cid.Cid) (*api.DealInfo, error) //perm:read - // ClientListDeals returns information about the deals made by the local client. - ClientListDeals(ctx context.Context) ([]api.DealInfo, error) //perm:write - // ClientGetDealUpdates returns the status of updated deals - ClientGetDealUpdates(ctx context.Context) (<-chan api.DealInfo, error) //perm:write - // ClientGetDealStatus returns status given a code - ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) //perm:read - // ClientHasLocal indicates whether a certain CID is locally stored. - ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error) //perm:write - // ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer). - ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error) //perm:read - // ClientMinerQueryOffer returns a QueryOffer for the specific miner and file. - ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) //perm:read - // ClientRetrieve initiates the retrieval of a file, as specified in the order. - ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef) error //perm:admin - // ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel - // of status updates. - ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin - // ClientQueryAsk returns a signed StorageAsk from the specified miner. - // ClientListRetrievals returns information about retrievals made by the local client - ClientListRetrievals(ctx context.Context) ([]api.RetrievalInfo, error) //perm:write - // ClientGetRetrievalUpdates returns status of updated retrieval deals - ClientGetRetrievalUpdates(ctx context.Context) (<-chan api.RetrievalInfo, error) //perm:write - ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) //perm:read - // ClientCalcCommP calculates the CommP and data size of the specified CID - ClientDealPieceCID(ctx context.Context, root cid.Cid) (api.DataCIDSize, error) //perm:read - // ClientCalcCommP calculates the CommP for a specified file - ClientCalcCommP(ctx context.Context, inpath string) (*api.CommPRet, error) //perm:write - // ClientGenCar generates a CAR file for the specified file. - ClientGenCar(ctx context.Context, ref api.FileRef, outpath string) error //perm:write - // ClientDealSize calculates real deal data size - ClientDealSize(ctx context.Context, root cid.Cid) (api.DataSize, error) //perm:read - // ClientListTransfers returns the status of all ongoing transfers of data - ClientListDataTransfers(ctx context.Context) ([]api.DataTransferChannel, error) //perm:write - ClientDataTransferUpdates(ctx context.Context) (<-chan api.DataTransferChannel, error) //perm:write - // ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer - ClientRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write - // ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer - ClientCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write - // ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel - // which are stuck due to insufficient funds - ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error //perm:write - - // ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID - ClientCancelRetrievalDeal(ctx context.Context, dealid retrievalmarket.DealID) error //perm:write - - // ClientUnimport removes references to the specified file from filestore - // ClientUnimport(path string) - - // ClientListImports lists imported files and their root CIDs - ClientListImports(ctx context.Context) ([]api.Import, error) //perm:write - - // ClientListAsks() []Ask - // MethodGroup: State // The State methods are used to query, inspect, and interact with chain state. // Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset. diff --git a/api/v0api/proxy_gen.go b/api/v0api/proxy_gen.go index 90c25d4a774..a8756894951 100644 --- a/api/v0api/proxy_gen.go +++ b/api/v0api/proxy_gen.go @@ -7,14 +7,10 @@ import ( blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p/core/peer" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/builtin/v8/paych" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" @@ -26,9 +22,7 @@ import ( apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" - marketevents "github.com/filecoin-project/lotus/markets/loggers" "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo/imports" ) var ErrNotSupported = xerrors.New("method not supported") @@ -90,60 +84,6 @@ type FullNodeMethods struct { ChainTipSetWeight func(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) `perm:"read"` - ClientCalcCommP func(p0 context.Context, p1 string) (*api.CommPRet, error) `perm:"write"` - - ClientCancelDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` - - ClientCancelRetrievalDeal func(p0 context.Context, p1 retrievalmarket.DealID) error `perm:"write"` - - ClientDataTransferUpdates func(p0 context.Context) (<-chan api.DataTransferChannel, error) `perm:"write"` - - ClientDealPieceCID func(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) `perm:"read"` - - ClientDealSize func(p0 context.Context, p1 cid.Cid) (api.DataSize, error) `perm:"read"` - - ClientFindData func(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) `perm:"read"` - - ClientGenCar func(p0 context.Context, p1 api.FileRef, p2 string) error `perm:"write"` - - ClientGetDealInfo func(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) `perm:"read"` - - ClientGetDealStatus func(p0 context.Context, p1 uint64) (string, error) `perm:"read"` - - ClientGetDealUpdates func(p0 context.Context) (<-chan api.DealInfo, error) `perm:"write"` - - ClientGetRetrievalUpdates func(p0 context.Context) (<-chan api.RetrievalInfo, error) `perm:"write"` - - ClientHasLocal func(p0 context.Context, p1 cid.Cid) (bool, error) `perm:"write"` - - ClientImport func(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) `perm:"admin"` - - ClientListDataTransfers func(p0 context.Context) ([]api.DataTransferChannel, error) `perm:"write"` - - ClientListDeals func(p0 context.Context) ([]api.DealInfo, error) `perm:"write"` - - ClientListImports func(p0 context.Context) ([]api.Import, error) `perm:"write"` - - ClientListRetrievals func(p0 context.Context) ([]api.RetrievalInfo, error) `perm:"write"` - - ClientMinerQueryOffer func(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) `perm:"read"` - - ClientQueryAsk func(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) `perm:"read"` - - ClientRemoveImport func(p0 context.Context, p1 imports.ID) error `perm:"admin"` - - ClientRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` - - ClientRetrieve func(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error `perm:"admin"` - - ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"` - - ClientRetrieveWithEvents func(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) `perm:"admin"` - - ClientStartDeal func(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) `perm:"admin"` - - ClientStatelessDeal func(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) `perm:"write"` - CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"` GasEstimateFeeCap func(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"` @@ -796,303 +736,6 @@ func (s *FullNodeStub) ChainTipSetWeight(p0 context.Context, p1 types.TipSetKey) return *new(types.BigInt), ErrNotSupported } -func (s *FullNodeStruct) ClientCalcCommP(p0 context.Context, p1 string) (*api.CommPRet, error) { - if s.Internal.ClientCalcCommP == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientCalcCommP(p0, p1) -} - -func (s *FullNodeStub) ClientCalcCommP(p0 context.Context, p1 string) (*api.CommPRet, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - if s.Internal.ClientCancelDataTransfer == nil { - return ErrNotSupported - } - return s.Internal.ClientCancelDataTransfer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error { - if s.Internal.ClientCancelRetrievalDeal == nil { - return ErrNotSupported - } - return s.Internal.ClientCancelRetrievalDeal(p0, p1) -} - -func (s *FullNodeStub) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) { - if s.Internal.ClientDataTransferUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientDataTransferUpdates(p0) -} - -func (s *FullNodeStub) ClientDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) { - if s.Internal.ClientDealPieceCID == nil { - return *new(api.DataCIDSize), ErrNotSupported - } - return s.Internal.ClientDealPieceCID(p0, p1) -} - -func (s *FullNodeStub) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) { - return *new(api.DataCIDSize), ErrNotSupported -} - -func (s *FullNodeStruct) ClientDealSize(p0 context.Context, p1 cid.Cid) (api.DataSize, error) { - if s.Internal.ClientDealSize == nil { - return *new(api.DataSize), ErrNotSupported - } - return s.Internal.ClientDealSize(p0, p1) -} - -func (s *FullNodeStub) ClientDealSize(p0 context.Context, p1 cid.Cid) (api.DataSize, error) { - return *new(api.DataSize), ErrNotSupported -} - -func (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) { - if s.Internal.ClientFindData == nil { - return *new([]api.QueryOffer), ErrNotSupported - } - return s.Internal.ClientFindData(p0, p1, p2) -} - -func (s *FullNodeStub) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) { - return *new([]api.QueryOffer), ErrNotSupported -} - -func (s *FullNodeStruct) ClientGenCar(p0 context.Context, p1 api.FileRef, p2 string) error { - if s.Internal.ClientGenCar == nil { - return ErrNotSupported - } - return s.Internal.ClientGenCar(p0, p1, p2) -} - -func (s *FullNodeStub) ClientGenCar(p0 context.Context, p1 api.FileRef, p2 string) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) { - if s.Internal.ClientGetDealInfo == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetDealInfo(p0, p1) -} - -func (s *FullNodeStub) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) { - if s.Internal.ClientGetDealStatus == nil { - return "", ErrNotSupported - } - return s.Internal.ClientGetDealStatus(p0, p1) -} - -func (s *FullNodeStub) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) { - return "", ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealUpdates(p0 context.Context) (<-chan api.DealInfo, error) { - if s.Internal.ClientGetDealUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetDealUpdates(p0) -} - -func (s *FullNodeStub) ClientGetDealUpdates(p0 context.Context) (<-chan api.DealInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetRetrievalUpdates(p0 context.Context) (<-chan api.RetrievalInfo, error) { - if s.Internal.ClientGetRetrievalUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetRetrievalUpdates(p0) -} - -func (s *FullNodeStub) ClientGetRetrievalUpdates(p0 context.Context) (<-chan api.RetrievalInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) { - if s.Internal.ClientHasLocal == nil { - return false, ErrNotSupported - } - return s.Internal.ClientHasLocal(p0, p1) -} - -func (s *FullNodeStub) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) { - return false, ErrNotSupported -} - -func (s *FullNodeStruct) ClientImport(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) { - if s.Internal.ClientImport == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientImport(p0, p1) -} - -func (s *FullNodeStub) ClientImport(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) { - if s.Internal.ClientListDataTransfers == nil { - return *new([]api.DataTransferChannel), ErrNotSupported - } - return s.Internal.ClientListDataTransfers(p0) -} - -func (s *FullNodeStub) ClientListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) { - return *new([]api.DataTransferChannel), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListDeals(p0 context.Context) ([]api.DealInfo, error) { - if s.Internal.ClientListDeals == nil { - return *new([]api.DealInfo), ErrNotSupported - } - return s.Internal.ClientListDeals(p0) -} - -func (s *FullNodeStub) ClientListDeals(p0 context.Context) ([]api.DealInfo, error) { - return *new([]api.DealInfo), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListImports(p0 context.Context) ([]api.Import, error) { - if s.Internal.ClientListImports == nil { - return *new([]api.Import), ErrNotSupported - } - return s.Internal.ClientListImports(p0) -} - -func (s *FullNodeStub) ClientListImports(p0 context.Context) ([]api.Import, error) { - return *new([]api.Import), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListRetrievals(p0 context.Context) ([]api.RetrievalInfo, error) { - if s.Internal.ClientListRetrievals == nil { - return *new([]api.RetrievalInfo), ErrNotSupported - } - return s.Internal.ClientListRetrievals(p0) -} - -func (s *FullNodeStub) ClientListRetrievals(p0 context.Context) ([]api.RetrievalInfo, error) { - return *new([]api.RetrievalInfo), ErrNotSupported -} - -func (s *FullNodeStruct) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) { - if s.Internal.ClientMinerQueryOffer == nil { - return *new(api.QueryOffer), ErrNotSupported - } - return s.Internal.ClientMinerQueryOffer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) { - return *new(api.QueryOffer), ErrNotSupported -} - -func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) { - if s.Internal.ClientQueryAsk == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientQueryAsk(p0, p1, p2) -} - -func (s *FullNodeStub) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientRemoveImport(p0 context.Context, p1 imports.ID) error { - if s.Internal.ClientRemoveImport == nil { - return ErrNotSupported - } - return s.Internal.ClientRemoveImport(p0, p1) -} - -func (s *FullNodeStub) ClientRemoveImport(p0 context.Context, p1 imports.ID) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - if s.Internal.ClientRestartDataTransfer == nil { - return ErrNotSupported - } - return s.Internal.ClientRestartDataTransfer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error { - if s.Internal.ClientRetrieve == nil { - return ErrNotSupported - } - return s.Internal.ClientRetrieve(p0, p1, p2) -} - -func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error { - if s.Internal.ClientRetrieveTryRestartInsufficientFunds == nil { - return ErrNotSupported - } - return s.Internal.ClientRetrieveTryRestartInsufficientFunds(p0, p1) -} - -func (s *FullNodeStub) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) { - if s.Internal.ClientRetrieveWithEvents == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientRetrieveWithEvents(p0, p1, p2) -} - -func (s *FullNodeStub) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) { - if s.Internal.ClientStartDeal == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientStartDeal(p0, p1) -} - -func (s *FullNodeStub) ClientStartDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientStatelessDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) { - if s.Internal.ClientStatelessDeal == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientStatelessDeal(p0, p1) -} - -func (s *FullNodeStub) ClientStatelessDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) { - return nil, ErrNotSupported -} - func (s *FullNodeStruct) CreateBackup(p0 context.Context, p1 string) error { if s.Internal.CreateBackup == nil { return ErrNotSupported diff --git a/api/v0api/v0mocks/mock_full.go b/api/v0api/v0mocks/mock_full.go index df67d087656..092d93b67bf 100644 --- a/api/v0api/v0mocks/mock_full.go +++ b/api/v0api/v0mocks/mock_full.go @@ -20,9 +20,6 @@ import ( address "github.com/filecoin-project/go-address" bitfield "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - retrievalmarket "github.com/filecoin-project/go-fil-markets/retrievalmarket" - storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket" auth "github.com/filecoin-project/go-jsonrpc/auth" abi "github.com/filecoin-project/go-state-types/abi" big "github.com/filecoin-project/go-state-types/big" @@ -36,13 +33,10 @@ import ( api "github.com/filecoin-project/lotus/api" apitypes "github.com/filecoin-project/lotus/api/types" - v0api "github.com/filecoin-project/lotus/api/v0api" miner1 "github.com/filecoin-project/lotus/chain/actors/builtin/miner" types "github.com/filecoin-project/lotus/chain/types" alerting "github.com/filecoin-project/lotus/journal/alerting" - marketevents "github.com/filecoin-project/lotus/markets/loggers" dtypes "github.com/filecoin-project/lotus/node/modules/dtypes" - imports "github.com/filecoin-project/lotus/node/repo/imports" ) // MockFullNode is a mock of FullNode interface. @@ -455,404 +449,6 @@ func (mr *MockFullNodeMockRecorder) ChainTipSetWeight(arg0, arg1 interface{}) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainTipSetWeight", reflect.TypeOf((*MockFullNode)(nil).ChainTipSetWeight), arg0, arg1) } -// ClientCalcCommP mocks base method. -func (m *MockFullNode) ClientCalcCommP(arg0 context.Context, arg1 string) (*api.CommPRet, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCalcCommP", arg0, arg1) - ret0, _ := ret[0].(*api.CommPRet) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientCalcCommP indicates an expected call of ClientCalcCommP. -func (mr *MockFullNodeMockRecorder) ClientCalcCommP(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCalcCommP", reflect.TypeOf((*MockFullNode)(nil).ClientCalcCommP), arg0, arg1) -} - -// ClientCancelDataTransfer mocks base method. -func (m *MockFullNode) ClientCancelDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCancelDataTransfer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientCancelDataTransfer indicates an expected call of ClientCancelDataTransfer. -func (mr *MockFullNodeMockRecorder) ClientCancelDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientCancelDataTransfer), arg0, arg1, arg2, arg3) -} - -// ClientCancelRetrievalDeal mocks base method. -func (m *MockFullNode) ClientCancelRetrievalDeal(arg0 context.Context, arg1 retrievalmarket.DealID) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCancelRetrievalDeal", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientCancelRetrievalDeal indicates an expected call of ClientCancelRetrievalDeal. -func (mr *MockFullNodeMockRecorder) ClientCancelRetrievalDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelRetrievalDeal", reflect.TypeOf((*MockFullNode)(nil).ClientCancelRetrievalDeal), arg0, arg1) -} - -// ClientDataTransferUpdates mocks base method. -func (m *MockFullNode) ClientDataTransferUpdates(arg0 context.Context) (<-chan api.DataTransferChannel, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDataTransferUpdates", arg0) - ret0, _ := ret[0].(<-chan api.DataTransferChannel) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDataTransferUpdates indicates an expected call of ClientDataTransferUpdates. -func (mr *MockFullNodeMockRecorder) ClientDataTransferUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDataTransferUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientDataTransferUpdates), arg0) -} - -// ClientDealPieceCID mocks base method. -func (m *MockFullNode) ClientDealPieceCID(arg0 context.Context, arg1 cid.Cid) (api.DataCIDSize, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDealPieceCID", arg0, arg1) - ret0, _ := ret[0].(api.DataCIDSize) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDealPieceCID indicates an expected call of ClientDealPieceCID. -func (mr *MockFullNodeMockRecorder) ClientDealPieceCID(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealPieceCID", reflect.TypeOf((*MockFullNode)(nil).ClientDealPieceCID), arg0, arg1) -} - -// ClientDealSize mocks base method. -func (m *MockFullNode) ClientDealSize(arg0 context.Context, arg1 cid.Cid) (api.DataSize, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDealSize", arg0, arg1) - ret0, _ := ret[0].(api.DataSize) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDealSize indicates an expected call of ClientDealSize. -func (mr *MockFullNodeMockRecorder) ClientDealSize(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealSize", reflect.TypeOf((*MockFullNode)(nil).ClientDealSize), arg0, arg1) -} - -// ClientFindData mocks base method. -func (m *MockFullNode) ClientFindData(arg0 context.Context, arg1 cid.Cid, arg2 *cid.Cid) ([]api.QueryOffer, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientFindData", arg0, arg1, arg2) - ret0, _ := ret[0].([]api.QueryOffer) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientFindData indicates an expected call of ClientFindData. -func (mr *MockFullNodeMockRecorder) ClientFindData(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientFindData", reflect.TypeOf((*MockFullNode)(nil).ClientFindData), arg0, arg1, arg2) -} - -// ClientGenCar mocks base method. -func (m *MockFullNode) ClientGenCar(arg0 context.Context, arg1 api.FileRef, arg2 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGenCar", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientGenCar indicates an expected call of ClientGenCar. -func (mr *MockFullNodeMockRecorder) ClientGenCar(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGenCar", reflect.TypeOf((*MockFullNode)(nil).ClientGenCar), arg0, arg1, arg2) -} - -// ClientGetDealInfo mocks base method. -func (m *MockFullNode) ClientGetDealInfo(arg0 context.Context, arg1 cid.Cid) (*api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealInfo", arg0, arg1) - ret0, _ := ret[0].(*api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealInfo indicates an expected call of ClientGetDealInfo. -func (mr *MockFullNodeMockRecorder) ClientGetDealInfo(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealInfo", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealInfo), arg0, arg1) -} - -// ClientGetDealStatus mocks base method. -func (m *MockFullNode) ClientGetDealStatus(arg0 context.Context, arg1 uint64) (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealStatus", arg0, arg1) - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealStatus indicates an expected call of ClientGetDealStatus. -func (mr *MockFullNodeMockRecorder) ClientGetDealStatus(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealStatus", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealStatus), arg0, arg1) -} - -// ClientGetDealUpdates mocks base method. -func (m *MockFullNode) ClientGetDealUpdates(arg0 context.Context) (<-chan api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealUpdates", arg0) - ret0, _ := ret[0].(<-chan api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealUpdates indicates an expected call of ClientGetDealUpdates. -func (mr *MockFullNodeMockRecorder) ClientGetDealUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealUpdates), arg0) -} - -// ClientGetRetrievalUpdates mocks base method. -func (m *MockFullNode) ClientGetRetrievalUpdates(arg0 context.Context) (<-chan api.RetrievalInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetRetrievalUpdates", arg0) - ret0, _ := ret[0].(<-chan api.RetrievalInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetRetrievalUpdates indicates an expected call of ClientGetRetrievalUpdates. -func (mr *MockFullNodeMockRecorder) ClientGetRetrievalUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetRetrievalUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetRetrievalUpdates), arg0) -} - -// ClientHasLocal mocks base method. -func (m *MockFullNode) ClientHasLocal(arg0 context.Context, arg1 cid.Cid) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientHasLocal", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientHasLocal indicates an expected call of ClientHasLocal. -func (mr *MockFullNodeMockRecorder) ClientHasLocal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientHasLocal", reflect.TypeOf((*MockFullNode)(nil).ClientHasLocal), arg0, arg1) -} - -// ClientImport mocks base method. -func (m *MockFullNode) ClientImport(arg0 context.Context, arg1 api.FileRef) (*api.ImportRes, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientImport", arg0, arg1) - ret0, _ := ret[0].(*api.ImportRes) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientImport indicates an expected call of ClientImport. -func (mr *MockFullNodeMockRecorder) ClientImport(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientImport", reflect.TypeOf((*MockFullNode)(nil).ClientImport), arg0, arg1) -} - -// ClientListDataTransfers mocks base method. -func (m *MockFullNode) ClientListDataTransfers(arg0 context.Context) ([]api.DataTransferChannel, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListDataTransfers", arg0) - ret0, _ := ret[0].([]api.DataTransferChannel) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListDataTransfers indicates an expected call of ClientListDataTransfers. -func (mr *MockFullNodeMockRecorder) ClientListDataTransfers(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDataTransfers", reflect.TypeOf((*MockFullNode)(nil).ClientListDataTransfers), arg0) -} - -// ClientListDeals mocks base method. -func (m *MockFullNode) ClientListDeals(arg0 context.Context) ([]api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListDeals", arg0) - ret0, _ := ret[0].([]api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListDeals indicates an expected call of ClientListDeals. -func (mr *MockFullNodeMockRecorder) ClientListDeals(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDeals", reflect.TypeOf((*MockFullNode)(nil).ClientListDeals), arg0) -} - -// ClientListImports mocks base method. -func (m *MockFullNode) ClientListImports(arg0 context.Context) ([]api.Import, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListImports", arg0) - ret0, _ := ret[0].([]api.Import) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListImports indicates an expected call of ClientListImports. -func (mr *MockFullNodeMockRecorder) ClientListImports(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListImports", reflect.TypeOf((*MockFullNode)(nil).ClientListImports), arg0) -} - -// ClientListRetrievals mocks base method. -func (m *MockFullNode) ClientListRetrievals(arg0 context.Context) ([]api.RetrievalInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListRetrievals", arg0) - ret0, _ := ret[0].([]api.RetrievalInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListRetrievals indicates an expected call of ClientListRetrievals. -func (mr *MockFullNodeMockRecorder) ClientListRetrievals(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListRetrievals", reflect.TypeOf((*MockFullNode)(nil).ClientListRetrievals), arg0) -} - -// ClientMinerQueryOffer mocks base method. -func (m *MockFullNode) ClientMinerQueryOffer(arg0 context.Context, arg1 address.Address, arg2 cid.Cid, arg3 *cid.Cid) (api.QueryOffer, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientMinerQueryOffer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(api.QueryOffer) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientMinerQueryOffer indicates an expected call of ClientMinerQueryOffer. -func (mr *MockFullNodeMockRecorder) ClientMinerQueryOffer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientMinerQueryOffer", reflect.TypeOf((*MockFullNode)(nil).ClientMinerQueryOffer), arg0, arg1, arg2, arg3) -} - -// ClientQueryAsk mocks base method. -func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 address.Address) (*storagemarket.StorageAsk, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientQueryAsk", arg0, arg1, arg2) - ret0, _ := ret[0].(*storagemarket.StorageAsk) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientQueryAsk indicates an expected call of ClientQueryAsk. -func (mr *MockFullNodeMockRecorder) ClientQueryAsk(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientQueryAsk", reflect.TypeOf((*MockFullNode)(nil).ClientQueryAsk), arg0, arg1, arg2) -} - -// ClientRemoveImport mocks base method. -func (m *MockFullNode) ClientRemoveImport(arg0 context.Context, arg1 imports.ID) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRemoveImport", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRemoveImport indicates an expected call of ClientRemoveImport. -func (mr *MockFullNodeMockRecorder) ClientRemoveImport(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRemoveImport", reflect.TypeOf((*MockFullNode)(nil).ClientRemoveImport), arg0, arg1) -} - -// ClientRestartDataTransfer mocks base method. -func (m *MockFullNode) ClientRestartDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRestartDataTransfer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRestartDataTransfer indicates an expected call of ClientRestartDataTransfer. -func (mr *MockFullNodeMockRecorder) ClientRestartDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRestartDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientRestartDataTransfer), arg0, arg1, arg2, arg3) -} - -// ClientRetrieve mocks base method. -func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 v0api.RetrievalOrder, arg2 *api.FileRef) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRetrieve indicates an expected call of ClientRetrieve. -func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1, arg2) -} - -// ClientRetrieveTryRestartInsufficientFunds mocks base method. -func (m *MockFullNode) ClientRetrieveTryRestartInsufficientFunds(arg0 context.Context, arg1 address.Address) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieveTryRestartInsufficientFunds", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRetrieveTryRestartInsufficientFunds indicates an expected call of ClientRetrieveTryRestartInsufficientFunds. -func (mr *MockFullNodeMockRecorder) ClientRetrieveTryRestartInsufficientFunds(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveTryRestartInsufficientFunds", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveTryRestartInsufficientFunds), arg0, arg1) -} - -// ClientRetrieveWithEvents mocks base method. -func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 v0api.RetrievalOrder, arg2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieveWithEvents", arg0, arg1, arg2) - ret0, _ := ret[0].(<-chan marketevents.RetrievalEvent) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientRetrieveWithEvents indicates an expected call of ClientRetrieveWithEvents. -func (mr *MockFullNodeMockRecorder) ClientRetrieveWithEvents(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWithEvents", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWithEvents), arg0, arg1, arg2) -} - -// ClientStartDeal mocks base method. -func (m *MockFullNode) ClientStartDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientStartDeal", arg0, arg1) - ret0, _ := ret[0].(*cid.Cid) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientStartDeal indicates an expected call of ClientStartDeal. -func (mr *MockFullNodeMockRecorder) ClientStartDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStartDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStartDeal), arg0, arg1) -} - -// ClientStatelessDeal mocks base method. -func (m *MockFullNode) ClientStatelessDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientStatelessDeal", arg0, arg1) - ret0, _ := ret[0].(*cid.Cid) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientStatelessDeal indicates an expected call of ClientStatelessDeal. -func (mr *MockFullNodeMockRecorder) ClientStatelessDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStatelessDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStatelessDeal), arg0, arg1) -} - // Closing mocks base method. func (m *MockFullNode) Closing(arg0 context.Context) (<-chan struct{}, error) { m.ctrl.T.Helper() diff --git a/api/v0api/v1_wrapper.go b/api/v0api/v1_wrapper.go index 265674e718f..97b8ff597d2 100644 --- a/api/v0api/v1_wrapper.go +++ b/api/v0api/v1_wrapper.go @@ -4,21 +4,16 @@ import ( "context" "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p/core/peer" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v1api" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" - marketevents "github.com/filecoin-project/lotus/markets/loggers" ) type WrapperV1Full struct { @@ -210,158 +205,10 @@ func (w *WrapperV1Full) ChainGetRandomnessFromBeacon(ctx context.Context, tsk ty return w.StateGetRandomnessFromBeacon(ctx, personalization, randEpoch, entropy, tsk) } -func (w *WrapperV1Full) ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef) error { - events := make(chan marketevents.RetrievalEvent) - go w.clientRetrieve(ctx, order, ref, events) - - for { - select { - case evt, ok := <-events: - if !ok { // done successfully - return nil - } - - if evt.Err != "" { - return xerrors.Errorf("retrieval failed: %s", evt.Err) - } - case <-ctx.Done(): - return xerrors.Errorf("retrieval timed out") - } - } -} - -func (w *WrapperV1Full) ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) { - events := make(chan marketevents.RetrievalEvent) - go w.clientRetrieve(ctx, order, ref, events) - return events, nil -} - -func readSubscribeEvents(ctx context.Context, dealID retrievalmarket.DealID, subscribeEvents <-chan api.RetrievalInfo, events chan marketevents.RetrievalEvent) error { - for { - var subscribeEvent api.RetrievalInfo - var evt retrievalmarket.ClientEvent - select { - case <-ctx.Done(): - return xerrors.New("Retrieval Timed Out") - case subscribeEvent = <-subscribeEvents: - if subscribeEvent.ID != dealID { - // we can't check the deal ID ahead of time because: - // 1. We need to subscribe before retrieving. - // 2. We won't know the deal ID until after retrieving. - continue - } - if subscribeEvent.Event != nil { - evt = *subscribeEvent.Event - } - } - - select { - case <-ctx.Done(): - return xerrors.New("Retrieval Timed Out") - case events <- marketevents.RetrievalEvent{ - Event: evt, - Status: subscribeEvent.Status, - BytesReceived: subscribeEvent.BytesReceived, - FundsSpent: subscribeEvent.TotalPaid, - }: - } - - switch subscribeEvent.Status { - case retrievalmarket.DealStatusCompleted: - return nil - case retrievalmarket.DealStatusRejected: - return xerrors.Errorf("Retrieval Proposal Rejected: %s", subscribeEvent.Message) - case - retrievalmarket.DealStatusDealNotFound, - retrievalmarket.DealStatusErrored: - return xerrors.Errorf("Retrieval Error: %s", subscribeEvent.Message) - } - } -} - -func (w *WrapperV1Full) clientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef, events chan marketevents.RetrievalEvent) { - defer close(events) - - finish := func(e error) { - if e != nil { - events <- marketevents.RetrievalEvent{Err: e.Error(), FundsSpent: big.Zero()} - } - } - - var dealID retrievalmarket.DealID - if order.FromLocalCAR == "" { - // Subscribe to events before retrieving to avoid losing events. - subscribeCtx, cancel := context.WithCancel(ctx) - defer cancel() - retrievalEvents, err := w.ClientGetRetrievalUpdates(subscribeCtx) - - if err != nil { - finish(xerrors.Errorf("GetRetrievalUpdates failed: %w", err)) - return - } - - retrievalRes, err := w.FullNode.ClientRetrieve(ctx, api.RetrievalOrder{ - Root: order.Root, - Piece: order.Piece, - Size: order.Size, - Total: order.Total, - UnsealPrice: order.UnsealPrice, - PaymentInterval: order.PaymentInterval, - PaymentIntervalIncrease: order.PaymentIntervalIncrease, - Client: order.Client, - Miner: order.Miner, - MinerPeer: order.MinerPeer, - }) - - if err != nil { - finish(xerrors.Errorf("Retrieve failed: %w", err)) - return - } - - dealID = retrievalRes.DealID - - err = readSubscribeEvents(ctx, retrievalRes.DealID, retrievalEvents, events) - if err != nil { - finish(xerrors.Errorf("Retrieve: %w", err)) - return - } - } - - // If ref is nil, it only fetches the data into the configured blockstore. - if ref == nil { - finish(nil) - return - } - - eref := api.ExportRef{ - Root: order.Root, - FromLocalCAR: order.FromLocalCAR, - DealID: dealID, - } - - if order.DatamodelPathSelector != nil { - s := api.Selector(*order.DatamodelPathSelector) - eref.DAGs = append(eref.DAGs, api.DagSpec{ - DataSelector: &s, - ExportMerkleProof: true, - }) - } - - finish(w.ClientExport(ctx, eref, *ref)) -} - func (w *WrapperV1Full) PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error) { return w.FullNode.PaychFund(ctx, from, to, amt) } -func (w *WrapperV1Full) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) { - a, err := w.FullNode.ClientQueryAsk(ctx, p, miner) - if err != nil { - return nil, err - } - return a.Response, nil -} - func (w *WrapperV1Full) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) { return w.StateGetBeaconEntry(ctx, epoch) } diff --git a/build/openrpc/full.json b/build/openrpc/full.json index ff04e60690f..72f36e9f1fb 100644 --- a/build/openrpc/full.json +++ b/build/openrpc/full.json @@ -37,7 +37,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1655" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1598" } }, { @@ -60,7 +60,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1666" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1609" } }, { @@ -103,7 +103,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1677" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1620" } }, { @@ -214,7 +214,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1699" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1642" } }, { @@ -454,7 +454,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1710" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1653" } }, { @@ -685,7 +685,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1721" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1664" } }, { @@ -784,7 +784,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1732" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1675" } }, { @@ -816,7 +816,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1743" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1686" } }, { @@ -922,7 +922,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1754" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1697" } }, { @@ -1019,7 +1019,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1765" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1708" } }, { @@ -1078,7 +1078,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1776" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1719" } }, { @@ -1171,7 +1171,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1787" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1730" } }, { @@ -1255,7 +1255,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1798" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1741" } }, { @@ -1355,7 +1355,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1809" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1752" } }, { @@ -1411,7 +1411,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1820" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1763" } }, { @@ -1484,7 +1484,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1831" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1774" } }, { @@ -1557,7 +1557,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1842" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1785" } }, { @@ -1604,7 +1604,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1853" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1796" } }, { @@ -1636,7 +1636,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1864" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1807" } }, { @@ -1691,7 +1691,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1875" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1818" } }, { @@ -1743,7 +1743,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1897" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1840" } }, { @@ -1780,7 +1780,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1908" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1851" } }, { @@ -1827,7 +1827,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1919" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1862" } }, { @@ -1874,7 +1874,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1930" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1873" } }, { @@ -1954,7 +1954,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1941" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1884" } }, { @@ -2006,2748 +2006,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1952" - } - }, - { - "name": "Filecoin.ClientCalcCommP", - "description": "```go\nfunc (s *FullNodeStruct) ClientCalcCommP(p0 context.Context, p1 string) (*CommPRet, error) {\n\tif s.Internal.ClientCalcCommP == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientCalcCommP(p0, p1)\n}\n```", - "summary": "ClientCalcCommP calculates the CommP for a specified file\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*CommPRet", - "description": "*CommPRet", - "summary": "", - "schema": { - "examples": [ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 1024 - } - ], - "additionalProperties": false, - "properties": { - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "Size": { - "title": "number", - "type": "number" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1963" - } - }, - { - "name": "Filecoin.ClientCancelDataTransfer", - "description": "```go\nfunc (s *FullNodeStruct) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {\n\tif s.Internal.ClientCancelDataTransfer == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientCancelDataTransfer(p0, p1, p2, p3)\n}\n```", - "summary": "ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "datatransfer.TransferID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 3 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "peer.ID", - "summary": "", - "schema": { - "examples": [ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p3", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1974" - } - }, - { - "name": "Filecoin.ClientCancelRetrievalDeal", - "description": "```go\nfunc (s *FullNodeStruct) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error {\n\tif s.Internal.ClientCancelRetrievalDeal == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientCancelRetrievalDeal(p0, p1)\n}\n```", - "summary": "ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "retrievalmarket.DealID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 5 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1985" - } - }, - { - "name": "Filecoin.ClientDealPieceCID", - "description": "```go\nfunc (s *FullNodeStruct) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) {\n\tif s.Internal.ClientDealPieceCID == nil {\n\t\treturn *new(DataCIDSize), ErrNotSupported\n\t}\n\treturn s.Internal.ClientDealPieceCID(p0, p1)\n}\n```", - "summary": "ClientCalcCommP calculates the CommP and data size of the specified CID\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "DataCIDSize", - "description": "DataCIDSize", - "summary": "", - "schema": { - "examples": [ - { - "PayloadSize": 9, - "PieceSize": 1032, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - ], - "additionalProperties": false, - "properties": { - "PayloadSize": { - "title": "number", - "type": "number" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2007" - } - }, - { - "name": "Filecoin.ClientDealSize", - "description": "```go\nfunc (s *FullNodeStruct) ClientDealSize(p0 context.Context, p1 cid.Cid) (DataSize, error) {\n\tif s.Internal.ClientDealSize == nil {\n\t\treturn *new(DataSize), ErrNotSupported\n\t}\n\treturn s.Internal.ClientDealSize(p0, p1)\n}\n```", - "summary": "ClientDealSize calculates real deal data size\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "DataSize", - "description": "DataSize", - "summary": "", - "schema": { - "examples": [ - { - "PayloadSize": 9, - "PieceSize": 1032 - } - ], - "additionalProperties": false, - "properties": { - "PayloadSize": { - "title": "number", - "type": "number" - }, - "PieceSize": { - "title": "number", - "type": "number" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2018" - } - }, - { - "name": "Filecoin.ClientExport", - "description": "```go\nfunc (s *FullNodeStruct) ClientExport(p0 context.Context, p1 ExportRef, p2 FileRef) error {\n\tif s.Internal.ClientExport == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientExport(p0, p1, p2)\n}\n```", - "summary": "ClientExport exports a file stored in the local filestore to a system file\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "ExportRef", - "summary": "", - "schema": { - "examples": [ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DAGs": [ - { - "DataSelector": "Links/21/Hash/Links/42/Hash", - "ExportMerkleProof": true - } - ], - "FromLocalCAR": "string value", - "DealID": 5 - } - ], - "additionalProperties": false, - "properties": { - "DAGs": { - "items": { - "additionalProperties": false, - "properties": { - "DataSelector": { - "type": "string" - }, - "ExportMerkleProof": { - "type": "boolean" - } - }, - "type": "object" - }, - "type": "array" - }, - "DealID": { - "title": "number", - "type": "number" - }, - "FromLocalCAR": { - "type": "string" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "FileRef", - "summary": "", - "schema": { - "examples": [ - { - "Path": "string value", - "IsCAR": true - } - ], - "additionalProperties": false, - "properties": { - "IsCAR": { - "type": "boolean" - }, - "Path": { - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2029" - } - }, - { - "name": "Filecoin.ClientFindData", - "description": "```go\nfunc (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) {\n\tif s.Internal.ClientFindData == nil {\n\t\treturn *new([]QueryOffer), ErrNotSupported\n\t}\n\treturn s.Internal.ClientFindData(p0, p1, p2)\n}\n```", - "summary": "ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer).\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "*cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "[]QueryOffer", - "description": "[]QueryOffer", - "summary": "", - "schema": { - "examples": [ - [ - { - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "Err": { - "type": "string" - }, - "MinPrice": { - "additionalProperties": false, - "type": "object" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "MinerPeer": { - "additionalProperties": false, - "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, - "ID": { - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": "object" - }, - "PaymentInterval": { - "title": "number", - "type": "number" - }, - "PaymentIntervalIncrease": { - "title": "number", - "type": "number" - }, - "Piece": { - "title": "Content Identifier", - "type": "string" - }, - "PricePerByte": { - "additionalProperties": false, - "type": "object" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "Size": { - "title": "number", - "type": "number" - }, - "UnsealPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2040" - } - }, - { - "name": "Filecoin.ClientGenCar", - "description": "```go\nfunc (s *FullNodeStruct) ClientGenCar(p0 context.Context, p1 FileRef, p2 string) error {\n\tif s.Internal.ClientGenCar == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientGenCar(p0, p1, p2)\n}\n```", - "summary": "ClientGenCar generates a CAR file for the specified file.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "FileRef", - "summary": "", - "schema": { - "examples": [ - { - "Path": "string value", - "IsCAR": true - } - ], - "additionalProperties": false, - "properties": { - "IsCAR": { - "type": "boolean" - }, - "Path": { - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2051" - } - }, - { - "name": "Filecoin.ClientGetDealInfo", - "description": "```go\nfunc (s *FullNodeStruct) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*DealInfo, error) {\n\tif s.Internal.ClientGetDealInfo == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientGetDealInfo(p0, p1)\n}\n```", - "summary": "ClientGetDealInfo returns the latest information about a given deal.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*DealInfo", - "description": "*DealInfo", - "summary": "", - "schema": { - "examples": [ - { - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - } - ], - "additionalProperties": false, - "properties": { - "CreationTime": { - "format": "date-time", - "type": "string" - }, - "DataRef": { - "additionalProperties": false, - "properties": { - "PieceCid": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "RawBlockSize": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "TransferType": { - "type": "string" - } - }, - "type": "object" - }, - "DataTransfer": { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": "object" - }, - "DealID": { - "title": "number", - "type": "number" - }, - "DealStages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "ExpectedDuration": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Duration": { - "title": "number", - "type": "number" - }, - "Message": { - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PricePerEpoch": { - "additionalProperties": false, - "type": "object" - }, - "ProposalCid": { - "title": "Content Identifier", - "type": "string" - }, - "Provider": { - "additionalProperties": false, - "type": "object" - }, - "Size": { - "title": "number", - "type": "number" - }, - "State": { - "title": "number", - "type": "number" - }, - "TransferChannelID": { - "additionalProperties": false, - "properties": { - "ID": { - "title": "number", - "type": "number" - }, - "Initiator": { - "type": "string" - }, - "Responder": { - "type": "string" - } - }, - "type": "object" - }, - "Verified": { - "type": "boolean" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2062" - } - }, - { - "name": "Filecoin.ClientGetDealStatus", - "description": "```go\nfunc (s *FullNodeStruct) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) {\n\tif s.Internal.ClientGetDealStatus == nil {\n\t\treturn \"\", ErrNotSupported\n\t}\n\treturn s.Internal.ClientGetDealStatus(p0, p1)\n}\n```", - "summary": "ClientGetDealStatus returns status given a code\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "uint64", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 42 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "string", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2073" - } - }, - { - "name": "Filecoin.ClientHasLocal", - "description": "```go\nfunc (s *FullNodeStruct) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) {\n\tif s.Internal.ClientHasLocal == nil {\n\t\treturn false, ErrNotSupported\n\t}\n\treturn s.Internal.ClientHasLocal(p0, p1)\n}\n```", - "summary": "ClientHasLocal indicates whether a certain CID is locally stored.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "bool", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2106" - } - }, - { - "name": "Filecoin.ClientImport", - "description": "```go\nfunc (s *FullNodeStruct) ClientImport(p0 context.Context, p1 FileRef) (*ImportRes, error) {\n\tif s.Internal.ClientImport == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientImport(p0, p1)\n}\n```", - "summary": "ClientImport imports file under the specified path into filestore.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "FileRef", - "summary": "", - "schema": { - "examples": [ - { - "Path": "string value", - "IsCAR": true - } - ], - "additionalProperties": false, - "properties": { - "IsCAR": { - "type": "boolean" - }, - "Path": { - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*ImportRes", - "description": "*ImportRes", - "summary": "", - "schema": { - "examples": [ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ImportID": 50 - } - ], - "additionalProperties": false, - "properties": { - "ImportID": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2117" - } - }, - { - "name": "Filecoin.ClientListDataTransfers", - "description": "```go\nfunc (s *FullNodeStruct) ClientListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) {\n\tif s.Internal.ClientListDataTransfers == nil {\n\t\treturn *new([]DataTransferChannel), ErrNotSupported\n\t}\n\treturn s.Internal.ClientListDataTransfers(p0)\n}\n```", - "summary": "ClientListTransfers returns the status of all ongoing transfers of data\n", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]DataTransferChannel", - "description": "[]DataTransferChannel", - "summary": "", - "schema": { - "examples": [ - [ - { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2128" - } - }, - { - "name": "Filecoin.ClientListDeals", - "description": "```go\nfunc (s *FullNodeStruct) ClientListDeals(p0 context.Context) ([]DealInfo, error) {\n\tif s.Internal.ClientListDeals == nil {\n\t\treturn *new([]DealInfo), ErrNotSupported\n\t}\n\treturn s.Internal.ClientListDeals(p0)\n}\n```", - "summary": "ClientListDeals returns information about the deals made by the local client.\n", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]DealInfo", - "description": "[]DealInfo", - "summary": "", - "schema": { - "examples": [ - [ - { - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "CreationTime": { - "format": "date-time", - "type": "string" - }, - "DataRef": { - "additionalProperties": false, - "properties": { - "PieceCid": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "RawBlockSize": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "TransferType": { - "type": "string" - } - }, - "type": "object" - }, - "DataTransfer": { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": "object" - }, - "DealID": { - "title": "number", - "type": "number" - }, - "DealStages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "ExpectedDuration": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Duration": { - "title": "number", - "type": "number" - }, - "Message": { - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PricePerEpoch": { - "additionalProperties": false, - "type": "object" - }, - "ProposalCid": { - "title": "Content Identifier", - "type": "string" - }, - "Provider": { - "additionalProperties": false, - "type": "object" - }, - "Size": { - "title": "number", - "type": "number" - }, - "State": { - "title": "number", - "type": "number" - }, - "TransferChannelID": { - "additionalProperties": false, - "properties": { - "ID": { - "title": "number", - "type": "number" - }, - "Initiator": { - "type": "string" - }, - "Responder": { - "type": "string" - } - }, - "type": "object" - }, - "Verified": { - "type": "boolean" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2139" - } - }, - { - "name": "Filecoin.ClientListImports", - "description": "```go\nfunc (s *FullNodeStruct) ClientListImports(p0 context.Context) ([]Import, error) {\n\tif s.Internal.ClientListImports == nil {\n\t\treturn *new([]Import), ErrNotSupported\n\t}\n\treturn s.Internal.ClientListImports(p0)\n}\n```", - "summary": "ClientListImports lists imported files and their root CIDs\n", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]Import", - "description": "[]Import", - "summary": "", - "schema": { - "examples": [ - [ - { - "Key": 50, - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Source": "string value", - "FilePath": "string value", - "CARPath": "string value" - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "CARPath": { - "type": "string" - }, - "Err": { - "type": "string" - }, - "FilePath": { - "type": "string" - }, - "Key": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "Source": { - "type": "string" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2150" - } - }, - { - "name": "Filecoin.ClientListRetrievals", - "description": "```go\nfunc (s *FullNodeStruct) ClientListRetrievals(p0 context.Context) ([]RetrievalInfo, error) {\n\tif s.Internal.ClientListRetrievals == nil {\n\t\treturn *new([]RetrievalInfo), ErrNotSupported\n\t}\n\treturn s.Internal.ClientListRetrievals(p0)\n}\n```", - "summary": "ClientListRetrievals returns information about retrievals made by the local client\n", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]RetrievalInfo", - "description": "[]RetrievalInfo", - "summary": "", - "schema": { - "examples": [ - [ - { - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "UnsealPrice": "0", - "Status": 0, - "Message": "string value", - "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "BytesReceived": 42, - "BytesPaidFor": 42, - "TotalPaid": "0", - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Event": 5 - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "BytesPaidFor": { - "title": "number", - "type": "number" - }, - "BytesReceived": { - "title": "number", - "type": "number" - }, - "DataTransfer": { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": "object" - }, - "Event": { - "title": "number", - "type": "number" - }, - "ID": { - "title": "number", - "type": "number" - }, - "Message": { - "type": "string" - }, - "PayloadCID": { - "title": "Content Identifier", - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PricePerByte": { - "additionalProperties": false, - "type": "object" - }, - "Provider": { - "type": "string" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TotalPaid": { - "additionalProperties": false, - "type": "object" - }, - "TransferChannelID": { - "additionalProperties": false, - "properties": { - "ID": { - "title": "number", - "type": "number" - }, - "Initiator": { - "type": "string" - }, - "Responder": { - "type": "string" - } - }, - "type": "object" - }, - "UnsealPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2161" - } - }, - { - "name": "Filecoin.ClientMinerQueryOffer", - "description": "```go\nfunc (s *FullNodeStruct) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) {\n\tif s.Internal.ClientMinerQueryOffer == nil {\n\t\treturn *new(QueryOffer), ErrNotSupported\n\t}\n\treturn s.Internal.ClientMinerQueryOffer(p0, p1, p2, p3)\n}\n```", - "summary": "ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "address.Address", - "summary": "", - "schema": { - "examples": [ - "f01234" - ], - "additionalProperties": false, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p3", - "description": "*cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "QueryOffer", - "description": "QueryOffer", - "summary": "", - "schema": { - "examples": [ - { - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - } - ], - "additionalProperties": false, - "properties": { - "Err": { - "type": "string" - }, - "MinPrice": { - "additionalProperties": false, - "type": "object" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "MinerPeer": { - "additionalProperties": false, - "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, - "ID": { - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": "object" - }, - "PaymentInterval": { - "title": "number", - "type": "number" - }, - "PaymentIntervalIncrease": { - "title": "number", - "type": "number" - }, - "Piece": { - "title": "Content Identifier", - "type": "string" - }, - "PricePerByte": { - "additionalProperties": false, - "type": "object" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "Size": { - "title": "number", - "type": "number" - }, - "UnsealPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2172" - } - }, - { - "name": "Filecoin.ClientQueryAsk", - "description": "```go\nfunc (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) {\n\tif s.Internal.ClientQueryAsk == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientQueryAsk(p0, p1, p2)\n}\n```", - "summary": "ClientQueryAsk returns a signed StorageAsk from the specified miner.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "peer.ID", - "summary": "", - "schema": { - "examples": [ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "address.Address", - "summary": "", - "schema": { - "examples": [ - "f01234" - ], - "additionalProperties": false, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*StorageAsk", - "description": "*StorageAsk", - "summary": "", - "schema": { - "examples": [ - { - "Response": { - "Price": "0", - "VerifiedPrice": "0", - "MinPieceSize": 1032, - "MaxPieceSize": 1032, - "Miner": "f01234", - "Timestamp": 10101, - "Expiry": 10101, - "SeqNo": 42 - }, - "DealProtocols": [ - "string value" - ] - } - ], - "additionalProperties": false, - "properties": { - "DealProtocols": { - "items": { - "type": "string" - }, - "type": "array" - }, - "Response": {} - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2183" - } - }, - { - "name": "Filecoin.ClientRemoveImport", - "description": "```go\nfunc (s *FullNodeStruct) ClientRemoveImport(p0 context.Context, p1 imports.ID) error {\n\tif s.Internal.ClientRemoveImport == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientRemoveImport(p0, p1)\n}\n```", - "summary": "ClientRemoveImport removes file import\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "imports.ID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 50 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2194" - } - }, - { - "name": "Filecoin.ClientRestartDataTransfer", - "description": "```go\nfunc (s *FullNodeStruct) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {\n\tif s.Internal.ClientRestartDataTransfer == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientRestartDataTransfer(p0, p1, p2, p3)\n}\n```", - "summary": "ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "datatransfer.TransferID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 3 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "peer.ID", - "summary": "", - "schema": { - "examples": [ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p3", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2205" - } - }, - { - "name": "Filecoin.ClientRetrieve", - "description": "```go\nfunc (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) {\n\tif s.Internal.ClientRetrieve == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientRetrieve(p0, p1)\n}\n```", - "summary": "ClientRetrieve initiates the retrieval of a file, as specified in the order.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "RetrievalOrder", - "summary": "", - "schema": { - "examples": [ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DataSelector": "Links/21/Hash/Links/42/Hash", - "Size": 42, - "Total": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Client": "f01234", - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - }, - "RemoteStore": "00000000-0000-0000-0000-000000000000" - } - ], - "additionalProperties": false, - "properties": { - "Client": { - "additionalProperties": false, - "type": "object" - }, - "DataSelector": { - "type": "string" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "MinerPeer": { - "additionalProperties": false, - "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, - "ID": { - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": "object" - }, - "PaymentInterval": { - "title": "number", - "type": "number" - }, - "PaymentIntervalIncrease": { - "title": "number", - "type": "number" - }, - "Piece": { - "title": "Content Identifier", - "type": "string" - }, - "RemoteStore": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "maxItems": 16, - "minItems": 16, - "type": "array" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "Size": { - "title": "number", - "type": "number" - }, - "Total": { - "additionalProperties": false, - "type": "object" - }, - "UnsealPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*RestrievalRes", - "description": "*RestrievalRes", - "summary": "", - "schema": { - "examples": [ - { - "DealID": 5 - } - ], - "additionalProperties": false, - "properties": { - "DealID": { - "title": "number", - "type": "number" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2216" - } - }, - { - "name": "Filecoin.ClientRetrieveTryRestartInsufficientFunds", - "description": "```go\nfunc (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error {\n\tif s.Internal.ClientRetrieveTryRestartInsufficientFunds == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientRetrieveTryRestartInsufficientFunds(p0, p1)\n}\n```", - "summary": "ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel\nwhich are stuck due to insufficient funds\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "address.Address", - "summary": "", - "schema": { - "examples": [ - "f01234" - ], - "additionalProperties": false, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2227" - } - }, - { - "name": "Filecoin.ClientRetrieveWait", - "description": "```go\nfunc (s *FullNodeStruct) ClientRetrieveWait(p0 context.Context, p1 retrievalmarket.DealID) error {\n\tif s.Internal.ClientRetrieveWait == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientRetrieveWait(p0, p1)\n}\n```", - "summary": "ClientRetrieveWait waits for retrieval to be complete\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "retrievalmarket.DealID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 5 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2238" - } - }, - { - "name": "Filecoin.ClientStartDeal", - "description": "```go\nfunc (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) {\n\tif s.Internal.ClientStartDeal == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientStartDeal(p0, p1)\n}\n```", - "summary": "ClientStartDeal proposes a deal with a miner.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "*StartDealParams", - "summary": "", - "schema": { - "examples": [ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } - ], - "additionalProperties": false, - "properties": { - "Data": { - "additionalProperties": false, - "properties": { - "PieceCid": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "RawBlockSize": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "TransferType": { - "type": "string" - } - }, - "type": "object" - }, - "DealStartEpoch": { - "title": "number", - "type": "number" - }, - "EpochPrice": { - "additionalProperties": false, - "type": "object" - }, - "FastRetrieval": { - "type": "boolean" - }, - "MinBlocksDuration": { - "title": "number", - "type": "number" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "ProviderCollateral": { - "additionalProperties": false, - "type": "object" - }, - "VerifiedDeal": { - "type": "boolean" - }, - "Wallet": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*cid.Cid", - "description": "*cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2249" - } - }, - { - "name": "Filecoin.ClientStatelessDeal", - "description": "```go\nfunc (s *FullNodeStruct) ClientStatelessDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) {\n\tif s.Internal.ClientStatelessDeal == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientStatelessDeal(p0, p1)\n}\n```", - "summary": "ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "*StartDealParams", - "summary": "", - "schema": { - "examples": [ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } - ], - "additionalProperties": false, - "properties": { - "Data": { - "additionalProperties": false, - "properties": { - "PieceCid": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "RawBlockSize": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "TransferType": { - "type": "string" - } - }, - "type": "object" - }, - "DealStartEpoch": { - "title": "number", - "type": "number" - }, - "EpochPrice": { - "additionalProperties": false, - "type": "object" - }, - "FastRetrieval": { - "type": "boolean" - }, - "MinBlocksDuration": { - "title": "number", - "type": "number" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "ProviderCollateral": { - "additionalProperties": false, - "type": "object" - }, - "VerifiedDeal": { - "type": "boolean" - }, - "Wallet": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*cid.Cid", - "description": "*cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2260" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1895" } }, { @@ -4786,7 +2045,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2271" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1906" } }, { @@ -4833,7 +2092,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2282" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1917" } }, { @@ -4888,7 +2147,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2293" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1928" } }, { @@ -4917,7 +2176,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2304" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1939" } }, { @@ -5054,7 +2313,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2315" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1950" } }, { @@ -5083,7 +2342,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2326" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1961" } }, { @@ -5137,7 +2396,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2337" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1972" } }, { @@ -5228,7 +2487,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2348" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1983" } }, { @@ -5256,7 +2515,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2359" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1994" } }, { @@ -5346,7 +2605,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2370" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2005" } }, { @@ -5602,7 +2861,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2381" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2016" } }, { @@ -5847,7 +3106,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2392" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2027" } }, { @@ -5903,7 +3162,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2403" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2038" } }, { @@ -5950,7 +3209,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2414" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2049" } }, { @@ -6048,7 +3307,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2425" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2060" } }, { @@ -6114,7 +3373,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2436" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2071" } }, { @@ -6180,7 +3439,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2447" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2082" } }, { @@ -6289,7 +3548,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2458" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2093" } }, { @@ -6347,7 +3606,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2469" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2104" } }, { @@ -6469,7 +3728,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2480" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2115" } }, { @@ -6673,7 +3932,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2491" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2126" } }, { @@ -6868,7 +4127,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2502" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2137" } }, { @@ -7055,7 +4314,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2513" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2148" } }, { @@ -7259,7 +4518,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2524" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2159" } }, { @@ -7350,7 +4609,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2535" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2170" } }, { @@ -7408,7 +4667,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2546" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2181" } }, { @@ -7666,7 +4925,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2557" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2192" } }, { @@ -7941,7 +5200,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2568" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2203" } }, { @@ -7969,7 +5228,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2579" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2214" } }, { @@ -8007,7 +5266,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2590" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2225" } }, { @@ -8115,7 +5374,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2601" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2236" } }, { @@ -8153,7 +5412,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2612" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2247" } }, { @@ -8182,7 +5441,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2623" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2258" } }, { @@ -8245,7 +5504,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2634" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2269" } }, { @@ -8308,7 +5567,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2645" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2280" } }, { @@ -8353,7 +5612,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2656" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2291" } }, { @@ -8475,7 +5734,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2667" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2302" } }, { @@ -8630,7 +5889,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2678" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2313" } }, { @@ -8684,7 +5943,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2689" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2324" } }, { @@ -8738,7 +5997,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2700" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2335" } }, { @@ -8793,7 +6052,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2711" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2346" } }, { @@ -8936,7 +6195,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2722" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2357" } }, { @@ -9063,7 +6322,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2733" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2368" } }, { @@ -9165,7 +6424,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2744" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2379" } }, { @@ -9388,7 +6647,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2755" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2390" } }, { @@ -9571,7 +6830,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2766" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2401" } }, { @@ -9651,7 +6910,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2777" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2412" } }, { @@ -9696,7 +6955,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2788" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2423" } }, { @@ -9752,7 +7011,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2799" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2434" } }, { @@ -9832,7 +7091,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2810" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2445" } }, { @@ -9912,7 +7171,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2821" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2456" } }, { @@ -10397,7 +7656,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2832" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2467" } }, { @@ -10591,7 +7850,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2843" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2478" } }, { @@ -10746,7 +8005,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2854" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2489" } }, { @@ -10995,7 +8254,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2865" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2500" } }, { @@ -11150,7 +8409,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2876" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2511" } }, { @@ -11327,7 +8586,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2887" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2522" } }, { @@ -11425,7 +8684,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2898" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2533" } }, { @@ -11590,7 +8849,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2909" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2544" } }, { @@ -11629,7 +8888,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2920" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2555" } }, { @@ -11694,7 +8953,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2931" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2566" } }, { @@ -11740,7 +8999,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2942" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2577" } }, { @@ -11890,7 +9149,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2953" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2588" } }, { @@ -12027,7 +9286,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2964" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2599" } }, { @@ -12258,7 +9517,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2975" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2610" } }, { @@ -12395,7 +9654,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2986" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2621" } }, { @@ -12560,7 +9819,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2997" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2632" } }, { @@ -12637,7 +9896,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3008" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2643" } }, { @@ -12832,7 +10091,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3030" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2665" } }, { @@ -13011,7 +10270,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3041" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2676" } }, { @@ -13173,7 +10432,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3052" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2687" } }, { @@ -13321,7 +10580,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3063" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2698" } }, { @@ -13549,7 +10808,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3074" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2709" } }, { @@ -13697,7 +10956,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3085" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2720" } }, { @@ -13909,7 +11168,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3096" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2731" } }, { @@ -14115,7 +11374,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3107" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2742" } }, { @@ -14183,7 +11442,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3118" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2753" } }, { @@ -14300,7 +11559,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3129" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2764" } }, { @@ -14391,7 +11650,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3140" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2775" } }, { @@ -14477,7 +11736,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3151" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2786" } }, { @@ -14672,7 +11931,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3162" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2797" } }, { @@ -14834,7 +12093,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3173" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2808" } }, { @@ -15030,7 +12289,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3184" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2819" } }, { @@ -15210,7 +12469,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3195" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2830" } }, { @@ -15373,7 +12632,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3206" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2841" } }, { @@ -15400,7 +12659,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3217" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2852" } }, { @@ -15427,7 +12686,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3228" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2863" } }, { @@ -15526,7 +12785,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3239" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2874" } }, { @@ -15572,7 +12831,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3250" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2885" } }, { @@ -15672,7 +12931,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3261" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2896" } }, { @@ -15788,7 +13047,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3272" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2907" } }, { @@ -15836,7 +13095,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3283" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2918" } }, { @@ -15928,7 +13187,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3294" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2929" } }, { @@ -16043,7 +13302,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3305" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2940" } }, { @@ -16091,7 +13350,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3316" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2951" } }, { @@ -16128,7 +13387,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3327" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2962" } }, { @@ -16400,7 +13659,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3338" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2973" } }, { @@ -16448,7 +13707,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3349" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2984" } }, { @@ -16506,7 +13765,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3360" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2995" } }, { @@ -16711,7 +13970,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3371" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3006" } }, { @@ -16914,7 +14173,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3382" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3017" } }, { @@ -17083,7 +14342,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3393" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3028" } }, { @@ -17287,7 +14546,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3404" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3039" } }, { @@ -17454,7 +14713,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3415" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3050" } }, { @@ -17661,7 +14920,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3426" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3061" } }, { @@ -17729,7 +14988,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3437" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3072" } }, { @@ -17781,7 +15040,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3448" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3083" } }, { @@ -17830,7 +15089,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3459" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3094" } }, { @@ -17921,7 +15180,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3470" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3105" } }, { @@ -18427,7 +15686,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3481" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3116" } }, { @@ -18533,7 +15792,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3492" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3127" } }, { @@ -18585,7 +15844,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3503" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3138" } }, { @@ -19137,7 +16396,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3514" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3149" } }, { @@ -19251,7 +16510,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3525" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3160" } }, { @@ -19348,7 +16607,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3536" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3171" } }, { @@ -19448,7 +16707,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3547" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3182" } }, { @@ -19536,7 +16795,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3558" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3193" } }, { @@ -19636,7 +16895,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3569" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3204" } }, { @@ -19723,7 +16982,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3580" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3215" } }, { @@ -19814,7 +17073,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3591" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3226" } }, { @@ -19939,7 +17198,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3602" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3237" } }, { @@ -20048,7 +17307,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3613" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3248" } }, { @@ -20118,7 +17377,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3624" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3259" } }, { @@ -20221,7 +17480,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3635" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3270" } }, { @@ -20282,7 +17541,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3646" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3281" } }, { @@ -20412,7 +17671,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3657" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3292" } }, { @@ -20519,7 +17778,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3668" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3303" } }, { @@ -20733,7 +17992,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3679" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3314" } }, { @@ -20810,7 +18069,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3690" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3325" } }, { @@ -20887,7 +18146,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3701" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3336" } }, { @@ -20996,7 +18255,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3712" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3347" } }, { @@ -21105,7 +18364,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3723" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3358" } }, { @@ -21166,7 +18425,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3734" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3369" } }, { @@ -21276,7 +18535,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3745" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3380" } }, { @@ -21337,7 +18596,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3756" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3391" } }, { @@ -21405,7 +18664,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3767" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3402" } }, { @@ -21473,7 +18732,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3778" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3413" } }, { @@ -21554,7 +18813,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3789" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3424" } }, { @@ -21703,7 +18962,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3800" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3435" } }, { @@ -21775,7 +19034,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3811" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3446" } }, { @@ -21934,7 +19193,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3822" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3457" } }, { @@ -22099,7 +19358,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3833" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3468" } }, { @@ -22169,7 +19428,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3844" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3479" } }, { @@ -22237,7 +19496,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3855" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3490" } }, { @@ -22330,7 +19589,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3866" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3501" } }, { @@ -22401,7 +19660,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3877" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3512" } }, { @@ -22602,7 +19861,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3888" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3523" } }, { @@ -22734,7 +19993,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3899" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3534" } }, { @@ -22871,7 +20130,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3910" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3545" } }, { @@ -22982,7 +20241,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3921" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3556" } }, { @@ -23114,7 +20373,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3932" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3567" } }, { @@ -23245,7 +20504,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3943" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3578" } }, { @@ -23316,7 +20575,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3954" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3589" } }, { @@ -23400,7 +20659,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3965" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3600" } }, { @@ -23486,7 +20745,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3976" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3611" } }, { @@ -23669,7 +20928,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3987" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3622" } }, { @@ -23696,7 +20955,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3998" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3633" } }, { @@ -23749,7 +21008,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4009" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3644" } }, { @@ -23837,7 +21096,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4020" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3655" } }, { @@ -24288,7 +21547,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4031" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3666" } }, { @@ -24455,7 +21714,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4042" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3677" } }, { @@ -24553,7 +21812,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4053" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3688" } }, { @@ -24726,7 +21985,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4064" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3699" } }, { @@ -24824,7 +22083,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4075" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3710" } }, { @@ -24975,7 +22234,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4086" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3721" } }, { @@ -25060,7 +22319,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4097" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3732" } }, { @@ -25128,7 +22387,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4108" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3743" } }, { @@ -25180,7 +22439,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4119" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3754" } }, { @@ -25248,7 +22507,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4130" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3765" } }, { @@ -25409,7 +22668,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4141" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3776" } }, { @@ -25456,7 +22715,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4163" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3798" } }, { @@ -25503,7 +22762,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4174" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3809" } }, { @@ -25546,7 +22805,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4196" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3831" } }, { @@ -25642,7 +22901,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4207" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3842" } }, { @@ -25908,7 +23167,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4218" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3853" } }, { @@ -25931,7 +23190,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4229" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3864" } }, { @@ -25974,7 +23233,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4240" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3875" } }, { @@ -26025,7 +23284,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4251" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3886" } }, { @@ -26070,7 +23329,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4262" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3897" } }, { @@ -26098,7 +23357,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4273" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3908" } }, { @@ -26138,7 +23397,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4284" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3919" } }, { @@ -26197,7 +23456,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4295" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3930" } }, { @@ -26241,7 +23500,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4306" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3941" } }, { @@ -26300,7 +23559,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4317" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3952" } }, { @@ -26337,7 +23596,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4328" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3963" } }, { @@ -26381,7 +23640,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4339" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3974" } }, { @@ -26421,7 +23680,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4350" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3985" } }, { @@ -26496,7 +23755,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4361" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3996" } }, { @@ -26704,7 +23963,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4372" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4007" } }, { @@ -26748,7 +24007,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4383" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4018" } }, { @@ -26838,7 +24097,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4394" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4029" } }, { @@ -26865,7 +24124,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4405" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4040" } } ] diff --git a/build/openrpc/gateway.json b/build/openrpc/gateway.json index bb6abab0a92..a5ba460f4f3 100644 --- a/build/openrpc/gateway.json +++ b/build/openrpc/gateway.json @@ -242,7 +242,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4416" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4051" } }, { @@ -473,7 +473,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4427" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4062" } }, { @@ -572,7 +572,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4438" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4073" } }, { @@ -604,7 +604,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4449" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4084" } }, { @@ -710,7 +710,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4460" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4095" } }, { @@ -803,7 +803,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4471" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4106" } }, { @@ -887,7 +887,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4482" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4117" } }, { @@ -987,7 +987,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4493" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4128" } }, { @@ -1043,7 +1043,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4504" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4139" } }, { @@ -1116,7 +1116,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4515" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4150" } }, { @@ -1189,7 +1189,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4526" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4161" } }, { @@ -1236,7 +1236,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4537" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4172" } }, { @@ -1268,7 +1268,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4548" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4183" } }, { @@ -1305,7 +1305,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4570" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4205" } }, { @@ -1352,7 +1352,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4581" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4216" } }, { @@ -1392,7 +1392,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4592" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4227" } }, { @@ -1439,7 +1439,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4603" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4238" } }, { @@ -1494,7 +1494,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4614" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4249" } }, { @@ -1523,7 +1523,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4625" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4260" } }, { @@ -1660,7 +1660,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4636" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4271" } }, { @@ -1689,7 +1689,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4647" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4282" } }, { @@ -1743,7 +1743,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4658" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4293" } }, { @@ -1834,7 +1834,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4669" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4304" } }, { @@ -1862,7 +1862,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4680" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4315" } }, { @@ -1952,7 +1952,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4691" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4326" } }, { @@ -2208,7 +2208,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4702" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4337" } }, { @@ -2453,7 +2453,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4713" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4348" } }, { @@ -2509,7 +2509,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4724" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4359" } }, { @@ -2556,7 +2556,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4735" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4370" } }, { @@ -2654,7 +2654,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4746" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4381" } }, { @@ -2720,7 +2720,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4757" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4392" } }, { @@ -2786,7 +2786,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4768" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4403" } }, { @@ -2895,7 +2895,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4779" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4414" } }, { @@ -2953,7 +2953,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4790" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4425" } }, { @@ -3075,7 +3075,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4801" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4436" } }, { @@ -3262,7 +3262,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4812" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4447" } }, { @@ -3466,7 +3466,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4823" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4458" } }, { @@ -3557,7 +3557,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4834" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4469" } }, { @@ -3615,7 +3615,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4845" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4480" } }, { @@ -3873,7 +3873,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4856" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4491" } }, { @@ -4148,7 +4148,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4867" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4502" } }, { @@ -4176,7 +4176,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4878" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4513" } }, { @@ -4214,7 +4214,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4889" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4524" } }, { @@ -4322,7 +4322,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4900" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4535" } }, { @@ -4360,7 +4360,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4911" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4546" } }, { @@ -4389,7 +4389,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4922" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4557" } }, { @@ -4452,7 +4452,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4933" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4568" } }, { @@ -4515,7 +4515,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4944" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4579" } }, { @@ -4560,7 +4560,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4955" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4590" } }, { @@ -4682,7 +4682,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4966" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4601" } }, { @@ -4837,7 +4837,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4977" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4612" } }, { @@ -4891,7 +4891,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4988" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4623" } }, { @@ -4945,7 +4945,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4999" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4634" } }, { @@ -5000,7 +5000,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5010" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4645" } }, { @@ -5102,7 +5102,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5021" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4656" } }, { @@ -5325,7 +5325,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5032" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4667" } }, { @@ -5508,7 +5508,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5043" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4678" } }, { @@ -5702,7 +5702,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5054" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4689" } }, { @@ -5748,7 +5748,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5065" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4700" } }, { @@ -5898,7 +5898,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5076" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4711" } }, { @@ -6035,7 +6035,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5087" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4722" } }, { @@ -6103,7 +6103,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5098" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4733" } }, { @@ -6220,7 +6220,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5109" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4744" } }, { @@ -6311,7 +6311,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5120" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4755" } }, { @@ -6397,7 +6397,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5131" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4766" } }, { @@ -6424,7 +6424,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5142" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4777" } }, { @@ -6451,7 +6451,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5153" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4788" } }, { @@ -6519,7 +6519,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5164" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4799" } }, { @@ -7025,7 +7025,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5175" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4810" } }, { @@ -7122,7 +7122,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5186" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4821" } }, { @@ -7222,7 +7222,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5197" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4832" } }, { @@ -7322,7 +7322,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5208" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4843" } }, { @@ -7447,7 +7447,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5219" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4854" } }, { @@ -7556,7 +7556,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5230" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4865" } }, { @@ -7659,7 +7659,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5241" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4876" } }, { @@ -7789,7 +7789,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5252" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4887" } }, { @@ -7896,7 +7896,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5263" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4898" } }, { @@ -7957,7 +7957,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5274" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4909" } }, { @@ -8025,7 +8025,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5285" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4920" } }, { @@ -8106,7 +8106,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5296" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4931" } }, { @@ -8265,7 +8265,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5307" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4942" } }, { @@ -8358,7 +8358,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5318" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4953" } }, { @@ -8559,7 +8559,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5329" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4964" } }, { @@ -8670,7 +8670,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5340" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4975" } }, { @@ -8801,7 +8801,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5351" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4986" } }, { @@ -8887,7 +8887,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5362" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4997" } }, { @@ -8914,7 +8914,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5373" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5008" } }, { @@ -8967,7 +8967,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5384" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5019" } }, { @@ -9055,7 +9055,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5395" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5030" } }, { @@ -9506,7 +9506,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5406" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5041" } }, { @@ -9673,7 +9673,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5417" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5052" } }, { @@ -9846,7 +9846,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5428" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5063" } }, { @@ -9914,7 +9914,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5439" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5074" } }, { @@ -9982,7 +9982,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5450" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5085" } }, { @@ -10143,7 +10143,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5461" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5096" } }, { @@ -10188,7 +10188,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5483" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5118" } }, { @@ -10233,7 +10233,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5494" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5129" } }, { @@ -10260,7 +10260,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5505" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5140" } } ] diff --git a/build/openrpc/miner.json b/build/openrpc/miner.json index 9bc2dcf8806..237708b2989 100644 --- a/build/openrpc/miner.json +++ b/build/openrpc/miner.json @@ -30,7 +30,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5791" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5426" } }, { @@ -109,7 +109,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5802" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5437" } }, { @@ -155,7 +155,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5813" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5448" } }, { @@ -203,7 +203,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5824" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5459" } }, { @@ -251,7 +251,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5835" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5470" } }, { @@ -354,7 +354,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5846" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5481" } }, { @@ -428,7 +428,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5857" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5492" } }, { @@ -591,7 +591,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5868" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5503" } }, { @@ -742,7 +742,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5879" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5514" } }, { @@ -781,7 +781,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5890" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5525" } }, { @@ -833,7 +833,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5901" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5536" } }, { @@ -872,7 +872,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5923" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5558" } }, { @@ -924,7 +924,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5934" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5569" } }, { @@ -996,7 +996,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5945" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5580" } }, { @@ -1035,7 +1035,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5956" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5591" } }, { @@ -1074,7 +1074,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5967" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5602" } }, { @@ -1101,7 +1101,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5978" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5613" } }, { @@ -1128,7 +1128,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5989" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5624" } }, { @@ -1155,7 +1155,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6000" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5635" } }, { @@ -1182,7 +1182,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6011" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5646" } }, { @@ -1209,7 +1209,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6022" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5657" } }, { @@ -1236,7 +1236,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6033" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5668" } }, { @@ -1294,7 +1294,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6044" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5679" } }, { @@ -1421,7 +1421,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6055" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5690" } }, { @@ -1461,7 +1461,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6066" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5701" } }, { @@ -1500,7 +1500,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6077" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5712" } }, { @@ -1539,7 +1539,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6088" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5723" } }, { @@ -1578,7 +1578,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6099" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5734" } }, { @@ -1617,7 +1617,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6110" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5745" } }, { @@ -1656,7 +1656,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6121" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5756" } }, { @@ -1695,7 +1695,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6132" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5767" } }, { @@ -1747,7 +1747,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6143" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5778" } }, { @@ -1770,7 +1770,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6154" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5789" } }, { @@ -1813,7 +1813,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6165" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5800" } }, { @@ -1884,7 +1884,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6176" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5811" } }, { @@ -2265,7 +2265,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6187" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5822" } }, { @@ -2364,7 +2364,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6209" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5844" } }, { @@ -2415,7 +2415,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6231" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5866" } }, { @@ -2473,7 +2473,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6242" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5877" } }, { @@ -2616,7 +2616,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6253" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5888" } }, { @@ -2743,7 +2743,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6264" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5899" } }, { @@ -3007,7 +3007,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6275" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5910" } }, { @@ -3044,7 +3044,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6286" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5921" } }, { @@ -3182,7 +3182,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6297" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5932" } }, { @@ -3205,7 +3205,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6308" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5943" } }, { @@ -3276,7 +3276,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6319" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5954" } }, { @@ -3319,7 +3319,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6330" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5965" } }, { @@ -3426,7 +3426,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6341" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5976" } }, { @@ -3489,7 +3489,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6352" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5987" } }, { @@ -3521,7 +3521,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6363" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5998" } }, { @@ -3609,7 +3609,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6374" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6009" } }, { @@ -3700,7 +3700,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6385" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6020" } }, { @@ -3740,7 +3740,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6396" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6031" } }, { @@ -3780,7 +3780,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6407" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6042" } }, { @@ -3821,7 +3821,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6418" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6053" } }, { @@ -3889,7 +3889,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6429" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6064" } }, { @@ -4020,7 +4020,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6440" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6075" } }, { @@ -4151,7 +4151,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6451" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6086" } }, { @@ -4251,7 +4251,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6462" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6097" } }, { @@ -4351,7 +4351,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6473" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6108" } }, { @@ -4451,7 +4451,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6484" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6119" } }, { @@ -4551,7 +4551,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6495" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6130" } }, { @@ -4651,7 +4651,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6506" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6141" } }, { @@ -4751,7 +4751,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6517" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6152" } }, { @@ -4875,7 +4875,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6528" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6163" } }, { @@ -4999,7 +4999,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6539" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6174" } }, { @@ -5114,7 +5114,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6550" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6185" } }, { @@ -5214,7 +5214,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6561" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6196" } }, { @@ -5347,7 +5347,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6572" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6207" } }, { @@ -5471,7 +5471,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6583" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6218" } }, { @@ -5595,7 +5595,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6594" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6229" } }, { @@ -5719,7 +5719,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6605" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6240" } }, { @@ -5852,7 +5852,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6616" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6251" } }, { @@ -5952,7 +5952,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6627" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6262" } }, { @@ -5993,7 +5993,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6638" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6273" } }, { @@ -6065,7 +6065,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6649" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6284" } }, { @@ -6115,7 +6115,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6660" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6295" } }, { @@ -6159,7 +6159,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6671" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6306" } }, { @@ -6200,7 +6200,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6682" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6317" } }, { @@ -6444,7 +6444,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6693" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6328" } }, { @@ -6518,7 +6518,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6704" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6339" } }, { @@ -6568,7 +6568,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6715" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6350" } }, { @@ -6597,7 +6597,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6726" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6361" } }, { @@ -6626,7 +6626,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6737" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6372" } }, { @@ -6682,7 +6682,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6748" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6383" } }, { @@ -6705,7 +6705,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6759" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6394" } }, { @@ -6765,7 +6765,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6770" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6405" } }, { @@ -6804,7 +6804,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6781" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6416" } }, { @@ -6844,7 +6844,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6792" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6427" } }, { @@ -6917,7 +6917,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6803" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6438" } }, { @@ -6981,7 +6981,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6814" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6449" } }, { @@ -7044,7 +7044,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6825" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6460" } }, { @@ -7094,7 +7094,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6836" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6471" } }, { @@ -7653,7 +7653,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6847" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6482" } }, { @@ -7694,7 +7694,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6858" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6493" } }, { @@ -7735,7 +7735,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6869" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6504" } }, { @@ -7776,7 +7776,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6880" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6515" } }, { @@ -7817,7 +7817,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6891" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6526" } }, { @@ -7858,7 +7858,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6902" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6537" } }, { @@ -7889,7 +7889,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6913" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6548" } }, { @@ -7939,7 +7939,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6924" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6559" } }, { @@ -7980,7 +7980,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6935" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6570" } }, { @@ -8019,7 +8019,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6946" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6581" } }, { @@ -8083,7 +8083,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6957" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6592" } }, { @@ -8141,7 +8141,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6968" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6603" } }, { @@ -8588,7 +8588,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6979" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6614" } }, { @@ -8624,7 +8624,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6990" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6625" } }, { @@ -8767,7 +8767,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7001" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6636" } }, { @@ -8823,7 +8823,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7012" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6647" } }, { @@ -8862,7 +8862,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7023" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6658" } }, { @@ -9039,7 +9039,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7034" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6669" } }, { @@ -9091,7 +9091,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7045" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6680" } }, { @@ -9283,7 +9283,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7056" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6691" } }, { @@ -9383,7 +9383,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7067" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6702" } }, { @@ -9437,7 +9437,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7078" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6713" } }, { @@ -9476,7 +9476,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7089" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6724" } }, { @@ -9561,7 +9561,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7100" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6735" } }, { @@ -9755,7 +9755,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7111" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6746" } }, { @@ -9853,7 +9853,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7122" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6757" } }, { @@ -9985,7 +9985,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7133" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6768" } }, { @@ -10039,7 +10039,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7144" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6779" } }, { @@ -10073,7 +10073,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7155" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6790" } }, { @@ -10160,7 +10160,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7166" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6801" } }, { @@ -10214,7 +10214,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7177" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6812" } }, { @@ -10314,7 +10314,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7188" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6823" } }, { @@ -10391,7 +10391,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7199" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6834" } }, { @@ -10482,7 +10482,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7210" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6845" } }, { @@ -10521,7 +10521,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7221" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6856" } }, { @@ -10637,7 +10637,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7232" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6867" } }, { @@ -12737,7 +12737,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7243" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6878" } } ] diff --git a/build/openrpc/worker.json b/build/openrpc/worker.json index fbd1f706a32..6a4261574b1 100644 --- a/build/openrpc/worker.json +++ b/build/openrpc/worker.json @@ -161,7 +161,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7331" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6966" } }, { @@ -252,7 +252,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7342" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6977" } }, { @@ -420,7 +420,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7353" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6988" } }, { @@ -447,7 +447,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7364" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6999" } }, { @@ -597,7 +597,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7375" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7010" } }, { @@ -700,7 +700,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7386" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7021" } }, { @@ -803,7 +803,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7397" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7032" } }, { @@ -925,7 +925,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7408" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7043" } }, { @@ -1135,7 +1135,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7419" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7054" } }, { @@ -1306,7 +1306,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7430" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7065" } }, { @@ -3350,7 +3350,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7441" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7076" } }, { @@ -3470,7 +3470,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7452" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7087" } }, { @@ -3531,7 +3531,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7463" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7098" } }, { @@ -3569,7 +3569,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7474" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7109" } }, { @@ -3729,7 +3729,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7485" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7120" } }, { @@ -3913,7 +3913,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7496" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7131" } }, { @@ -4054,7 +4054,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7507" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7142" } }, { @@ -4107,7 +4107,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7518" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7153" } }, { @@ -4250,7 +4250,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7529" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7164" } }, { @@ -4474,7 +4474,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7540" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7175" } }, { @@ -4601,7 +4601,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7551" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7186" } }, { @@ -4768,7 +4768,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7562" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7197" } }, { @@ -4895,7 +4895,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7573" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7208" } }, { @@ -4933,7 +4933,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7584" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7219" } }, { @@ -4972,7 +4972,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7595" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7230" } }, { @@ -4995,7 +4995,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7606" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7241" } }, { @@ -5034,7 +5034,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7617" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7252" } }, { @@ -5057,7 +5057,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7628" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7263" } }, { @@ -5096,7 +5096,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7639" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7274" } }, { @@ -5130,7 +5130,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7650" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7285" } }, { @@ -5184,7 +5184,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7661" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7296" } }, { @@ -5223,7 +5223,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7672" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7307" } }, { @@ -5262,7 +5262,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7683" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7318" } }, { @@ -5297,7 +5297,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7694" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7329" } }, { @@ -5477,7 +5477,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7705" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7340" } }, { @@ -5506,7 +5506,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7716" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7351" } }, { @@ -5529,7 +5529,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7727" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7362" } } ] diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go index b50ddc46779..41a591c05e6 100644 --- a/chain/sub/incoming.go +++ b/chain/sub/incoming.go @@ -29,17 +29,18 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/sub/ratelimit" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/lib/unixfs" "github.com/filecoin-project/lotus/metrics" - "github.com/filecoin-project/lotus/node/impl/client" "github.com/filecoin-project/lotus/node/impl/full" ) var log = logging.Logger("sub") +var DefaultHashFunction = unixfs.DefaultHashFunction var msgCidPrefix = cid.Prefix{ Version: 1, Codec: cid.DagCBOR, - MhType: client.DefaultHashFunction, + MhType: DefaultHashFunction, MhLength: 32, } diff --git a/cli/paych.go b/cli/paych.go index 46b043d6a6d..272eda4affb 100644 --- a/cli/paych.go +++ b/cli/paych.go @@ -39,11 +39,6 @@ var paychAddFundsCmd = &cli.Command{ Usage: "Add funds to the payment channel between fromAddress and toAddress. Creates the payment channel if it doesn't already exist.", ArgsUsage: "[fromAddress toAddress amount]", Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "restart-retrievals", - Usage: "restart stalled retrieval deals on this payment channel", - Value: true, - }, &cli.BoolFlag{ Name: "reserve", Usage: "mark funds as reserved", @@ -99,10 +94,6 @@ var paychAddFundsCmd = &cli.Command{ } fmt.Fprintln(cctx.App.Writer, chAddr) - restartRetrievals := cctx.Bool("restart-retrievals") - if restartRetrievals { - return api.ClientRetrieveTryRestartInsufficientFunds(ctx, chAddr) - } return nil }, } diff --git a/cmd/lotus-miner/allinfo_test.go b/cmd/lotus-miner/allinfo_test.go index 2388f2f7aeb..a0735fc9771 100644 --- a/cmd/lotus-miner/allinfo_test.go +++ b/cmd/lotus-miner/allinfo_test.go @@ -2,7 +2,6 @@ package main import ( - "context" "flag" "testing" "time" @@ -43,11 +42,5 @@ func TestMinerAllInfo(t *testing.T) { t.Run("pre-info-all", run) - //stm: @CLIENT_DATA_IMPORT_001, @CLIENT_STORAGE_DEALS_GET_001 - dh := kit.NewDealHarness(t, client, miner, miner) - deal, res, inPath := dh.MakeOnlineDeal(context.Background(), kit.MakeFullDealParams{Rseed: 6}) - outPath := dh.PerformRetrieval(context.Background(), deal, res.Root, false) - kit.AssertFilesEqual(t, inPath, outPath) - t.Run("post-info-all", run) } diff --git a/cmd/lotus-miner/main.go b/cmd/lotus-miner/main.go index dafe65681b3..0d20a36e010 100644 --- a/cmd/lotus-miner/main.go +++ b/cmd/lotus-miner/main.go @@ -187,11 +187,6 @@ func getActorAddress(ctx context.Context, cctx *cli.Context) (maddr address.Addr return maddr, nil } -func setHidden(cmd *cli.Command) *cli.Command { - cmd.Hidden = true - return cmd -} - func LMActorOrEnvGetter(cctx *cli.Context) (address.Address, error) { return getActorAddress(cctx.Context, cctx) } diff --git a/documentation/en/api-v0-methods.md b/documentation/en/api-v0-methods.md index 097722d3f65..ae1b2dc5afb 100644 --- a/documentation/en/api-v0-methods.md +++ b/documentation/en/api-v0-methods.md @@ -34,34 +34,6 @@ * [ChainSetHead](#ChainSetHead) * [ChainStatObj](#ChainStatObj) * [ChainTipSetWeight](#ChainTipSetWeight) -* [Client](#Client) - * [ClientCalcCommP](#ClientCalcCommP) - * [ClientCancelDataTransfer](#ClientCancelDataTransfer) - * [ClientCancelRetrievalDeal](#ClientCancelRetrievalDeal) - * [ClientDataTransferUpdates](#ClientDataTransferUpdates) - * [ClientDealPieceCID](#ClientDealPieceCID) - * [ClientDealSize](#ClientDealSize) - * [ClientFindData](#ClientFindData) - * [ClientGenCar](#ClientGenCar) - * [ClientGetDealInfo](#ClientGetDealInfo) - * [ClientGetDealStatus](#ClientGetDealStatus) - * [ClientGetDealUpdates](#ClientGetDealUpdates) - * [ClientGetRetrievalUpdates](#ClientGetRetrievalUpdates) - * [ClientHasLocal](#ClientHasLocal) - * [ClientImport](#ClientImport) - * [ClientListDataTransfers](#ClientListDataTransfers) - * [ClientListDeals](#ClientListDeals) - * [ClientListImports](#ClientListImports) - * [ClientListRetrievals](#ClientListRetrievals) - * [ClientMinerQueryOffer](#ClientMinerQueryOffer) - * [ClientQueryAsk](#ClientQueryAsk) - * [ClientRemoveImport](#ClientRemoveImport) - * [ClientRestartDataTransfer](#ClientRestartDataTransfer) - * [ClientRetrieve](#ClientRetrieve) - * [ClientRetrieveTryRestartInsufficientFunds](#ClientRetrieveTryRestartInsufficientFunds) - * [ClientRetrieveWithEvents](#ClientRetrieveWithEvents) - * [ClientStartDeal](#ClientStartDeal) - * [ClientStatelessDeal](#ClientStatelessDeal) * [Create](#Create) * [CreateBackup](#CreateBackup) * [Gas](#Gas) @@ -1091,1054 +1063,6 @@ Inputs: Response: `"0"` -## Client -The Client methods all have to do with interacting with the storage and -retrieval markets as a client - - -### ClientCalcCommP -ClientCalcCommP calculates the CommP for a specified file - - -Perms: write - -Inputs: -```json -[ - "string value" -] -``` - -Response: -```json -{ - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 1024 -} -``` - -### ClientCancelDataTransfer -ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer - - -Perms: write - -Inputs: -```json -[ - 3, - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - true -] -``` - -Response: `{}` - -### ClientCancelRetrievalDeal -ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID - - -Perms: write - -Inputs: -```json -[ - 5 -] -``` - -Response: `{}` - -### ClientDataTransferUpdates - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } -} -``` - -### ClientDealPieceCID -ClientCalcCommP calculates the CommP and data size of the specified CID - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "PayloadSize": 9, - "PieceSize": 1032, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -} -``` - -### ClientDealSize -ClientDealSize calculates real deal data size - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "PayloadSize": 9, - "PieceSize": 1032 -} -``` - -### ClientFindData -ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer). - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -[ - { - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - } -] -``` - -### ClientGenCar -ClientGenCar generates a CAR file for the specified file. - - -Perms: write - -Inputs: -```json -[ - { - "Path": "string value", - "IsCAR": true - }, - "string value" -] -``` - -Response: `{}` - -### ClientGetDealInfo -ClientGetDealInfo returns the latest information about a given deal. - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -} -``` - -### ClientGetDealStatus -ClientGetDealStatus returns status given a code - - -Perms: read - -Inputs: -```json -[ - 42 -] -``` - -Response: `"string value"` - -### ClientGetDealUpdates -ClientGetDealUpdates returns the status of updated deals - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -} -``` - -### ClientGetRetrievalUpdates -ClientGetRetrievalUpdates returns status of updated retrieval deals - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "UnsealPrice": "0", - "Status": 0, - "Message": "string value", - "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "BytesReceived": 42, - "BytesPaidFor": 42, - "TotalPaid": "0", - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Event": 5 -} -``` - -### ClientHasLocal -ClientHasLocal indicates whether a certain CID is locally stored. - - -Perms: write - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: `true` - -### ClientImport -ClientImport imports file under the specified path into filestore. - - -Perms: admin - -Inputs: -```json -[ - { - "Path": "string value", - "IsCAR": true - } -] -``` - -Response: -```json -{ - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ImportID": 50 -} -``` - -### ClientListDataTransfers -ClientListTransfers returns the status of all ongoing transfers of data - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -] -``` - -### ClientListDeals -ClientListDeals returns information about the deals made by the local client. - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - } -] -``` - -### ClientListImports -ClientListImports lists imported files and their root CIDs - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "Key": 50, - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Source": "string value", - "FilePath": "string value", - "CARPath": "string value" - } -] -``` - -### ClientListRetrievals -ClientQueryAsk returns a signed StorageAsk from the specified miner. -ClientListRetrievals returns information about retrievals made by the local client - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "UnsealPrice": "0", - "Status": 0, - "Message": "string value", - "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "BytesReceived": 42, - "BytesPaidFor": 42, - "TotalPaid": "0", - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Event": 5 - } -] -``` - -### ClientMinerQueryOffer -ClientMinerQueryOffer returns a QueryOffer for the specific miner and file. - - -Perms: read - -Inputs: -```json -[ - "f01234", - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } -} -``` - -### ClientQueryAsk - - -Perms: read - -Inputs: -```json -[ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "f01234" -] -``` - -Response: -```json -{ - "Price": "0", - "VerifiedPrice": "0", - "MinPieceSize": 1032, - "MaxPieceSize": 1032, - "Miner": "f01234", - "Timestamp": 10101, - "Expiry": 10101, - "SeqNo": 42 -} -``` - -### ClientRemoveImport -ClientRemoveImport removes file import - - -Perms: admin - -Inputs: -```json -[ - 50 -] -``` - -Response: `{}` - -### ClientRestartDataTransfer -ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer - - -Perms: write - -Inputs: -```json -[ - 3, - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - true -] -``` - -Response: `{}` - -### ClientRetrieve -ClientRetrieve initiates the retrieval of a file, as specified in the order. - - -Perms: admin - -Inputs: -```json -[ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DatamodelPathSelector": "Links/21/Hash/Links/42/Hash", - "Size": 42, - "FromLocalCAR": "string value", - "Total": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Client": "f01234", - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - }, - { - "Path": "string value", - "IsCAR": true - } -] -``` - -Response: `{}` - -### ClientRetrieveTryRestartInsufficientFunds -ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel -which are stuck due to insufficient funds - - -Perms: write - -Inputs: -```json -[ - "f01234" -] -``` - -Response: `{}` - -### ClientRetrieveWithEvents -ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel -of status updates. - - -Perms: admin - -Inputs: -```json -[ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DatamodelPathSelector": "Links/21/Hash/Links/42/Hash", - "Size": 42, - "FromLocalCAR": "string value", - "Total": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Client": "f01234", - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - }, - { - "Path": "string value", - "IsCAR": true - } -] -``` - -Response: -```json -{ - "Event": 5, - "Status": 0, - "BytesReceived": 42, - "FundsSpent": "0", - "Err": "string value" -} -``` - -### ClientStartDeal -ClientStartDeal proposes a deal with a miner. - - -Perms: admin - -Inputs: -```json -[ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } -] -``` - -Response: -```json -{ - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" -} -``` - -### ClientStatelessDeal -ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking. - - -Perms: write - -Inputs: -```json -[ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } -] -``` - -Response: -```json -{ - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" -} -``` - ## Create @@ -4697,9 +3621,6 @@ Inputs: `null` Response: `"0001-01-01T00:00:00Z"` ## State -The State methods are used to query, inspect, and interact with chain state. -Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset. -A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used. ### StateAccountKey diff --git a/documentation/en/api-v1-unstable-methods.md b/documentation/en/api-v1-unstable-methods.md index 244b2995349..8a4bc091ff2 100644 --- a/documentation/en/api-v1-unstable-methods.md +++ b/documentation/en/api-v1-unstable-methods.md @@ -37,35 +37,6 @@ * [ChainSetHead](#ChainSetHead) * [ChainStatObj](#ChainStatObj) * [ChainTipSetWeight](#ChainTipSetWeight) -* [Client](#Client) - * [ClientCalcCommP](#ClientCalcCommP) - * [ClientCancelDataTransfer](#ClientCancelDataTransfer) - * [ClientCancelRetrievalDeal](#ClientCancelRetrievalDeal) - * [ClientDataTransferUpdates](#ClientDataTransferUpdates) - * [ClientDealPieceCID](#ClientDealPieceCID) - * [ClientDealSize](#ClientDealSize) - * [ClientExport](#ClientExport) - * [ClientFindData](#ClientFindData) - * [ClientGenCar](#ClientGenCar) - * [ClientGetDealInfo](#ClientGetDealInfo) - * [ClientGetDealStatus](#ClientGetDealStatus) - * [ClientGetDealUpdates](#ClientGetDealUpdates) - * [ClientGetRetrievalUpdates](#ClientGetRetrievalUpdates) - * [ClientHasLocal](#ClientHasLocal) - * [ClientImport](#ClientImport) - * [ClientListDataTransfers](#ClientListDataTransfers) - * [ClientListDeals](#ClientListDeals) - * [ClientListImports](#ClientListImports) - * [ClientListRetrievals](#ClientListRetrievals) - * [ClientMinerQueryOffer](#ClientMinerQueryOffer) - * [ClientQueryAsk](#ClientQueryAsk) - * [ClientRemoveImport](#ClientRemoveImport) - * [ClientRestartDataTransfer](#ClientRestartDataTransfer) - * [ClientRetrieve](#ClientRetrieve) - * [ClientRetrieveTryRestartInsufficientFunds](#ClientRetrieveTryRestartInsufficientFunds) - * [ClientRetrieveWait](#ClientRetrieveWait) - * [ClientStartDeal](#ClientStartDeal) - * [ClientStatelessDeal](#ClientStatelessDeal) * [Create](#Create) * [CreateBackup](#CreateBackup) * [Eth](#Eth) @@ -1253,1054 +1224,6 @@ Inputs: Response: `"0"` -## Client -The Client methods all have to do with interacting with the storage and -retrieval markets as a client - - -### ClientCalcCommP -ClientCalcCommP calculates the CommP for a specified file - - -Perms: write - -Inputs: -```json -[ - "string value" -] -``` - -Response: -```json -{ - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 1024 -} -``` - -### ClientCancelDataTransfer -ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer - - -Perms: write - -Inputs: -```json -[ - 3, - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - true -] -``` - -Response: `{}` - -### ClientCancelRetrievalDeal -ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID - - -Perms: write - -Inputs: -```json -[ - 5 -] -``` - -Response: `{}` - -### ClientDataTransferUpdates - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } -} -``` - -### ClientDealPieceCID -ClientCalcCommP calculates the CommP and data size of the specified CID - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "PayloadSize": 9, - "PieceSize": 1032, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -} -``` - -### ClientDealSize -ClientDealSize calculates real deal data size - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "PayloadSize": 9, - "PieceSize": 1032 -} -``` - -### ClientExport -ClientExport exports a file stored in the local filestore to a system file - - -Perms: admin - -Inputs: -```json -[ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DAGs": [ - { - "DataSelector": "Links/21/Hash/Links/42/Hash", - "ExportMerkleProof": true - } - ], - "FromLocalCAR": "string value", - "DealID": 5 - }, - { - "Path": "string value", - "IsCAR": true - } -] -``` - -Response: `{}` - -### ClientFindData -ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer). - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -[ - { - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - } -] -``` - -### ClientGenCar -ClientGenCar generates a CAR file for the specified file. - - -Perms: write - -Inputs: -```json -[ - { - "Path": "string value", - "IsCAR": true - }, - "string value" -] -``` - -Response: `{}` - -### ClientGetDealInfo -ClientGetDealInfo returns the latest information about a given deal. - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -} -``` - -### ClientGetDealStatus -ClientGetDealStatus returns status given a code - - -Perms: read - -Inputs: -```json -[ - 42 -] -``` - -Response: `"string value"` - -### ClientGetDealUpdates -ClientGetDealUpdates returns the status of updated deals - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -} -``` - -### ClientGetRetrievalUpdates -ClientGetRetrievalUpdates returns status of updated retrieval deals - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "UnsealPrice": "0", - "Status": 0, - "Message": "string value", - "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "BytesReceived": 42, - "BytesPaidFor": 42, - "TotalPaid": "0", - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Event": 5 -} -``` - -### ClientHasLocal -ClientHasLocal indicates whether a certain CID is locally stored. - - -Perms: write - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: `true` - -### ClientImport -ClientImport imports file under the specified path into filestore. - - -Perms: admin - -Inputs: -```json -[ - { - "Path": "string value", - "IsCAR": true - } -] -``` - -Response: -```json -{ - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ImportID": 50 -} -``` - -### ClientListDataTransfers -ClientListTransfers returns the status of all ongoing transfers of data - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -] -``` - -### ClientListDeals -ClientListDeals returns information about the deals made by the local client. - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - } -] -``` - -### ClientListImports -ClientListImports lists imported files and their root CIDs - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "Key": 50, - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Source": "string value", - "FilePath": "string value", - "CARPath": "string value" - } -] -``` - -### ClientListRetrievals -ClientListRetrievals returns information about retrievals made by the local client - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "UnsealPrice": "0", - "Status": 0, - "Message": "string value", - "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "BytesReceived": 42, - "BytesPaidFor": 42, - "TotalPaid": "0", - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Event": 5 - } -] -``` - -### ClientMinerQueryOffer -ClientMinerQueryOffer returns a QueryOffer for the specific miner and file. - - -Perms: read - -Inputs: -```json -[ - "f01234", - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } -} -``` - -### ClientQueryAsk -ClientQueryAsk returns a signed StorageAsk from the specified miner. - - -Perms: read - -Inputs: -```json -[ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "f01234" -] -``` - -Response: -```json -{ - "Response": { - "Price": "0", - "VerifiedPrice": "0", - "MinPieceSize": 1032, - "MaxPieceSize": 1032, - "Miner": "f01234", - "Timestamp": 10101, - "Expiry": 10101, - "SeqNo": 42 - }, - "DealProtocols": [ - "string value" - ] -} -``` - -### ClientRemoveImport -ClientRemoveImport removes file import - - -Perms: admin - -Inputs: -```json -[ - 50 -] -``` - -Response: `{}` - -### ClientRestartDataTransfer -ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer - - -Perms: write - -Inputs: -```json -[ - 3, - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - true -] -``` - -Response: `{}` - -### ClientRetrieve -ClientRetrieve initiates the retrieval of a file, as specified in the order. - - -Perms: admin - -Inputs: -```json -[ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DataSelector": "Links/21/Hash/Links/42/Hash", - "Size": 42, - "Total": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Client": "f01234", - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - }, - "RemoteStore": "00000000-0000-0000-0000-000000000000" - } -] -``` - -Response: -```json -{ - "DealID": 5 -} -``` - -### ClientRetrieveTryRestartInsufficientFunds -ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel -which are stuck due to insufficient funds - - -Perms: write - -Inputs: -```json -[ - "f01234" -] -``` - -Response: `{}` - -### ClientRetrieveWait -ClientRetrieveWait waits for retrieval to be complete - - -Perms: admin - -Inputs: -```json -[ - 5 -] -``` - -Response: `{}` - -### ClientStartDeal -ClientStartDeal proposes a deal with a miner. - - -Perms: admin - -Inputs: -```json -[ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } -] -``` - -Response: -```json -{ - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" -} -``` - -### ClientStatelessDeal -ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking. - - -Perms: write - -Inputs: -```json -[ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } -] -``` - -Response: -```json -{ - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" -} -``` - ## Create diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md index 3074f68fee8..45e6150467e 100644 --- a/documentation/en/cli-lotus.md +++ b/documentation/en/cli-lotus.md @@ -870,9 +870,8 @@ USAGE: lotus paych add-funds [command options] [fromAddress toAddress amount] OPTIONS: - --restart-retrievals restart stalled retrieval deals on this payment channel (default: true) - --reserve mark funds as reserved (default: false) - --help, -h show help + --reserve mark funds as reserved (default: false) + --help, -h show help ``` ### lotus paych list diff --git a/itests/batch_deal_test.go b/itests/batch_deal_test.go deleted file mode 100644 index 21db9f08d0e..00000000000 --- a/itests/batch_deal_test.go +++ /dev/null @@ -1,147 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "fmt" - "sort" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/storage/pipeline/sealiface" -) - -func TestBatchDealInput(t *testing.T) { - //stm: @MINER_SECTOR_STATUS_001, @MINER_SECTOR_LIST_001 - kit.QuietMiningLogs() - - var ( - blockTime = 10 * time.Millisecond - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - dealStartEpoch = abi.ChainEpoch(2 << 12) - ) - - run := func(piece, deals, expectSectors int) func(t *testing.T) { - return func(t *testing.T) { - t.Logf("batchtest start") - - ctx := context.Background() - - publishPeriod := 10 * time.Second - maxDealsPerMsg := uint64(deals) - - // Set max deals per publish deals message to maxDealsPerMsg - opts := kit.ConstructorOpts(node.Options( - node.Override( - new(*storageadapter.DealPublisher), - storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{ - Period: publishPeriod, - MaxDealsPerMsg: maxDealsPerMsg, - })), - node.Override(new(dtypes.GetSealingConfigFunc), func() (dtypes.GetSealingConfigFunc, error) { - return func() (sealiface.Config, error) { - cfg := config.DefaultStorageMiner() - sc := modules.ToSealingConfig(cfg.Dealmaking, cfg.Sealing) - sc.MaxWaitDealsSectors = 2 - sc.MaxSealingSectors = 1 - sc.MaxSealingSectorsForDeals = 3 - sc.AlwaysKeepUnsealedCopy = true - sc.WaitDealsDelay = time.Hour - sc.AggregateCommits = false - - return sc, nil - }, nil - }), - )) - client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs(), opts, kit.ThroughRPC()) - ens.InterconnectAll().BeginMining(blockTime) - dh := kit.NewDealHarness(t, client, miner, miner) - - err := miner.MarketSetAsk(ctx, big.Zero(), big.Zero(), 200, 128, 32<<30) - require.NoError(t, err) - - t.Logf("batchtest ask set") - - checkNoPadding := func() { - sl, err := miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - - sort.Slice(sl, func(i, j int) bool { - return sl[i] < sl[j] - }) - - for _, snum := range sl { - si, err := miner.SectorsStatus(ctx, snum, false) - require.NoError(t, err) - - // fmt.Printf("S %d: %+v %s\n", snum, si.Deals, si.State) - - for _, deal := range si.Deals { - if deal == 0 { - fmt.Printf("sector %d had a padding piece!\n", snum) - } - } - } - } - - // Starts a deal and waits until it's published - runDealTillSeal := func(rseed int) { - res, _, _, err := kit.CreateImportFile(ctx, client, rseed, piece) - require.NoError(t, err) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.DealStartEpoch = dealStartEpoch - - deal := dh.StartDeal(ctx, dp) - dh.WaitDealSealed(ctx, deal, false, true, checkNoPadding) - } - - // Run maxDealsPerMsg deals in parallel - done := make(chan struct{}, maxDealsPerMsg) - for rseed := 0; rseed < int(maxDealsPerMsg); rseed++ { - rseed := rseed - go func() { - runDealTillSeal(rseed) - done <- struct{}{} - }() - } - - t.Logf("batchtest deals started") - - // Wait for maxDealsPerMsg of the deals to be published - for i := 0; i < int(maxDealsPerMsg); i++ { - <-done - } - - t.Logf("batchtest deals published") - - checkNoPadding() - - t.Logf("batchtest no padding") - - sl, err := miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - require.Equal(t, len(sl), expectSectors) - - t.Logf("batchtest done") - } - } - - t.Run("4-p1600B", run(1600, 4, 4)) - t.Run("4-p513B", run(513, 4, 2)) -} diff --git a/itests/cli_test.go b/itests/cli_test.go deleted file mode 100644 index d2a0876356b..00000000000 --- a/itests/cli_test.go +++ /dev/null @@ -1,27 +0,0 @@ -// stm: #integration -package itests - -import ( - "os" - "testing" - "time" - - "github.com/filecoin-project/lotus/cli/clicommands" - "github.com/filecoin-project/lotus/itests/kit" -) - -// TestClient does a basic test to exercise the client CLI commands. -func TestClient(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - _ = os.Setenv("BELLMAN_NO_GPU", "1") - kit.QuietMiningLogs() - - blockTime := 5 * time.Millisecond - client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) - ens.InterconnectAll().BeginMining(blockTime) - kit.RunClientTest(t, clicommands.Commands, client) -} diff --git a/itests/deals_512mb_test.go b/itests/deals_512mb_test.go deleted file mode 100644 index 7b55204d910..00000000000 --- a/itests/deals_512mb_test.go +++ /dev/null @@ -1,51 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestStorageDealMissingBlock(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 - ctx := context.Background() - - kit.QuietMiningLogs() - - client, miner, ens := kit.EnsembleMinimal(t, - kit.MockProofs(), - kit.SectorSize(512<<20), // 512MiB sectors. - ) - ens.InterconnectAll().BeginMining(50 * time.Millisecond) - - dh := kit.NewDealHarness(t, client, miner, miner) - - client.WaitTillChain(ctx, kit.HeightAtLeast(5)) - - res, _ := client.CreateImportFile(ctx, 0, 64<<20) // 64MiB file. - list, err := client.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 1) - require.Equal(t, res.Root, *list[0].Root) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.FastRetrieval = true - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price. - deal := dh.StartDeal(ctx, dp) - - dh.WaitDealSealed(ctx, deal, false, false, nil) -} diff --git a/itests/deals_anycid_test.go b/itests/deals_anycid_test.go deleted file mode 100644 index c17441090b1..00000000000 --- a/itests/deals_anycid_test.go +++ /dev/null @@ -1,162 +0,0 @@ -package itests - -import ( - "bufio" - "context" - "os" - "testing" - "time" - - dag "github.com/ipfs/boxo/ipld/merkledag" - "github.com/ipfs/go-cid" - ipldcbor "github.com/ipfs/go-ipld-cbor" - format "github.com/ipfs/go-ipld-format" - "github.com/ipld/go-car" - "github.com/ipld/go-car/v2/blockstore" - selectorparse "github.com/ipld/go-ipld-prime/traversal/selector/parse" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/node/modules/dtypes" -) - -func TestDealRetrieveByAnyCid(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode") - } - - ctx := context.Background() - - kit.QuietMiningLogs() - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - startEpoch := abi.ChainEpoch(2 << 12) - - // Override the dependency injection for the blockstore accessor, so that - // we can get a reference to the blockstore containing our deal later in - // the test - var bsa storagemarket.BlockstoreAccessor - bsaFn := func(importmgr dtypes.ClientImportMgr) storagemarket.BlockstoreAccessor { - bsa = modules.StorageBlockstoreAccessor(importmgr) - return bsa - } - bsaOpt := kit.ConstructorOpts(node.Override(new(storagemarket.BlockstoreAccessor), bsaFn)) - - // Allow 8MB sectors - eightMBSectorsOpt := kit.SectorSize(8 << 20) - - // Create a client, and a miner with its own full node - _, client, miner, ens := kit.EnsembleTwoOne(t, kit.MockProofs(), bsaOpt, eightMBSectorsOpt) - ens.InterconnectAll().BeginMining(250 * time.Millisecond) - - dh := kit.NewDealHarness(t, client, miner, miner) - - // Generate a DAG with multiple levels, so that we can test the case where - // the client requests a CID for a block which is not the root block but - // does have a subtree below it in the DAG - dagOpts := kit.GeneratedDAGOpts{ - // Max size of a block - ChunkSize: 1024, - // Max links from a block to other blocks - Maxlinks: 10, - } - carv1FilePath, _ := kit.CreateRandomCARv1(t, 5, 100*1024, dagOpts) - res, err := client.ClientImport(ctx, api.FileRef{Path: carv1FilePath, IsCAR: true}) - require.NoError(t, err) - - // Get the blockstore for the file - bs, err := bsa.Get(res.Root) - require.NoError(t, err) - - // Get all CIDs from the file - sc := car.NewSelectiveCar(ctx, bs, []car.Dag{{Root: res.Root, Selector: selectorparse.CommonSelector_ExploreAllRecursively}}) - prepared, err := sc.Prepare() - require.NoError(t, err) - - reg := format.Registry{} - reg.Register(cid.DagProtobuf, dag.DecodeProtobufBlock) - reg.Register(cid.DagCBOR, ipldcbor.DecodeBlock) - reg.Register(cid.Raw, dag.DecodeRawBlock) - - cids := prepared.Cids() - for i, c := range cids { - blk, err := bs.Get(ctx, c) - require.NoError(t, err) - - nd, err := reg.Decode(blk) - require.NoError(t, err) - - t.Log(i, c, len(nd.Links())) - } - - // Create a storage deal - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.DealStartEpoch = startEpoch - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price - dealCid := dh.StartDeal(ctx, dp) - - // Wait for the deal to be sealed - dh.WaitDealSealed(ctx, dealCid, false, false, nil) - - ask, err := miner.MarketGetRetrievalAsk(ctx) - require.NoError(t, err) - ask.PricePerByte = abi.NewTokenAmount(0) - ask.UnsealPrice = abi.NewTokenAmount(0) - err = miner.MarketSetRetrievalAsk(ctx, ask) - require.NoError(t, err) - - // Fetch the deal data - info, err := client.ClientGetDealInfo(ctx, *dealCid) - require.NoError(t, err) - - // Make retrievals against CIDs at different levels in the DAG - cidIndices := []int{1, 11, 27, 32, 47} - for _, val := range cidIndices { - t.Logf("performing retrieval for cid at index %d", val) - - targetCid := cids[val] - offer, err := client.ClientMinerQueryOffer(ctx, miner.ActorAddr, targetCid, &info.PieceCID) - require.NoError(t, err) - require.Empty(t, offer.Err) - - // retrieve in a CAR file and ensure roots match - outputCar := dh.PerformRetrieval(ctx, dealCid, targetCid, true, offer) - _, err = os.Stat(outputCar) - require.NoError(t, err) - f, err := os.Open(outputCar) - require.NoError(t, err) - ch, err := car.ReadHeader(bufio.NewReader(f)) - require.NoError(t, err) - require.EqualValues(t, ch.Roots[0], targetCid) - require.NoError(t, f.Close()) - - // create CAR from original file starting at targetCid and ensure it matches the retrieved CAR file. - tmp, err := os.CreateTemp(t.TempDir(), "randcarv1") - require.NoError(t, err) - rd, err := blockstore.OpenReadOnly(carv1FilePath, blockstore.UseWholeCIDs(true)) - require.NoError(t, err) - err = car.NewSelectiveCar( - ctx, - rd, - []car.Dag{{ - Root: targetCid, - Selector: selectorparse.CommonSelector_ExploreAllRecursively, - }}, - ).Write(tmp) - require.NoError(t, err) - require.NoError(t, tmp.Close()) - require.NoError(t, rd.Close()) - - kit.AssertFilesEqual(t, tmp.Name(), outputCar) - t.Log("car files match") - } -} diff --git a/itests/deals_concurrent_test.go b/itests/deals_concurrent_test.go deleted file mode 100644 index a106836bdd1..00000000000 --- a/itests/deals_concurrent_test.go +++ /dev/null @@ -1,212 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "fmt" - "sync" - "testing" - "time" - - provider "github.com/ipni/index-provider" - "github.com/stretchr/testify/require" - - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo" -) - -// TestDealWithMarketAndMinerNode is running concurrently a number of storage and retrieval deals towards a miner -// architecture where the `mining/sealing/proving` node is a separate process from the `markets` node -func TestDealWithMarketAndMinerNode(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - if testing.Short() { - t.Skip("skipping test in short mode") - } - - t.Skip("skipping due to flakiness: see #6956") - - kit.QuietMiningLogs() - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - startEpoch := abi.ChainEpoch(8 << 10) - - runTest := func(t *testing.T, n int, fastRetrieval bool, carExport bool) { - api.RunningNodeType = api.NodeMiner // TODO(anteva): fix me - - idxProv := shared_testutil.NewMockIndexProvider() - idxProvOpt := kit.ConstructorOpts(node.Override(new(provider.Interface), idxProv)) - client, main, market, _ := kit.EnsembleWithMinerAndMarketNodes(t, kit.ThroughRPC(), idxProvOpt) - - dh := kit.NewDealHarness(t, client, main, market) - - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{ - N: n, - FastRetrieval: fastRetrieval, - CarExport: carExport, - StartEpoch: startEpoch, - IndexProvider: idxProv, - }) - } - - // this test is expensive because we don't use mock proofs; do a single cycle. - cycles := []int{4} - for _, n := range cycles { - n := n - ns := fmt.Sprintf("%d", n) - t.Run(ns+"-fastretrieval-CAR", func(t *testing.T) { runTest(t, n, true, true) }) - t.Run(ns+"-fastretrieval-NoCAR", func(t *testing.T) { runTest(t, n, true, false) }) - t.Run(ns+"-stdretrieval-CAR", func(t *testing.T) { runTest(t, n, false, true) }) - t.Run(ns+"-stdretrieval-NoCAR", func(t *testing.T) { runTest(t, n, false, false) }) - } -} - -func TestDealCyclesConcurrent(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - startEpoch := abi.ChainEpoch(2 << 12) - - runTest := func(t *testing.T, n int, fastRetrieval bool, carExport bool) { - client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs()) - ens.InterconnectAll().BeginMining(250 * time.Millisecond) - dh := kit.NewDealHarness(t, client, miner, miner) - - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{ - N: n, - FastRetrieval: fastRetrieval, - CarExport: carExport, - StartEpoch: startEpoch, - }) - } - - // this test is cheap because we use mock proofs, do various cycles - cycles := []int{2, 4, 8, 16} - for _, n := range cycles { - n := n - ns := fmt.Sprintf("%d", n) - t.Run(ns+"-fastretrieval-CAR", func(t *testing.T) { runTest(t, n, true, true) }) - t.Run(ns+"-fastretrieval-NoCAR", func(t *testing.T) { runTest(t, n, true, false) }) - t.Run(ns+"-stdretrieval-CAR", func(t *testing.T) { runTest(t, n, false, true) }) - t.Run(ns+"-stdretrieval-NoCAR", func(t *testing.T) { runTest(t, n, false, false) }) - } -} - -func TestSimultanenousTransferLimit(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - t.Skip("skipping as flaky #7152") - - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - startEpoch := abi.ChainEpoch(2 << 12) - - const ( - graphsyncThrottle = 2 - concurrency = 20 - ) - runTest := func(t *testing.T) { - client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ConstructorOpts( - node.ApplyIf(node.IsType(repo.StorageMiner), node.Override(new(dtypes.StagingGraphsync), modules.StagingGraphsync(graphsyncThrottle, 0, graphsyncThrottle))), - node.Override(new(dtypes.Graphsync), modules.Graphsync(graphsyncThrottle, graphsyncThrottle)), - )) - ens.InterconnectAll().BeginMining(250 * time.Millisecond) - dh := kit.NewDealHarness(t, client, miner, miner) - - ctx, cancel := context.WithCancel(context.Background()) - - du, err := miner.MarketDataTransferUpdates(ctx) - require.NoError(t, err) - - var maxOngoing int - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - - ongoing := map[datatransfer.TransferID]struct{}{} - - for { - select { - case u := <-du: - t.Logf("%d - %s", u.TransferID, datatransfer.Statuses[u.Status]) - if u.Status == datatransfer.Ongoing && u.Transferred > 0 { - ongoing[u.TransferID] = struct{}{} - } else { - delete(ongoing, u.TransferID) - } - - if len(ongoing) > maxOngoing { - maxOngoing = len(ongoing) - } - case <-ctx.Done(): - return - } - } - }() - - t.Logf("running concurrent deals: %d", concurrency) - - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{ - N: concurrency, - FastRetrieval: true, - StartEpoch: startEpoch, - }) - - t.Logf("all deals finished") - - cancel() - wg.Wait() - - // The eventing systems across go-data-transfer and go-graphsync - // are racy, and that's why we can't enforce graphsyncThrottle exactly, - // without making this test racy. - // - // Essentially what could happen is that the graphsync layer starts the - // next transfer before the go-data-transfer FSM has the opportunity to - // move the previously completed transfer to the next stage, thus giving - // the appearance that more than graphsyncThrottle transfers are - // in progress. - // - // Concurrency (20) is x10 higher than graphsyncThrottle (2), so if all - // 20 transfers are not happening at once, we know the throttle is - // in effect. Thus we are a little bit lenient here to account for the - // above races and allow up to graphsyncThrottle*2. - require.LessOrEqual(t, maxOngoing, graphsyncThrottle*2) - } - - runTest(t) -} diff --git a/itests/deals_max_staging_deals_test.go b/itests/deals_max_staging_deals_test.go deleted file mode 100644 index 738a1e2fed3..00000000000 --- a/itests/deals_max_staging_deals_test.go +++ /dev/null @@ -1,70 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestMaxStagingDeals(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 - ctx := context.Background() - - kit.QuietMiningLogs() - - client, miner, ens := kit.EnsembleMinimal(t, - kit.MockProofs(), - kit.WithMaxStagingDealsBytes(8192), // max 8KB staging deals - kit.SectorSize(512<<20), // 512MiB sectors. - ) - ens.InterconnectAll().BeginMining(200 * time.Millisecond) - - dh := kit.NewDealHarness(t, client, miner, miner) - - client.WaitTillChain(ctx, kit.HeightAtLeast(5)) - - res, _ := client.CreateImportFile(ctx, 0, 8192) // 8KB file - list, err := client.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 1) - - res2, _ := client.CreateImportFile(ctx, 0, 4096) - list, err = client.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 2) - - // first deal stays in staging area, and is not yet passed to the sealing subsystem - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.FastRetrieval = true - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price. - deal := dh.StartDeal(ctx, dp) - - time.Sleep(1 * time.Second) - - // expecting second deal to fail since staging area is full - dp.Data.Root = res2.Root - dp.FastRetrieval = true - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price. - deal2 := dh.StartDeal(ctx, dp) - - _ = deal - - err = dh.ExpectDealFailure(ctx, deal2, "cannot accept deal as miner is overloaded at the moment") - if err != nil { - t.Fatal(err) - } -} diff --git a/itests/deals_offline_test.go b/itests/deals_offline_test.go deleted file mode 100644 index 997d7723aa6..00000000000 --- a/itests/deals_offline_test.go +++ /dev/null @@ -1,107 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "path/filepath" - "testing" - "time" - - "github.com/stretchr/testify/require" - - commcid "github.com/filecoin-project/go-fil-commcid" - commp "github.com/filecoin-project/go-fil-commp-hashhash" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - - lapi "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestOfflineDealFlow(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_DATA_CALCULATE_COMMP_001, @CLIENT_DATA_GENERATE_CAR_001, @CLIENT_DATA_GET_DEAL_PIECE_CID_001, @CLIENT_DATA_GET_DEAL_PIECE_CID_001 - runTest := func(t *testing.T, fastRet bool, upscale abi.PaddedPieceSize) { - ctx := context.Background() - client, miner, ens := kit.EnsembleMinimal(t, kit.WithAllSubsystems()) // no mock proofs - ens.InterconnectAll().BeginMining(250 * time.Millisecond) - - dh := kit.NewDealHarness(t, client, miner, miner) - - // Create a random file and import on the client. - res, inFile := client.CreateImportFile(ctx, 1, 200) - - // Get the piece size and commP - rootCid := res.Root - pieceInfo, err := client.ClientDealPieceCID(ctx, rootCid) - require.NoError(t, err) - t.Log("FILE CID:", rootCid) - - // test whether padding works as intended - if upscale > 0 { - newRawCp, err := commp.PadCommP( - pieceInfo.PieceCID.Hash()[len(pieceInfo.PieceCID.Hash())-32:], - uint64(pieceInfo.PieceSize), - uint64(upscale), - ) - require.NoError(t, err) - - pieceInfo.PieceSize = upscale - pieceInfo.PieceCID, err = commcid.DataCommitmentV1ToCID(newRawCp) - require.NoError(t, err) - } - - dp := dh.DefaultStartDealParams() - dp.DealStartEpoch = abi.ChainEpoch(4 << 10) - dp.FastRetrieval = fastRet - // Replace with params for manual storage deal (offline deal) - dp.Data = &storagemarket.DataRef{ - TransferType: storagemarket.TTManual, - Root: rootCid, - PieceCid: &pieceInfo.PieceCID, - PieceSize: pieceInfo.PieceSize.Unpadded(), - } - - proposalCid := dh.StartDeal(ctx, dp) - - //stm: @CLIENT_STORAGE_DEALS_GET_001 - // Wait for the deal to reach StorageDealCheckForAcceptance on the client - cd, err := client.ClientGetDealInfo(ctx, *proposalCid) - require.NoError(t, err) - require.Eventually(t, func() bool { - cd, _ := client.ClientGetDealInfo(ctx, *proposalCid) - return cd.State == storagemarket.StorageDealCheckForAcceptance - }, 30*time.Second, 1*time.Second, "actual deal status is %s", storagemarket.DealStates[cd.State]) - - // Create a CAR file from the raw file - carFileDir := t.TempDir() - carFilePath := filepath.Join(carFileDir, "out.car") - err = client.ClientGenCar(ctx, lapi.FileRef{Path: inFile}, carFilePath) - require.NoError(t, err) - - // Import the CAR file on the miner - this is the equivalent to - // transferring the file across the wire in a normal (non-offline) deal - err = miner.DealsImportData(ctx, *proposalCid, carFilePath) - require.NoError(t, err) - - // Wait for the deal to be published - dh.WaitDealPublished(ctx, proposalCid) - - t.Logf("deal published, retrieving") - - // Retrieve the deal - outFile := dh.PerformRetrieval(ctx, proposalCid, rootCid, false) - - kit.AssertFilesEqual(t, inFile, outFile) - - } - - t.Run("stdretrieval", func(t *testing.T) { runTest(t, false, 0) }) - t.Run("fastretrieval", func(t *testing.T) { runTest(t, true, 0) }) - t.Run("fastretrieval", func(t *testing.T) { runTest(t, true, 1024) }) -} diff --git a/itests/deals_padding_test.go b/itests/deals_padding_test.go deleted file mode 100644 index aaca4536069..00000000000 --- a/itests/deals_padding_test.go +++ /dev/null @@ -1,84 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - commcid "github.com/filecoin-project/go-fil-commcid" - commp "github.com/filecoin-project/go-fil-commp-hashhash" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestDealPadding(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_DATA_GET_DEAL_PIECE_CID_001 - kit.QuietMiningLogs() - - var blockTime = 250 * time.Millisecond - startEpoch := abi.ChainEpoch(2 << 12) - - client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC(), kit.WithAllSubsystems()) // no mock proofs. - ens.InterconnectAll().BeginMining(blockTime) - dh := kit.NewDealHarness(t, client, miner, miner) - - ctx := context.Background() - client.WaitTillChain(ctx, kit.BlocksMinedByAll(miner.ActorAddr)) - - // Create a random file, would originally be a 256-byte sector - res, inFile := client.CreateImportFile(ctx, 1, 200) - - // Get the piece size and commP - pieceInfo, err := client.ClientDealPieceCID(ctx, res.Root) - require.NoError(t, err) - t.Log("FILE CID:", res.Root) - - runTest := func(t *testing.T, upscale abi.PaddedPieceSize) { - // test whether padding works as intended - newRawCp, err := commp.PadCommP( - pieceInfo.PieceCID.Hash()[len(pieceInfo.PieceCID.Hash())-32:], - uint64(pieceInfo.PieceSize), - uint64(upscale), - ) - require.NoError(t, err) - - pcid, err := commcid.DataCommitmentV1ToCID(newRawCp) - require.NoError(t, err) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.Data.PieceCid = &pcid - dp.Data.PieceSize = upscale.Unpadded() - dp.DealStartEpoch = startEpoch - proposalCid := dh.StartDeal(ctx, dp) - - // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this - time.Sleep(time.Second) - - //stm: @CLIENT_STORAGE_DEALS_GET_001 - di, err := client.ClientGetDealInfo(ctx, *proposalCid) - require.NoError(t, err) - require.True(t, di.PieceCID.Equals(pcid)) - - dh.WaitDealSealed(ctx, proposalCid, false, false, nil) - - // Retrieve the deal - outFile := dh.PerformRetrieval(ctx, proposalCid, res.Root, false) - - kit.AssertFilesEqual(t, inFile, outFile) - } - - t.Run("padQuarterSector", func(t *testing.T) { runTest(t, 512) }) - t.Run("padHalfSector", func(t *testing.T) { runTest(t, 1024) }) - t.Run("padFullSector", func(t *testing.T) { runTest(t, 2048) }) -} diff --git a/itests/deals_partial_retrieval_dm-level_test.go b/itests/deals_partial_retrieval_dm-level_test.go deleted file mode 100644 index c03d07aac53..00000000000 --- a/itests/deals_partial_retrieval_dm-level_test.go +++ /dev/null @@ -1,267 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "fmt" - "io" - "os" - "testing" - "time" - - blocks "github.com/ipfs/go-block-format" - "github.com/ipfs/go-cid" - "github.com/ipld/go-car" - textselector "github.com/ipld/go-ipld-selector-text-lite" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - api0 "github.com/filecoin-project/lotus/api/v0api" - "github.com/filecoin-project/lotus/itests/kit" -) - -// please talk to @ribasushi or @mikeal before modifying these test: there are -// downstream dependencies on ADL-less operation -var ( - adlFixtureCar = "fixtures/adl_test.car" - adlFixtureRoot, _ = cid.Parse("bafybeiaigxwanoxyeuzyiknhrg6io6kobfbm37ozcips6qdwumub2gaomy") - adlFixtureCommp, _ = cid.Parse("baga6ea4seaqjnmnrv4qsfz2rnda54mvo5al22dwpguhn2pmep63gl7bbqqqraai") - adlFixturePieceSize = abi.PaddedPieceSize(1024) - dmSelector = api.Selector("Links/0/Hash") - dmTextSelector = textselector.Expression(dmSelector) - dmExpectedResult = "NO ADL" - dmExpectedCarBlockCount = 4 - dmDagSpec = []api.DagSpec{{DataSelector: &dmSelector, ExportMerkleProof: true}} -) - -func TestDMLevelPartialRetrieval(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_RETRIEVAL_RETRIEVE_001, @CLIENT_RETRIEVAL_FIND_001 - ctx := context.Background() - - kit.QuietMiningLogs() - client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC()) - dh := kit.NewDealHarness(t, client, miner, miner) - ens.InterconnectAll().BeginMiningMustPost(50 * time.Millisecond) - - _, err := client.ClientImport(ctx, api.FileRef{Path: adlFixtureCar, IsCAR: true}) - require.NoError(t, err) - - caddr, err := client.WalletDefaultAddress(ctx) - require.NoError(t, err) - - // - // test retrieval from local car 1st - require.NoError(t, testDMExportAsCar( - ctx, client, api.ExportRef{ - FromLocalCAR: adlFixtureCar, - Root: adlFixtureRoot, - DAGs: dmDagSpec, - }, t.TempDir(), - )) - require.NoError(t, testDMExportAsFile( - ctx, client, api.ExportRef{ - FromLocalCAR: adlFixtureCar, - Root: adlFixtureRoot, - DAGs: dmDagSpec, - }, t.TempDir(), - )) - - // - // ensure V0 continues functioning as expected - require.NoError(t, tesV0RetrievalAsCar( - ctx, client, api0.RetrievalOrder{ - FromLocalCAR: adlFixtureCar, - Root: adlFixtureRoot, - DatamodelPathSelector: &dmTextSelector, - }, t.TempDir(), - )) - require.NoError(t, testV0RetrievalAsFile( - ctx, client, api0.RetrievalOrder{ - FromLocalCAR: adlFixtureCar, - Root: adlFixtureRoot, - DatamodelPathSelector: &dmTextSelector, - }, t.TempDir(), - )) - - // - // now perform a storage/retrieval deal as well, and retest - dp := dh.DefaultStartDealParams() - dp.Data = &storagemarket.DataRef{ - Root: adlFixtureRoot, - PieceCid: &adlFixtureCommp, - PieceSize: adlFixturePieceSize.Unpadded(), - } - proposalCid := dh.StartDeal(ctx, dp) - - // Wait for the deal to reach StorageDealCheckForAcceptance on the client - cd, err := client.ClientGetDealInfo(ctx, *proposalCid) - require.NoError(t, err) - require.Eventually(t, func() bool { - cd, _ := client.ClientGetDealInfo(ctx, *proposalCid) - return cd.State == storagemarket.StorageDealCheckForAcceptance - }, 30*time.Second, 1*time.Second, "actual deal status is %s", storagemarket.DealStates[cd.State]) - - dh.WaitDealSealed(ctx, proposalCid, false, false, nil) - - offers, err := client.ClientFindData(ctx, adlFixtureRoot, nil) - require.NoError(t, err) - require.NotEmpty(t, offers, "no offers") - - retOrder := offers[0].Order(caddr) - retOrder.DataSelector = &dmSelector - - rr, err := client.ClientRetrieve(ctx, retOrder) - require.NoError(t, err) - - err = client.ClientRetrieveWait(ctx, rr.DealID) - require.NoError(t, err) - - require.NoError(t, testDMExportAsCar( - ctx, client, api.ExportRef{ - DealID: rr.DealID, - Root: adlFixtureRoot, - DAGs: dmDagSpec, - }, t.TempDir(), - )) - require.NoError(t, testDMExportAsFile( - ctx, client, api.ExportRef{ - DealID: rr.DealID, - Root: adlFixtureRoot, - DAGs: dmDagSpec, - }, t.TempDir(), - )) - -} - -func testDMExportAsFile(ctx context.Context, client *kit.TestFullNode, expDirective api.ExportRef, tempDir string) error { - out := tempDir + string(os.PathSeparator) + "exp-test" + expDirective.Root.String() - - fileDest := api.FileRef{ - Path: out, - } - err := client.ClientExport(ctx, expDirective, fileDest) - if err != nil { - return err - } - - f, err := os.Open(out) - if err != nil { - return err - } - - defer f.Close() //nolint:errcheck - - return validateDMUnixFile(f) -} -func testV0RetrievalAsFile(ctx context.Context, client *kit.TestFullNode, retOrder api0.RetrievalOrder, tempDir string) error { - out := tempDir + string(os.PathSeparator) + "exp-test" + retOrder.Root.String() - - cv0 := &api0.WrapperV1Full{FullNode: client.FullNode} - err := cv0.ClientRetrieve(ctx, retOrder, &api.FileRef{ - Path: out, - }) - if err != nil { - return err - } - - f, err := os.Open(out) - if err != nil { - return err - } - - defer f.Close() //nolint:errcheck - - return validateDMUnixFile(f) -} -func validateDMUnixFile(r io.Reader) error { - data, err := io.ReadAll(r) - if err != nil { - return err - } - if string(data) != dmExpectedResult { - return fmt.Errorf("retrieved data mismatch: expected '%s' got '%s'", dmExpectedResult, data) - } - - return nil -} - -func testDMExportAsCar(ctx context.Context, client *kit.TestFullNode, expDirective api.ExportRef, tempDir string) error { - out, err := os.CreateTemp(tempDir, "exp-test") - if err != nil { - return err - } - defer out.Close() //nolint:errcheck - - carDest := api.FileRef{ - IsCAR: true, - Path: out.Name(), - } - err = client.ClientExport(ctx, expDirective, carDest) - if err != nil { - return err - } - - return validateDMCar(out) -} -func tesV0RetrievalAsCar(ctx context.Context, client *kit.TestFullNode, retOrder api0.RetrievalOrder, tempDir string) error { - out, err := os.CreateTemp(tempDir, "exp-test") - if err != nil { - return err - } - defer out.Close() //nolint:errcheck - - cv0 := &api0.WrapperV1Full{FullNode: client.FullNode} - err = cv0.ClientRetrieve(ctx, retOrder, &api.FileRef{ - Path: out.Name(), - IsCAR: true, - }) - if err != nil { - return err - } - - return validateDMCar(out) -} -func validateDMCar(r io.Reader) error { - cr, err := car.NewCarReader(r) - if err != nil { - return err - } - - if len(cr.Header.Roots) != 1 { - return fmt.Errorf("expected a single root in result car, got %d", len(cr.Header.Roots)) - } else if cr.Header.Roots[0].String() != adlFixtureRoot.String() { - return fmt.Errorf("expected root cid '%s', got '%s'", adlFixtureRoot.String(), cr.Header.Roots[0].String()) - } - - blks := make([]blocks.Block, 0) - for { - b, err := cr.Next() - if err == io.EOF { - break - } else if err != nil { - return err - } - - blks = append(blks, b) - } - - if len(blks) != dmExpectedCarBlockCount { - return fmt.Errorf("expected a car file with %d blocks, got one with %d instead", dmExpectedCarBlockCount, len(blks)) - } - - data := fmt.Sprintf("%s%s", blks[2].RawData(), blks[3].RawData()) - if data != dmExpectedResult { - return fmt.Errorf("retrieved data mismatch: expected '%s' got '%s'", dmExpectedResult, data) - } - - return nil -} diff --git a/itests/deals_partial_retrieval_test.go b/itests/deals_partial_retrieval_test.go deleted file mode 100644 index 0bbf23da054..00000000000 --- a/itests/deals_partial_retrieval_test.go +++ /dev/null @@ -1,256 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "fmt" - "io" - "os" - "testing" - "time" - - blocks "github.com/ipfs/go-block-format" - "github.com/ipfs/go-cid" - "github.com/ipld/go-car" - "github.com/stretchr/testify/require" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/itests/kit" -) - -// use the mainnet carfile as text fixture: it will always be here -// https://dweb.link/ipfs/bafy2bzacecnamqgqmifpluoeldx7zzglxcljo6oja4vrmtj7432rphldpdmm2/8/1/8/1/0/1/0 -var ( - sourceCar = "../build/genesis/mainnet.car" - carRoot, _ = cid.Parse("bafy2bzacecnamqgqmifpluoeldx7zzglxcljo6oja4vrmtj7432rphldpdmm2") - carCommp, _ = cid.Parse("baga6ea4seaqmrivgzei3fmx5qxtppwankmtou6zvigyjaveu3z2zzwhysgzuina") - selectedCid, _ = cid.Parse("bafkqaetgnfwc6mjpon2g64tbm5sxa33xmvza") - carPieceSize = abi.PaddedPieceSize(2097152) - textSelector = api.Selector("8/1/8/1/0/1/0") - textSelectorNonLink = api.Selector("8/1/8/1/0/1") - textSelectorNonexistent = api.Selector("42") - expectedResult = "fil/1/storagepower" -) - -func TestPartialRetrieval(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_RETRIEVAL_RETRIEVE_001 - ctx := context.Background() - - kit.QuietMiningLogs() - client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC(), kit.MockProofs(), kit.SectorSize(512<<20)) - dh := kit.NewDealHarness(t, client, miner, miner) - ens.InterconnectAll().BeginMining(50 * time.Millisecond) - - _, err := client.ClientImport(ctx, api.FileRef{Path: sourceCar, IsCAR: true}) - require.NoError(t, err) - - caddr, err := client.WalletDefaultAddress(ctx) - require.NoError(t, err) - - // first test retrieval from local car, then do an actual deal - for _, exportMerkleProof := range []bool{false, true} { - for _, fullCycle := range []bool{false, true} { - - var retOrder api.RetrievalOrder - var eref api.ExportRef - - if !fullCycle { - eref.FromLocalCAR = sourceCar - } else { - dp := dh.DefaultStartDealParams() - dp.Data = &storagemarket.DataRef{ - // FIXME: figure out how to do this with an online partial transfer - TransferType: storagemarket.TTManual, - Root: carRoot, - PieceCid: &carCommp, - PieceSize: carPieceSize.Unpadded(), - } - proposalCid := dh.StartDeal(ctx, dp) - - // Wait for the deal to reach StorageDealCheckForAcceptance on the client - cd, err := client.ClientGetDealInfo(ctx, *proposalCid) - require.NoError(t, err) - require.Eventually(t, func() bool { - cd, _ := client.ClientGetDealInfo(ctx, *proposalCid) - return cd.State == storagemarket.StorageDealCheckForAcceptance - }, 30*time.Second, 1*time.Second, "actual deal status is %s", storagemarket.DealStates[cd.State]) - - err = miner.DealsImportData(ctx, *proposalCid, sourceCar) - require.NoError(t, err) - - // Wait for the deal to be published, we should be able to start retrieval right away - dh.WaitDealPublished(ctx, proposalCid) - - offers, err := client.ClientFindData(ctx, carRoot, nil) - require.NoError(t, err) - require.NotEmpty(t, offers, "no offers") - - retOrder = offers[0].Order(caddr) - } - - retOrder.DataSelector = &textSelector - eref.DAGs = append(eref.DAGs, api.DagSpec{ - DataSelector: &textSelector, - ExportMerkleProof: exportMerkleProof, - }) - eref.Root = carRoot - - // test retrieval of either data or constructing a partial selective-car - for _, retrieveAsCar := range []bool{false, true} { - outFile := t.TempDir() + string(os.PathSeparator) + "ret-file" + retOrder.Root.String() - - require.NoError(t, testGenesisRetrieval( - ctx, - client, - retOrder, - eref, - &api.FileRef{ - Path: outFile, - IsCAR: retrieveAsCar, - }, - )) - - // UGH if I do not sleep here, I get things like: - /* - retrieval failed: Retrieve failed: there is an active retrieval deal with peer 12D3KooWK9fB9a3HZ4PQLVmEQ6pweMMn5CAyKtumB71CPTnuBDi6 for payload CID bafy2bzacecnamqgqmifpluoeldx7zzglxcljo6oja4vrmtj7432rphldpdmm2 (retrieval deal ID 1631259332180384709, state DealStatusFinalizingBlockstore) - existing deal must be cancelled before starting a new retrieval deal: - github.com/filecoin-project/lotus/node/impl/client.(*API).ClientRetrieve - /home/circleci/project/node/impl/client/client.go:774 - */ - time.Sleep(time.Second) - } - } - } - - // ensure non-existent paths fail - require.EqualError( - t, - testGenesisRetrieval( - ctx, - client, - api.RetrievalOrder{ - Root: carRoot, - DataSelector: &textSelectorNonexistent, - }, - api.ExportRef{ - Root: carRoot, - FromLocalCAR: sourceCar, - DAGs: []api.DagSpec{{DataSelector: &textSelectorNonexistent}}, - }, - &api.FileRef{}, - ), - fmt.Sprintf("parsing dag spec: path selection does not match a node within %s", carRoot), - ) - - // ensure non-boundary retrievals fail - require.EqualError( - t, - testGenesisRetrieval( - ctx, - client, - api.RetrievalOrder{ - Root: carRoot, - DataSelector: &textSelectorNonLink, - }, - api.ExportRef{ - Root: carRoot, - FromLocalCAR: sourceCar, - DAGs: []api.DagSpec{{DataSelector: &textSelectorNonLink}}, - }, - &api.FileRef{}, - ), - fmt.Sprintf("parsing dag spec: error while locating partial retrieval sub-root: unsupported selection path '%s' does not correspond to a block boundary (a.k.a. CID link)", textSelectorNonLink), - ) -} - -func testGenesisRetrieval(ctx context.Context, client *kit.TestFullNode, retOrder api.RetrievalOrder, eref api.ExportRef, retRef *api.FileRef) error { - - if retOrder.Total.Nil() { - retOrder.Total = big.Zero() - } - if retOrder.UnsealPrice.Nil() { - retOrder.UnsealPrice = big.Zero() - } - - if eref.FromLocalCAR == "" { - rr, err := client.ClientRetrieve(ctx, retOrder) - if err != nil { - return err - } - eref.DealID = rr.DealID - - if err := client.ClientRetrieveWait(ctx, rr.DealID); err != nil { - return xerrors.Errorf("retrieval wait: %w", err) - } - } - - err := client.ClientExport(ctx, eref, *retRef) - if err != nil { - return err - } - - outFile, err := os.Open(retRef.Path) - if err != nil { - return err - } - - defer outFile.Close() //nolint:errcheck - - var data []byte - if !retRef.IsCAR { - - data, err = io.ReadAll(outFile) - if err != nil { - return err - } - - } else { - - cr, err := car.NewCarReader(outFile) - if err != nil { - return err - } - - if len(cr.Header.Roots) != 1 { - return fmt.Errorf("expected a single root in result car, got %d", len(cr.Header.Roots)) - } else if eref.DAGs[0].ExportMerkleProof && cr.Header.Roots[0].String() != carRoot.String() { - return fmt.Errorf("expected root cid '%s', got '%s'", carRoot.String(), cr.Header.Roots[0].String()) - } else if !eref.DAGs[0].ExportMerkleProof && cr.Header.Roots[0].String() != selectedCid.String() { - return fmt.Errorf("expected root cid '%s', got '%s'", selectedCid.String(), cr.Header.Roots[0].String()) - } - - blks := make([]blocks.Block, 0) - for { - b, err := cr.Next() - if err == io.EOF { - break - } else if err != nil { - return err - } - - blks = append(blks, b) - } - - if (eref.DAGs[0].ExportMerkleProof && len(blks) != 3) || (!eref.DAGs[0].ExportMerkleProof && len(blks) != 1) { - return fmt.Errorf("expected a car file with 3/1 blocks, got one with %d instead", len(blks)) - } - - data = blks[len(blks)-1].RawData() - } - - if string(data) != expectedResult { - return fmt.Errorf("retrieved data mismatch: expected '%s' got '%s'", expectedResult, data) - } - - return nil -} diff --git a/itests/deals_power_test.go b/itests/deals_power_test.go deleted file mode 100644 index 57483cde716..00000000000 --- a/itests/deals_power_test.go +++ /dev/null @@ -1,70 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestFirstDealEnablesMining(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - // test making a deal with a fresh miner, and see if it starts to mine. - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - var ( - client kit.TestFullNode - genMiner kit.TestMiner // bootstrap - provider kit.TestMiner // no sectors, will need to create one - ) - - ens := kit.NewEnsemble(t, kit.MockProofs()) - ens.FullNode(&client) - ens.Miner(&genMiner, &client, kit.WithAllSubsystems()) - ens.Miner(&provider, &client, kit.WithAllSubsystems(), kit.PresealSectors(0)) - ens.Start().InterconnectAll().BeginMining(50 * time.Millisecond) - - ctx := context.Background() - - dh := kit.NewDealHarness(t, &client, &provider, &provider) - - ref, _ := client.CreateImportFile(ctx, 5, 0) - - t.Log("FILE CID:", ref.Root) - - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - // start a goroutine to monitor head changes from the client - // once the provider has mined a block, thanks to the power acquired from the deal, - // we pass the test. - providerMined := make(chan struct{}) - - go func() { - _ = client.WaitTillChain(ctx, kit.BlocksMinedByAll(provider.ActorAddr)) - close(providerMined) - }() - - // now perform the deal. - dp := dh.DefaultStartDealParams() - dp.Data.Root = ref.Root - deal := dh.StartDeal(ctx, dp) - - // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this - time.Sleep(time.Second) - - dh.WaitDealSealed(ctx, deal, false, false, nil) - - <-providerMined -} diff --git a/itests/deals_pricing_test.go b/itests/deals_pricing_test.go deleted file mode 100644 index f2301eee8dc..00000000000 --- a/itests/deals_pricing_test.go +++ /dev/null @@ -1,150 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/storage/sealer/storiface" -) - -func TestQuotePriceForUnsealedRetrieval(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - var ( - ctx = context.Background() - blocktime = 50 * time.Millisecond - ) - - kit.QuietMiningLogs() - - client, miner, ens := kit.EnsembleMinimal(t) - ens.InterconnectAll().BeginMiningMustPost(blocktime) - - var ( - ppb = int64(1) - unsealPrice = int64(77) - ) - - // Set unsealed price to non-zero - ask, err := miner.MarketGetRetrievalAsk(ctx) - require.NoError(t, err) - ask.PricePerByte = abi.NewTokenAmount(ppb) - ask.UnsealPrice = abi.NewTokenAmount(unsealPrice) - err = miner.MarketSetRetrievalAsk(ctx, ask) - require.NoError(t, err) - - dh := kit.NewDealHarness(t, client, miner, miner) - - deal1, res1, _ := dh.MakeOnlineDeal(ctx, kit.MakeFullDealParams{Rseed: 6}) - - // one more storage deal for the same data - _, res2, _ := dh.MakeOnlineDeal(ctx, kit.MakeFullDealParams{Rseed: 6}) - require.Equal(t, res1.Root, res2.Root) - - //stm: @CLIENT_STORAGE_DEALS_GET_001 - // Retrieval - dealInfo, err := client.ClientGetDealInfo(ctx, *deal1) - require.NoError(t, err) - - //stm: @CLIENT_RETRIEVAL_FIND_001 - // fetch quote -> zero for unsealed price since unsealed file already exists. - offers, err := client.ClientFindData(ctx, res1.Root, &dealInfo.PieceCID) - require.NoError(t, err) - require.Len(t, offers, 2) - require.Equal(t, offers[0], offers[1]) - require.Equal(t, uint64(0), offers[0].UnsealPrice.Uint64()) - require.Equal(t, dealInfo.Size*uint64(ppb), offers[0].MinPrice.Uint64()) - - // remove ONLY one unsealed file - //stm: @STORAGE_LIST_001, @MINER_SECTOR_LIST_001 - ss, err := miner.StorageList(context.Background()) - require.NoError(t, err) - _, err = miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - - //stm: @STORAGE_DROP_SECTOR_001, @STORAGE_LIST_001 -iLoop: - for storeID, sd := range ss { - for _, sector := range sd { - err := miner.StorageDropSector(ctx, storeID, sector.SectorID, storiface.FTUnsealed) - require.NoError(t, err) - break iLoop // remove ONLY one - } - } - - //stm: @CLIENT_RETRIEVAL_FIND_001 - // get retrieval quote -> zero for unsealed price as unsealed file exists. - offers, err = client.ClientFindData(ctx, res1.Root, &dealInfo.PieceCID) - require.NoError(t, err) - require.Len(t, offers, 2) - require.Equal(t, offers[0], offers[1]) - require.Equal(t, uint64(0), offers[0].UnsealPrice.Uint64()) - require.Equal(t, dealInfo.Size*uint64(ppb), offers[0].MinPrice.Uint64()) - - // remove the other unsealed file as well - ss, err = miner.StorageList(context.Background()) - require.NoError(t, err) - _, err = miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - for storeID, sd := range ss { - for _, sector := range sd { - require.NoError(t, miner.StorageDropSector(ctx, storeID, sector.SectorID, storiface.FTUnsealed)) - } - } - - //stm: @CLIENT_RETRIEVAL_FIND_001 - // fetch quote -> non-zero for unseal price as we no more unsealed files. - offers, err = client.ClientFindData(ctx, res1.Root, &dealInfo.PieceCID) - require.NoError(t, err) - require.Len(t, offers, 2) - require.Equal(t, offers[0], offers[1]) - require.Equal(t, uint64(unsealPrice), offers[0].UnsealPrice.Uint64()) - total := (dealInfo.Size * uint64(ppb)) + uint64(unsealPrice) - require.Equal(t, total, offers[0].MinPrice.Uint64()) -} - -func TestZeroPricePerByteRetrieval(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - var ( - blockTime = 10 * time.Millisecond - startEpoch = abi.ChainEpoch(2 << 12) - ) - - client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs()) - ens.InterconnectAll().BeginMiningMustPost(blockTime) - - ctx := context.Background() - - ask, err := miner.MarketGetRetrievalAsk(ctx) - require.NoError(t, err) - - ask.PricePerByte = abi.NewTokenAmount(0) - err = miner.MarketSetRetrievalAsk(ctx, ask) - require.NoError(t, err) - - dh := kit.NewDealHarness(t, client, miner, miner) - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{ - N: 1, - StartEpoch: startEpoch, - }) -} diff --git a/itests/deals_publish_test.go b/itests/deals_publish_test.go deleted file mode 100644 index 43f4eeb0500..00000000000 --- a/itests/deals_publish_test.go +++ /dev/null @@ -1,143 +0,0 @@ -// stm: #integration -package itests - -import ( - "bytes" - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/chain/wallet/key" - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/storage/ctladdr" -) - -func TestPublishDealsBatching(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - var ( - ctx = context.Background() - publishPeriod = 10 * time.Second - maxDealsPerMsg = uint64(2) // Set max deals per publish deals message to 2 - startEpoch = abi.ChainEpoch(2 << 12) - ) - - kit.QuietMiningLogs() - - publisherKey, err := key.GenerateKey(types.KTSecp256k1) - require.NoError(t, err) - - opts := node.Options( - node.Override(new(*storageadapter.DealPublisher), - storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{ - Period: publishPeriod, - MaxDealsPerMsg: maxDealsPerMsg, - }), - ), - node.Override(new(*ctladdr.AddressSelector), modules.AddressSelector(&config.MinerAddressConfig{ - DealPublishControl: []string{ - publisherKey.Address.String(), - }, - DisableOwnerFallback: true, - DisableWorkerFallback: true, - })), - ) - - client, miner, ens := kit.EnsembleMinimal(t, kit.Account(publisherKey, types.FromFil(10)), kit.MockProofs(), kit.ConstructorOpts(opts)) - ens.InterconnectAll().BeginMining(10 * time.Millisecond) - - _, err = client.WalletImport(ctx, &publisherKey.KeyInfo) - require.NoError(t, err) - - miner.SetControlAddresses(publisherKey.Address) - - dh := kit.NewDealHarness(t, client, miner, miner) - - // Starts a deal and waits until it's published - runDealTillPublish := func(rseed int) { - res, _ := client.CreateImportFile(ctx, rseed, 0) - - upds, err := client.ClientGetDealUpdates(ctx) - require.NoError(t, err) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.DealStartEpoch = startEpoch - dh.StartDeal(ctx, dp) - - // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this - time.Sleep(time.Second) - - done := make(chan struct{}) - go func() { - for upd := range upds { - if upd.DataRef.Root == res.Root && upd.State == storagemarket.StorageDealAwaitingPreCommit { - done <- struct{}{} - } - } - }() - <-done - } - - // Run three deals in parallel - done := make(chan struct{}, maxDealsPerMsg+1) - for rseed := 1; rseed <= 3; rseed++ { - rseed := rseed - go func() { - runDealTillPublish(rseed) - done <- struct{}{} - }() - } - - // Wait for two of the deals to be published - for i := 0; i < int(maxDealsPerMsg); i++ { - <-done - } - - // Expect a single PublishStorageDeals message that includes the first two deals - //stm: @CHAIN_STATE_LIST_MESSAGES_001 - msgCids, err := client.StateListMessages(ctx, &api.MessageMatch{To: market.Address}, types.EmptyTSK, 1) - require.NoError(t, err) - count := 0 - for _, msgCid := range msgCids { - msg, err := client.ChainGetMessage(ctx, msgCid) - require.NoError(t, err) - - if msg.Method == market.Methods.PublishStorageDeals { - count++ - var pubDealsParams market2.PublishStorageDealsParams - err = pubDealsParams.UnmarshalCBOR(bytes.NewReader(msg.Params)) - require.NoError(t, err) - require.Len(t, pubDealsParams.Deals, int(maxDealsPerMsg)) - require.Equal(t, publisherKey.Address.String(), msg.From.String()) - } - } - require.Equal(t, 1, count) - - // The third deal should be published once the publish period expires. - // Allow a little padding as it takes a moment for the state change to - // be noticed by the client. - padding := 10 * time.Second - select { - case <-time.After(publishPeriod + padding): - require.Fail(t, "Expected 3rd deal to be published once publish period elapsed") - case <-done: // Success - } -} diff --git a/itests/deals_remote_retrieval_test.go b/itests/deals_remote_retrieval_test.go deleted file mode 100644 index c0a37e69e33..00000000000 --- a/itests/deals_remote_retrieval_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package itests - -import ( - "bytes" - "context" - "fmt" - "io" - "net/url" - "os" - "path" - "testing" - "time" - - "github.com/google/uuid" - "github.com/gorilla/websocket" - "github.com/ipld/go-car" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - bstore "github.com/filecoin-project/lotus/blockstore" - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestNetStoreRetrieval(t *testing.T) { - kit.QuietMiningLogs() - - blocktime := 5 * time.Millisecond - ctx := context.Background() - - full, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) - ens.InterconnectAll().BeginMining(blocktime) - - time.Sleep(5 * time.Second) - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - dealStartEpoch := abi.ChainEpoch(2 << 12) - - rseed := 7 - - dh := kit.NewDealHarness(t, full, miner, miner) - dealCid, res, _ := dh.MakeOnlineDeal(context.Background(), kit.MakeFullDealParams{ - Rseed: rseed, - StartEpoch: dealStartEpoch, - UseCARFileForStorageDeal: true, - }) - - // create deal store - id := uuid.New() - rstore := bstore.NewMemorySync() - - au, err := url.Parse(full.ListenURL) - require.NoError(t, err) - - switch au.Scheme { - case "http": - au.Scheme = "ws" - case "https": - au.Scheme = "wss" - } - - au.Path = path.Join(au.Path, "/rest/v0/store/"+id.String()) - - conn, _, err := websocket.DefaultDialer.Dial(au.String(), nil) - require.NoError(t, err) - - _ = bstore.HandleNetBstoreWS(ctx, rstore, conn) - - dh.PerformRetrievalWithOrder(ctx, dealCid, res.Root, false, func(offer api.QueryOffer, address address.Address) api.RetrievalOrder { - order := offer.Order(address) - - order.RemoteStore = &id - - return order - }) - - // check blockstore blocks - carv1FilePath, _ := kit.CreateRandomCARv1(t, rseed, 200) - cb, err := os.ReadFile(carv1FilePath) - require.NoError(t, err) - - cr, err := car.NewCarReader(bytes.NewReader(cb)) - require.NoError(t, err) - - var blocks int - for { - cb, err := cr.Next() - if err == io.EOF { - fmt.Println("blocks: ", blocks) - return - } - require.NoError(t, err) - - sb, err := rstore.Get(ctx, cb.Cid()) - require.NoError(t, err) - require.EqualValues(t, cb.RawData(), sb.RawData()) - - blocks++ - } -} diff --git a/itests/deals_retry_deal_no_funds_test.go b/itests/deals_retry_deal_no_funds_test.go deleted file mode 100644 index 650b2436e0e..00000000000 --- a/itests/deals_retry_deal_no_funds_test.go +++ /dev/null @@ -1,188 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/chain/wallet/key" - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/storage/ctladdr" -) - -var ( - publishPeriod = 1 * time.Second - maxDealsPerMsg = uint64(2) // Set max deals per publish deals message to 2 - - blockTime = 3 * time.Millisecond -) - -func TestDealsRetryLackOfFunds(t *testing.T) { - t.Run("cover-gas", func(t *testing.T) { - testDealsRetryLackOfFunds(t, types.NewInt(1020000000000)) - }) - t.Run("empty", func(t *testing.T) { - testDealsRetryLackOfFunds(t, types.NewInt(1)) - }) -} - -func testDealsRetryLackOfFunds(t *testing.T, publishStorageAccountFunds abi.TokenAmount) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 - ctx := context.Background() - - kit.QuietMiningLogs() - - // Allow 8MB sectors - eightMBSectorsOpt := kit.SectorSize(8 << 20) - - publishStorageDealKey, err := key.GenerateKey(types.KTSecp256k1) - require.NoError(t, err) - - opts := node.Options( - node.Override(new(*storageadapter.DealPublisher), - storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{ - Period: publishPeriod, - MaxDealsPerMsg: maxDealsPerMsg, - }), - ), - node.Override(new(*ctladdr.AddressSelector), modules.AddressSelector(&config.MinerAddressConfig{ - DealPublishControl: []string{ - publishStorageDealKey.Address.String(), - }, - DisableOwnerFallback: true, - DisableWorkerFallback: true, - })), - ) - - minerFullNode, clientFullNode, miner, ens := kit.EnsembleTwoOne(t, kit.Account(publishStorageDealKey, publishStorageAccountFunds), kit.ConstructorOpts(opts), kit.MockProofs(), eightMBSectorsOpt) - - kit.QuietMiningLogs() - - ens. - Start(). - InterconnectAll(). - BeginMining(blockTime) - - _, err = minerFullNode.WalletImport(ctx, &publishStorageDealKey.KeyInfo) - require.NoError(t, err) - - miner.SetControlAddresses(publishStorageDealKey.Address) - - dh := kit.NewDealHarness(t, clientFullNode, miner, miner) - - res, _ := clientFullNode.CreateImportFile(ctx, 0, 4<<20) // 4MiB file. - list, err := clientFullNode.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 1) - require.Equal(t, res.Root, *list[0].Root) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.FastRetrieval = true - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price. - deal := dh.StartDeal(ctx, dp) - - propcid := *deal - - go func() { - time.Sleep(30 * time.Second) - - kit.SendFunds(ctx, t, minerFullNode, publishStorageDealKey.Address, types.FromFil(1)) - - err := miner.MarketRetryPublishDeal(ctx, propcid) - if err != nil { - panic(err) - } - }() - - dh.WaitDealSealed(ctx, deal, false, false, nil) -} - -func TestDealsRetryLackOfFunds_blockInPublishDeal(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 - ctx := context.Background() - kit.QuietMiningLogs() - - // Allow 8MB sectors - eightMBSectorsOpt := kit.SectorSize(8 << 20) - - publishStorageDealKey, err := key.GenerateKey(types.KTSecp256k1) - require.NoError(t, err) - - opts := node.Options( - node.Override(new(*storageadapter.DealPublisher), - storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{ - Period: publishPeriod, - MaxDealsPerMsg: maxDealsPerMsg, - }), - ), - node.Override(new(*ctladdr.AddressSelector), modules.AddressSelector(&config.MinerAddressConfig{ - DealPublishControl: []string{ - publishStorageDealKey.Address.String(), - }, - DisableOwnerFallback: true, - DisableWorkerFallback: true, - })), - ) - - publishStorageAccountFunds := types.NewInt(1020000000000) - minerFullNode, clientFullNode, miner, ens := kit.EnsembleTwoOne(t, kit.Account(publishStorageDealKey, publishStorageAccountFunds), kit.ConstructorOpts(opts), kit.MockProofs(), eightMBSectorsOpt) - - kit.QuietMiningLogs() - - ens. - Start(). - InterconnectAll(). - BeginMining(blockTime) - - _, err = minerFullNode.WalletImport(ctx, &publishStorageDealKey.KeyInfo) - require.NoError(t, err) - - miner.SetControlAddresses(publishStorageDealKey.Address) - - dh := kit.NewDealHarness(t, clientFullNode, miner, miner) - - res, _ := clientFullNode.CreateImportFile(ctx, 0, 4<<20) // 4MiB file. - list, err := clientFullNode.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 1) - require.Equal(t, res.Root, *list[0].Root) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.FastRetrieval = true - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price. - deal := dh.StartDeal(ctx, dp) - - dealSealed := make(chan struct{}) - go func() { - dh.WaitDealSealedQuiet(ctx, deal, false, false, nil) - dealSealed <- struct{}{} - }() - - select { - case <-dealSealed: - t.Fatal("deal shouldn't have sealed") - case <-time.After(time.Second * 15): - } -} diff --git a/itests/deals_test.go b/itests/deals_test.go deleted file mode 100644 index a6953d07e69..00000000000 --- a/itests/deals_test.go +++ /dev/null @@ -1,45 +0,0 @@ -// stm: #integration -package itests - -import ( - "testing" - "time" - - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestDealsWithSealingAndRPC(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC(), kit.WithAllSubsystems()) // no mock proofs. - ens.InterconnectAll().BeginMiningMustPost(250 * time.Millisecond) - dh := kit.NewDealHarness(t, client, miner, miner) - - t.Run("stdretrieval", func(t *testing.T) { - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1}) - }) - - t.Run("fastretrieval", func(t *testing.T) { - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1, FastRetrieval: true}) - }) - - t.Run("fastretrieval-twodeals-sequential", func(t *testing.T) { - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1, FastRetrieval: true}) - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1, FastRetrieval: true}) - }) - - t.Run("stdretrieval-carv1", func(t *testing.T) { - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1, UseCARFileForStorageDeal: true}) - }) - -} diff --git a/itests/gateway_test.go b/itests/gateway_test.go index 2dc4e1034d5..b994d6de3c8 100644 --- a/itests/gateway_test.go +++ b/itests/gateway_test.go @@ -24,7 +24,6 @@ import ( "github.com/filecoin-project/lotus/api/client" "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/cli/clicommands" "github.com/filecoin-project/lotus/gateway" "github.com/filecoin-project/lotus/itests/kit" "github.com/filecoin-project/lotus/itests/multisig" @@ -194,46 +193,6 @@ func TestGatewayMsigCLI(t *testing.T) { multisig.RunMultisigTests(t, lite) } -func TestGatewayDealFlow(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - kit.QuietMiningLogs() - - blocktime := 5 * time.Millisecond - ctx := context.Background() - nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit) - - time.Sleep(5 * time.Second) - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - dealStartEpoch := abi.ChainEpoch(2 << 12) - - dh := kit.NewDealHarness(t, nodes.lite, nodes.miner, nodes.miner) - dealCid, res, _ := dh.MakeOnlineDeal(context.Background(), kit.MakeFullDealParams{ - Rseed: 6, - StartEpoch: dealStartEpoch, - }) - dh.PerformRetrieval(ctx, dealCid, res.Root, false) -} - -func TestGatewayCLIDealFlow(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - kit.QuietMiningLogs() - - blocktime := 5 * time.Millisecond - ctx := context.Background() - nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit) - - kit.RunClientTest(t, clicommands.Commands, nodes.lite) -} - type testNodes struct { lite *kit.TestFullNode full *kit.TestFullNode diff --git a/itests/kit/client.go b/itests/kit/client.go deleted file mode 100644 index 18e4259e4e8..00000000000 --- a/itests/kit/client.go +++ /dev/null @@ -1,161 +0,0 @@ -package kit - -import ( - "context" - "fmt" - "math/rand" - "os" - "path/filepath" - "regexp" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/require" - lcli "github.com/urfave/cli/v2" - - "github.com/filecoin-project/specs-actors/v2/actors/builtin" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/types" -) - -// RunClientTest exercises some of the Client CLI commands -func RunClientTest(t *testing.T, cmds []*lcli.Command, clientNode *TestFullNode) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - // Create mock CLI - mockCLI := NewMockCLI(ctx, t, cmds, api.NodeFull) - clientCLI := mockCLI.Client(clientNode.ListenAddr) - - // Get the Miner address - addrs, err := clientNode.StateListMiners(ctx, types.EmptyTSK) - require.NoError(t, err) - require.Len(t, addrs, 1) - - minerAddr := addrs[0] - fmt.Println("Miner:", minerAddr) - - // client query-ask - out := clientCLI.RunCmd("client", "query-ask", minerAddr.String()) - require.Regexp(t, regexp.MustCompile("Ask:"), out) - - // Create a deal (non-interactive) - // client deal --start-epoch= 1000000attofil - res, _, _, err := CreateImportFile(ctx, clientNode, 1, 0) - - require.NoError(t, err) - startEpoch := fmt.Sprintf("--start-epoch=%d", 2<<12) - dataCid := res.Root - price := "1000000attofil" - duration := fmt.Sprintf("%d", build.MinDealDuration) - out = clientCLI.RunCmd("client", "deal", startEpoch, dataCid.String(), minerAddr.String(), price, duration) - fmt.Println("client deal", out) - - // Create a deal (interactive) - // client deal - // - // (in days) - // - // "no" (verified Client) - // "yes" (confirm deal) - res, _, _, err = CreateImportFile(ctx, clientNode, 2, 0) - require.NoError(t, err) - dataCid2 := res.Root - duration = fmt.Sprintf("%d", build.MinDealDuration/builtin.EpochsInDay) - cmd := []string{"client", "deal"} - interactiveCmds := []string{ - dataCid2.String(), - duration, - minerAddr.String(), - "no", - "yes", - } - out = clientCLI.RunInteractiveCmd(cmd, interactiveCmds) - fmt.Println("client deal:\n", out) - - // Wait for provider to start sealing deal - dealStatus := "" - for { - // client list-deals - out = clientCLI.RunCmd("client", "list-deals", "--show-failed") - fmt.Println("list-deals:\n", out) - - lines := strings.Split(out, "\n") - require.GreaterOrEqual(t, len(lines), 2) - re := regexp.MustCompile(`\s+`) - parts := re.Split(lines[1], -1) - if len(parts) < 4 { - require.Fail(t, "bad list-deals output format") - } - dealStatus = parts[3] - fmt.Println(" Deal status:", dealStatus) - - st := CategorizeDealState(dealStatus) - require.NotEqual(t, TestDealStateFailed, st) - if st == TestDealStateComplete { - break - } - - time.Sleep(time.Second) - } - - // client retrieval-ask --size=1 - out = clientCLI.RunCmd("client", "retrieval-ask", "--size=1", minerAddr.String(), dataCid.String()) - require.Regexp(t, regexp.MustCompile("Ask:"), out) - fmt.Println("retrieval ask:\n", out) - - // Retrieve the first file from the Miner - // client retrieve - tmpdir, err := os.MkdirTemp(os.TempDir(), "test-cli-client") - require.NoError(t, err) - path := filepath.Join(tmpdir, "outfile.dat") - - // Wait for client retrieve to succeed. - for { - out = clientCLI.RunCmd("client", "retrieve", dataCid.String(), path) - fmt.Println("retrieve:\n", out) - if strings.Contains(out, "Success") { - break - } - } -} - -func CreateImportFile(ctx context.Context, client api.FullNode, rseed int, size int) (res *api.ImportRes, path string, data []byte, err error) { - data, path, err = createRandomFile(rseed, size) - if err != nil { - return nil, "", nil, err - } - - res, err = client.ClientImport(ctx, api.FileRef{Path: path}) - if err != nil { - return nil, "", nil, err - } - return res, path, data, nil -} - -func createRandomFile(rseed, size int) ([]byte, string, error) { - if size == 0 { - size = 1600 - } - data := make([]byte, size) - _, err := rand.New(rand.NewSource(int64(rseed))).Read(data) - if err != nil { - return nil, "", err - } - - dir, err := os.MkdirTemp(os.TempDir(), "test-make-deal-") - if err != nil { - return nil, "", err - } - - path := filepath.Join(dir, "sourcefile.dat") - err = os.WriteFile(path, data, 0644) - if err != nil { - return nil, "", err - } - - return data, path, nil -} diff --git a/itests/kit/deals.go b/itests/kit/deals.go deleted file mode 100644 index eb6b58667dc..00000000000 --- a/itests/kit/deals.go +++ /dev/null @@ -1,483 +0,0 @@ -package kit - -import ( - "context" - "errors" - "fmt" - "os" - "strings" - "testing" - "time" - - "github.com/ipfs/boxo/files" - dag "github.com/ipfs/boxo/ipld/merkledag" - dstest "github.com/ipfs/boxo/ipld/merkledag/test" - unixfile "github.com/ipfs/boxo/ipld/unixfs/file" - "github.com/ipfs/go-cid" - ipldcbor "github.com/ipfs/go-ipld-cbor" - ipld "github.com/ipfs/go-ipld-format" - "github.com/ipld/go-car" - _ "github.com/ipld/go-ipld-prime/codec/dagcbor" - "github.com/stretchr/testify/require" - "golang.org/x/sync/errgroup" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/types" - sealing "github.com/filecoin-project/lotus/storage/pipeline" -) - -type DealHarness struct { - t *testing.T - client *TestFullNode - main *TestMiner - market *TestMiner -} - -type MakeFullDealParams struct { - Rseed int - FastRet bool - StartEpoch abi.ChainEpoch - UseCARFileForStorageDeal bool - - // SuspendUntilCryptoeconStable suspends deal-making, until cryptoecon - // parameters are stabilised. This affects projected collateral, and tests - // will fail in network version 13 and higher if deals are started too soon - // after network birth. - // - // The reason is that the formula for collateral calculation takes - // circulating supply into account: - // - // [portion of power this deal will be] * [~1% of tokens]. - // - // In the first epochs after genesis, the total circulating supply is - // changing dramatically in percentual terms. Therefore, if the deal is - // proposed too soon, by the time it gets published on chain, the quoted - // provider collateral will no longer be valid. - // - // The observation is that deals fail with: - // - // GasEstimateMessageGas error: estimating gas used: message execution - // failed: exit 16, reason: Provider collateral out of bounds. (RetCode=16) - // - // Enabling this will suspend deal-making until the network has reached a - // height of 300. - SuspendUntilCryptoeconStable bool -} - -// NewDealHarness creates a test harness that contains testing utilities for deals. -func NewDealHarness(t *testing.T, client *TestFullNode, main *TestMiner, market *TestMiner) *DealHarness { - return &DealHarness{ - t: t, - client: client, - main: main, - market: market, - } -} - -// MakeOnlineDeal makes an online deal, generating a random file with the -// supplied seed, and setting the specified fast retrieval flag and start epoch -// on the storage deal. It returns when the deal is sealed. -// -// TODO: convert input parameters to struct, and add size as an input param. -func (dh *DealHarness) MakeOnlineDeal(ctx context.Context, params MakeFullDealParams) (deal *cid.Cid, res *api.ImportRes, path string) { - deal, res, path = dh.StartRandomDeal(ctx, params) - - fmt.Printf("WAIT DEAL SEALEDS START\n") - dh.WaitDealSealed(ctx, deal, false, false, nil) - fmt.Printf("WAIT DEAL SEALEDS END\n") - return deal, res, path -} - -func (dh *DealHarness) StartRandomDeal(ctx context.Context, params MakeFullDealParams) (deal *cid.Cid, res *api.ImportRes, path string) { - if params.UseCARFileForStorageDeal { - res, _, path = dh.client.ClientImportCARFile(ctx, params.Rseed, 200) - } else { - res, path = dh.client.CreateImportFile(ctx, params.Rseed, 0) - } - - dh.t.Logf("FILE CID: %s", res.Root) - - if params.SuspendUntilCryptoeconStable { - dh.t.Logf("deal-making suspending until cryptecon parameters have stabilised") - ts := dh.client.WaitTillChain(ctx, HeightAtLeast(300)) - dh.t.Logf("deal-making continuing; current height is %d", ts.Height()) - } - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.DealStartEpoch = params.StartEpoch - dp.FastRetrieval = params.FastRet - deal = dh.StartDeal(ctx, dp) - - return deal, res, path -} - -func (dh *DealHarness) DefaultStartDealParams() api.StartDealParams { - dp := api.StartDealParams{ - Data: &storagemarket.DataRef{TransferType: storagemarket.TTGraphsync}, - EpochPrice: types.NewInt(1000000), - MinBlocksDuration: uint64(build.MinDealDuration), - } - - var err error - dp.Miner, err = dh.main.ActorAddress(context.Background()) - require.NoError(dh.t, err) - - dp.Wallet, err = dh.client.WalletDefaultAddress(context.Background()) - require.NoError(dh.t, err) - - return dp -} - -// StartDeal starts a storage deal between the client and the miner. -func (dh *DealHarness) StartDeal(ctx context.Context, dealParams api.StartDealParams) *cid.Cid { - dealProposalCid, err := dh.client.ClientStartDeal(ctx, &dealParams) - require.NoError(dh.t, err) - return dealProposalCid -} - -// WaitDealSealed waits until the deal is sealed. -func (dh *DealHarness) WaitDealSealed(ctx context.Context, deal *cid.Cid, noseal, noSealStart bool, cb func()) { -loop: - for { - di, err := dh.client.ClientGetDealInfo(ctx, *deal) - require.NoError(dh.t, err) - - switch di.State { - case storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing: - if noseal { - return - } - if !noSealStart { - dh.StartSealingWaiting(ctx) - } - case storagemarket.StorageDealProposalRejected: - dh.t.Fatal("deal rejected") - case storagemarket.StorageDealFailing: - dh.t.Fatal("deal failed") - case storagemarket.StorageDealError: - dh.t.Fatal("deal errored", di.Message) - case storagemarket.StorageDealActive: - dh.t.Log("COMPLETE", di) - break loop - } - - mds, err := dh.market.MarketListIncompleteDeals(ctx) - require.NoError(dh.t, err) - - var minerState storagemarket.StorageDealStatus - for _, md := range mds { - if md.DealID == di.DealID { - minerState = md.State - break - } - } - - dh.t.Logf("Deal %d state: client:%s provider:%s\n", di.DealID, storagemarket.DealStates[di.State], storagemarket.DealStates[minerState]) - time.Sleep(time.Second / 2) - if cb != nil { - cb() - } - } - fmt.Printf("WAIT DEAL SEALED LOOP BROKEN\n") -} - -// WaitDealSealedQuiet waits until the deal is sealed, without logging anything. -func (dh *DealHarness) WaitDealSealedQuiet(ctx context.Context, deal *cid.Cid, noseal, noSealStart bool, cb func()) { -loop: - for { - di, err := dh.client.ClientGetDealInfo(ctx, *deal) - require.NoError(dh.t, err) - - switch di.State { - case storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing: - if noseal { - return - } - if !noSealStart { - dh.StartSealingWaiting(ctx) - } - case storagemarket.StorageDealProposalRejected: - dh.t.Fatal("deal rejected") - case storagemarket.StorageDealFailing: - dh.t.Fatal("deal failed") - case storagemarket.StorageDealError: - dh.t.Fatal("deal errored", di.Message) - case storagemarket.StorageDealActive: - break loop - } - - _, err = dh.market.MarketListIncompleteDeals(ctx) - require.NoError(dh.t, err) - - time.Sleep(time.Second / 2) - if cb != nil { - cb() - } - } -} - -func (dh *DealHarness) ExpectDealFailure(ctx context.Context, deal *cid.Cid, errs string) error { - for { - di, err := dh.client.ClientGetDealInfo(ctx, *deal) - require.NoError(dh.t, err) - - switch di.State { - case storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing: - return fmt.Errorf("deal is sealing, and we expected an error: %s", errs) - case storagemarket.StorageDealProposalRejected: - if strings.Contains(di.Message, errs) { - return nil - } - return fmt.Errorf("unexpected error: %s ; expected: %s", di.Message, errs) - case storagemarket.StorageDealFailing: - if strings.Contains(di.Message, errs) { - return nil - } - return fmt.Errorf("unexpected error: %s ; expected: %s", di.Message, errs) - case storagemarket.StorageDealError: - if strings.Contains(di.Message, errs) { - return nil - } - return fmt.Errorf("unexpected error: %s ; expected: %s", di.Message, errs) - case storagemarket.StorageDealActive: - return errors.New("expected to get an error, but didn't get one") - } - - mds, err := dh.market.MarketListIncompleteDeals(ctx) - require.NoError(dh.t, err) - - var minerState storagemarket.StorageDealStatus - for _, md := range mds { - if md.DealID == di.DealID { - minerState = md.State - break - } - } - - dh.t.Logf("Deal %d state: client:%s provider:%s\n", di.DealID, storagemarket.DealStates[di.State], storagemarket.DealStates[minerState]) - time.Sleep(time.Second / 2) - } -} - -// WaitDealPublished waits until the deal is published. -func (dh *DealHarness) WaitDealPublished(ctx context.Context, deal *cid.Cid) { - subCtx, cancel := context.WithCancel(ctx) - defer cancel() - - updates, err := dh.market.MarketGetDealUpdates(subCtx) - require.NoError(dh.t, err) - - for { - select { - case <-ctx.Done(): - dh.t.Fatal("context timeout") - case di := <-updates: - if deal.Equals(di.ProposalCid) { - switch di.State { - case storagemarket.StorageDealProposalRejected: - dh.t.Fatal("deal rejected") - case storagemarket.StorageDealFailing: - dh.t.Fatal("deal failed") - case storagemarket.StorageDealError: - dh.t.Fatal("deal errored", di.Message) - case storagemarket.StorageDealFinalizing, storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing, storagemarket.StorageDealActive: - dh.t.Log("COMPLETE", di) - return - } - dh.t.Log("Deal state: ", storagemarket.DealStates[di.State]) - } - } - } -} - -func (dh *DealHarness) StartSealingWaiting(ctx context.Context) { - snums, err := dh.main.SectorsListNonGenesis(ctx) - require.NoError(dh.t, err) - for _, snum := range snums { - si, err := dh.main.SectorsStatus(ctx, snum, false) - require.NoError(dh.t, err) - - dh.t.Logf("Sector state <%d>-[%d]:, %s", snum, si.SealProof, si.State) - if si.State == api.SectorState(sealing.WaitDeals) { - require.NoError(dh.t, dh.main.SectorStartSealing(ctx, snum)) - } - - dh.main.FlushSealingBatches(ctx) - } -} - -func (dh *DealHarness) PerformRetrieval(ctx context.Context, deal *cid.Cid, root cid.Cid, carExport bool, offers ...api.QueryOffer) (path string) { - return dh.PerformRetrievalWithOrder(ctx, deal, root, carExport, func(offer api.QueryOffer, a address.Address) api.RetrievalOrder { - return offer.Order(a) - }, offers...) -} - -func (dh *DealHarness) PerformRetrievalWithOrder(ctx context.Context, deal *cid.Cid, root cid.Cid, carExport bool, makeOrder func(api.QueryOffer, address.Address) api.RetrievalOrder, offers ...api.QueryOffer) (path string) { - var offer api.QueryOffer - if len(offers) == 0 { - // perform retrieval. - info, err := dh.client.ClientGetDealInfo(ctx, *deal) - require.NoError(dh.t, err) - - offers, err := dh.client.ClientFindData(ctx, root, &info.PieceCID) - require.NoError(dh.t, err) - require.NotEmpty(dh.t, offers, "no offers") - offer = offers[0] - } else { - offer = offers[0] - } - - carFile := dh.t.TempDir() + string(os.PathSeparator) + "ret-car-" + root.String() - - caddr, err := dh.client.WalletDefaultAddress(ctx) - require.NoError(dh.t, err) - - updatesCtx, cancel := context.WithCancel(ctx) - updates, err := dh.client.ClientGetRetrievalUpdates(updatesCtx) - require.NoError(dh.t, err) - - order := makeOrder(offer, caddr) - - retrievalRes, err := dh.client.ClientRetrieve(ctx, order) - require.NoError(dh.t, err) -consumeEvents: - for { - var evt api.RetrievalInfo - select { - case <-updatesCtx.Done(): - dh.t.Fatal("Retrieval Timed Out") - case evt = <-updates: - if evt.ID != retrievalRes.DealID { - continue - } - } - switch evt.Status { - case retrievalmarket.DealStatusCompleted: - break consumeEvents - case retrievalmarket.DealStatusRejected: - dh.t.Fatalf("Retrieval Proposal Rejected: %s", evt.Message) - case - retrievalmarket.DealStatusDealNotFound, - retrievalmarket.DealStatusErrored: - dh.t.Fatalf("Retrieval Error: %s", evt.Message) - } - } - cancel() - - if order.RemoteStore != nil { - // if we're retrieving into a remote store, skip export - return "" - } - - require.NoError(dh.t, dh.client.ClientExport(ctx, - api.ExportRef{ - Root: root, - DealID: retrievalRes.DealID, - }, - api.FileRef{ - Path: carFile, - IsCAR: carExport, - })) - - ret := carFile - - return ret -} - -func (dh *DealHarness) ExtractFileFromCAR(ctx context.Context, file *os.File) string { - bserv := dstest.Bserv() - ch, err := car.LoadCar(ctx, bserv.Blockstore(), file) - require.NoError(dh.t, err) - - blk, err := bserv.GetBlock(ctx, ch.Roots[0]) - require.NoError(dh.t, err) - - reg := ipld.Registry{} - reg.Register(cid.DagProtobuf, dag.DecodeProtobufBlock) - reg.Register(cid.DagCBOR, ipldcbor.DecodeBlock) - reg.Register(cid.Raw, dag.DecodeRawBlock) - - nd, err := reg.Decode(blk) - require.NoError(dh.t, err) - - dserv := dag.NewDAGService(bserv) - - fil, err := unixfile.NewUnixfsFile(ctx, dserv, nd) - require.NoError(dh.t, err) - - tmpfile := dh.t.TempDir() + string(os.PathSeparator) + "file-in-car" + nd.Cid().String() - - err = files.WriteTo(fil, tmpfile) - require.NoError(dh.t, err) - - return tmpfile -} - -type RunConcurrentDealsOpts struct { - N int - FastRetrieval bool - CarExport bool - StartEpoch abi.ChainEpoch - UseCARFileForStorageDeal bool - IndexProvider *shared_testutil.MockIndexProvider -} - -func (dh *DealHarness) RunConcurrentDeals(opts RunConcurrentDealsOpts) { - ctx := context.Background() - errgrp, _ := errgroup.WithContext(context.Background()) - for i := 0; i < opts.N; i++ { - i := i - errgrp.Go(func() (err error) { - defer dh.t.Logf("finished concurrent deal %d/%d", i, opts.N) - defer func() { - // This is necessary because golang can't deal with test - // failures being reported from children goroutines ¯\_(ツ)_/¯ - if r := recover(); r != nil { - err = fmt.Errorf("deal failed: %s", r) - } - }() - - dh.t.Logf("making storage deal %d/%d", i, opts.N) - - deal, res, inPath := dh.MakeOnlineDeal(context.Background(), MakeFullDealParams{ - Rseed: 5 + i, - FastRet: opts.FastRetrieval, - StartEpoch: opts.StartEpoch, - UseCARFileForStorageDeal: opts.UseCARFileForStorageDeal, - }) - - // Check that the storage provider announced the deal to indexers - if opts.IndexProvider != nil { - notifs := opts.IndexProvider.GetNotifs() - _, ok := notifs[string(deal.Bytes())] - require.True(dh.t, ok) - } - - dh.t.Logf("retrieving deal %d/%d", i, opts.N) - - outPath := dh.PerformRetrieval(context.Background(), deal, res.Root, opts.CarExport) - - if opts.CarExport { - f, err := os.Open(outPath) - require.NoError(dh.t, err) - actualFile := dh.ExtractFileFromCAR(ctx, f) - require.NoError(dh.t, f.Close()) - - AssertFilesEqual(dh.t, inPath, actualFile) - } else { - AssertFilesEqual(dh.t, inPath, outPath) - } - - return nil - }) - } - require.NoError(dh.t, errgrp.Wait()) -} diff --git a/itests/kit/node_full.go b/itests/kit/node_full.go index d44d691dd35..abcd8aea43f 100644 --- a/itests/kit/node_full.go +++ b/itests/kit/node_full.go @@ -86,22 +86,6 @@ func (f TestFullNode) Shutdown(ctx context.Context) error { return f.Stop(ctx) } -func (f *TestFullNode) ClientImportCARFile(ctx context.Context, rseed int, size int) (res *api.ImportRes, carv1FilePath string, origFilePath string) { - carv1FilePath, origFilePath = CreateRandomCARv1(f.t, rseed, size) - res, err := f.ClientImport(ctx, api.FileRef{Path: carv1FilePath, IsCAR: true}) - require.NoError(f.t, err) - return res, carv1FilePath, origFilePath -} - -// CreateImportFile creates a random file with the specified seed and size, and -// imports it into the full node. -func (f *TestFullNode) CreateImportFile(ctx context.Context, rseed int, size int) (res *api.ImportRes, path string) { - path = CreateRandomFile(f.t, rseed, size) - res, err := f.ClientImport(ctx, api.FileRef{Path: path}) - require.NoError(f.t, err) - return res, path -} - // WaitTillChain waits until a specified chain condition is met. It returns // the first tipset where the condition is met. func (f *TestFullNode) WaitTillChain(ctx context.Context, pred ChainPredicate) *types.TipSet { diff --git a/itests/path_type_filters_test.go b/itests/path_type_filters_test.go deleted file mode 100644 index a2e2049323b..00000000000 --- a/itests/path_type_filters_test.go +++ /dev/null @@ -1,200 +0,0 @@ -package itests - -import ( - "context" - "strings" - "testing" - "time" - - logging "github.com/ipfs/go-log/v2" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/storage/sealer/sealtasks" - "github.com/filecoin-project/lotus/storage/sealer/storiface" -) - -func TestPathTypeFilters(t *testing.T) { - kit.QuietMiningLogs() - - runTest := func(t *testing.T, name string, asserts func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func())) { - t.Run(name, func(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - _ = logging.SetLogLevel("storageminer", "INFO") - - var ( - client kit.TestFullNode - miner kit.TestMiner - wiw, wdw kit.TestWorker - ) - ens := kit.NewEnsemble(t, kit.LatestActorsAt(-1)). - FullNode(&client, kit.ThroughRPC()). - Miner(&miner, &client, kit.WithAllSubsystems(), kit.ThroughRPC(), kit.PresealSectors(2), kit.NoStorage()). - Worker(&miner, &wiw, kit.ThroughRPC(), kit.NoStorage(), kit.WithTaskTypes([]sealtasks.TaskType{sealtasks.TTGenerateWinningPoSt})). - Worker(&miner, &wdw, kit.ThroughRPC(), kit.NoStorage(), kit.WithTaskTypes([]sealtasks.TaskType{sealtasks.TTGenerateWindowPoSt})). - Start() - - ens.InterconnectAll().BeginMiningMustPost(2 * time.Millisecond) - - asserts(t, ctx, &miner, func() { - dh := kit.NewDealHarness(t, &client, &miner, &miner) - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1}) - }) - }) - } - - runTest(t, "invalid-type-alert", func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func()) { - slU := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanSeal = true - meta.AllowTypes = []string{"unsealed", "seeled"} - }) - - storlist, err := miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist, 2) // 1 path we've added + preseal - - si, err := miner.StorageInfo(ctx, slU) - require.NoError(t, err) - - // check that bad entries are filtered - require.Len(t, si.DenyTypes, 0) - require.Len(t, si.AllowTypes, 1) - require.Equal(t, "unsealed", si.AllowTypes[0]) - - as, err := miner.LogAlerts(ctx) - require.NoError(t, err) - - var found bool - for _, a := range as { - if a.Active && a.Type.System == "sector-index" && strings.HasPrefix(a.Type.Subsystem, "pathconf-") { - require.False(t, found) - require.Contains(t, string(a.LastActive.Message), "unknown sector file type 'seeled'") - found = true - } - } - require.True(t, found) - }) - - runTest(t, "seal-to-stor-unseal-allowdeny", func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func()) { - // allow all types in the sealing path - sealScratch := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanSeal = true - }) - - // unsealed storage - unsStor := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.AllowTypes = []string{"unsealed"} - }) - - // other storage - sealStor := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.DenyTypes = []string{"unsealed"} - }) - - storlist, err := miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist, 4) // 3 paths we've added + preseal - - run() - - storlist, err = miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist[sealScratch], 0) - require.Len(t, storlist[unsStor], 1) - require.Len(t, storlist[sealStor], 1) - - require.Equal(t, storiface.FTUnsealed, storlist[unsStor][0].SectorFileType) - require.Equal(t, storiface.FTSealed|storiface.FTCache, storlist[sealStor][0].SectorFileType) - }) - - runTest(t, "sealstor-unseal-allowdeny", func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func()) { - // unsealed storage - unsStor := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.CanSeal = true - meta.AllowTypes = []string{"unsealed"} - }) - - // other storage - sealStor := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.CanSeal = true - meta.DenyTypes = []string{"unsealed"} - }) - - storlist, err := miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist, 3) // 2 paths we've added + preseal - - run() - - storlist, err = miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist[unsStor], 1) - require.Len(t, storlist[sealStor], 1) - - require.Equal(t, storiface.FTUnsealed, storlist[unsStor][0].SectorFileType) - require.Equal(t, storiface.FTSealed|storiface.FTCache, storlist[sealStor][0].SectorFileType) - }) - - runTest(t, "seal-store-allseparate", func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func()) { - // sealing stores - slU := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanSeal = true - meta.AllowTypes = []string{"unsealed"} - }) - slS := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanSeal = true - meta.AllowTypes = []string{"sealed"} - }) - slC := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanSeal = true - meta.AllowTypes = []string{"cache"} - }) - - // storage stores - stU := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.AllowTypes = []string{"unsealed"} - }) - stS := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.AllowTypes = []string{"sealed"} - }) - stC := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.AllowTypes = []string{"cache"} - }) - - storlist, err := miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist, 7) // 6 paths we've added + preseal - - run() - - storlist, err = miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist[slU], 0) - require.Len(t, storlist[slS], 0) - require.Len(t, storlist[slC], 0) - - require.Len(t, storlist[stU], 1) - require.Len(t, storlist[stS], 1) - require.Len(t, storlist[stC], 1) - - require.Equal(t, storiface.FTUnsealed, storlist[stU][0].SectorFileType) - require.Equal(t, storiface.FTSealed, storlist[stS][0].SectorFileType) - require.Equal(t, storiface.FTCache, storlist[stC][0].SectorFileType) - }) -} diff --git a/itests/sector_finalize_early_test.go b/itests/sector_finalize_early_test.go deleted file mode 100644 index 1b8fcb346f9..00000000000 --- a/itests/sector_finalize_early_test.go +++ /dev/null @@ -1,72 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/storage/sealer/storiface" -) - -func TestDealsWithFinalizeEarly(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @STORAGE_INFO_001 - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - var blockTime = 50 * time.Millisecond - - // We use two miners so that in case the actively tested miner misses PoSt, we still have a blockchain - client, miner, poster, ens := kit.EnsembleOneTwo(t, kit.ThroughRPC(), kit.MutateSealingConfig(func(sc *config.SealingConfig) { sc.FinalizeEarly = true })) // no mock proofs. - ens.InterconnectAll().BeginMiningMustPost(blockTime, poster) - dh := kit.NewDealHarness(t, client, miner, miner) - - ctx := context.Background() - - miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.Weight = 1000000000 - meta.CanSeal = true - }) - miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.Weight = 1000000000 - meta.CanStore = true - }) - - //stm: @STORAGE_LIST_001 - sl, err := miner.StorageList(ctx) - require.NoError(t, err) - for si, d := range sl { - i, err := miner.StorageInfo(ctx, si) - require.NoError(t, err) - - fmt.Printf("stor d:%d %+v\n", len(d), i) - } - - t.Run("single", func(t *testing.T) { - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1}) - }) - - //stm: @STORAGE_LIST_001 - sl, err = miner.StorageList(ctx) - require.NoError(t, err) - for si, d := range sl { - i, err := miner.StorageInfo(ctx, si) - require.NoError(t, err) - - fmt.Printf("stor d:%d %+v\n", len(d), i) - } -} diff --git a/itests/worker_test.go b/itests/worker_test.go index 31ec40b5937..b3b8edd7632 100644 --- a/itests/worker_test.go +++ b/itests/worker_test.go @@ -585,82 +585,3 @@ waitForProof: require.NoError(t, params.UnmarshalCBOR(bytes.NewBuffer(slmsg.Params))) require.Equal(t, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, params.Proofs[0].PoStProof) } - -func TestWorkerPledgeExpireCommit(t *testing.T) { - kit.QuietMiningLogs() - _ = logging.SetLogLevel("sectors", "debug") - - var tasksNoC2 = kit.WithTaskTypes([]sealtasks.TaskType{sealtasks.TTAddPiece, sealtasks.TTDataCid, sealtasks.TTPreCommit1, sealtasks.TTPreCommit2, sealtasks.TTCommit2, - sealtasks.TTUnseal, sealtasks.TTFetch, sealtasks.TTCommit1, sealtasks.TTFinalize, sealtasks.TTFinalizeUnsealed}) - - fc := config.DefaultStorageMiner().Fees - fc.MaxCommitGasFee = types.FIL(abi.NewTokenAmount(10000)) // 10000 attofil, way too low for anything to land - - ctx := context.Background() - client, miner, worker, ens := kit.EnsembleWorker(t, kit.WithAllSubsystems(), kit.ThroughRPC(), kit.WithNoLocalSealing(true), - kit.MutateSealingConfig(func(sc *config.SealingConfig) { - sc.AggregateCommits = true - }), - kit.ConstructorOpts( - node.Override(new(*sealing.Sealing), modules.SealingPipeline(fc)), - ), - kit.SplitstoreDisable(), // disable splitstore because messages which take a long time may get dropped - tasksNoC2) // no mock proofs - - ens.InterconnectAll().BeginMiningMustPost(2 * time.Millisecond) - - e, err := worker.Enabled(ctx) - require.NoError(t, err) - require.True(t, e) - - dh := kit.NewDealHarness(t, client, miner, miner) - - startEpoch := abi.ChainEpoch(4 << 10) - - dh.StartRandomDeal(ctx, kit.MakeFullDealParams{ - Rseed: 7, - StartEpoch: startEpoch, - }) - - var sn abi.SectorNumber - - require.Eventually(t, func() bool { - s, err := miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - if len(s) == 0 { - return false - } - if len(s) > 1 { - t.Fatalf("expected 1 sector, got %d", len(s)) - } - sn = s[0] - return true - }, 30*time.Second, 1*time.Second) - - t.Log("sector", sn) - - t.Log("sector committing") - - // wait until after startEpoch - client.WaitTillChain(ctx, kit.HeightAtLeast(startEpoch+20)) - - t.Log("after start") - - sstate, err := miner.SectorsStatus(ctx, sn, false) - require.NoError(t, err) - require.Equal(t, api.SectorState(sealing.SubmitCommitAggregate), sstate.State) - - _, err = miner.SectorCommitFlush(ctx) - require.NoError(t, err) - - require.Eventually(t, func() bool { - sstate, err := miner.SectorsStatus(ctx, sn, false) - require.NoError(t, err) - - t.Logf("sector state: %s", sstate.State) - - return sstate.State == api.SectorState(sealing.Removed) - }, 30*time.Second, 1*time.Second) - - t.Log("sector removed") -} diff --git a/itests/worker_upgrade_test.go b/itests/worker_upgrade_test.go deleted file mode 100644 index b253a26a577..00000000000 --- a/itests/worker_upgrade_test.go +++ /dev/null @@ -1,170 +0,0 @@ -package itests - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/node/config" - sealing "github.com/filecoin-project/lotus/storage/pipeline" - "github.com/filecoin-project/lotus/storage/sealer/sealtasks" - "github.com/filecoin-project/lotus/storage/sealer/storiface" -) - -func TestWorkerUpgradeAbortCleanup(t *testing.T) { - ctx := context.Background() - blockTime := 1 * time.Millisecond - kit.QuietMiningLogs() - - client, miner, ens := kit.EnsembleMinimal(t, kit.WithAllSubsystems(), kit.ThroughRPC(), kit.WithNoLocalSealing(true), - kit.NoStorage(), // no storage to have better control over path settings - kit.MutateSealingConfig(func(sc *config.SealingConfig) { sc.FinalizeEarly = true })) // no mock proofs - - var worker kit.TestWorker - ens.Worker(miner, &worker, kit.ThroughRPC(), kit.NoStorage(), // no storage to have better control over path settings - kit.WithTaskTypes([]sealtasks.TaskType{ - sealtasks.TTFetch, sealtasks.TTAddPiece, - sealtasks.TTCommit1, sealtasks.TTFinalize, sealtasks.TTFinalizeUnsealed, sealtasks.TTPreCommit1, sealtasks.TTPreCommit2, sealtasks.TTCommit2, - sealtasks.TTReplicaUpdate, // only first update step, later steps will not run and we'll abort - }), - ) - - ens.Start().InterconnectAll().BeginMiningMustPost(blockTime) - - maddr, err := miner.ActorAddress(ctx) - if err != nil { - t.Fatal(err) - } - - // get storage paths - - // store-only path on the miner - miner.AddStorage(ctx, t, func(cfg *storiface.LocalStorageMeta) { - cfg.CanSeal = false - cfg.CanStore = true - }) - - mlocal, err := miner.StorageLocal(ctx) - require.NoError(t, err) - require.Len(t, mlocal, 2) // genesis and one local - - // we want a seal-only path on the worker disconnected from miner path - worker.AddStorage(ctx, t, func(cfg *storiface.LocalStorageMeta) { - cfg.CanSeal = true - cfg.CanStore = false - }) - - wpaths, err := worker.Paths(ctx) - require.NoError(t, err) - require.Len(t, wpaths, 1) - - // check sectors in paths - checkSectors := func(miners, workers storiface.SectorFileType) { - paths, err := miner.StorageList(ctx) - require.NoError(t, err) - require.Len(t, paths, 3) // genesis, miner, worker - - // first loop for debugging - for id, decls := range paths { - pinfo, err := miner.StorageInfo(ctx, id) - require.NoError(t, err) - - switch { - case id == wpaths[0].ID: // worker path - fmt.Println("Worker Decls ", len(decls), decls) - case !pinfo.CanStore && !pinfo.CanSeal: // genesis path - fmt.Println("Genesis Decls ", len(decls), decls) - default: // miner path - fmt.Println("Miner Decls ", len(decls), decls) - } - } - - for id, decls := range paths { - pinfo, err := miner.StorageInfo(ctx, id) - require.NoError(t, err) - - switch { - case id == wpaths[0].ID: // worker path - if workers != storiface.FTNone { - require.Len(t, decls, 1) - require.EqualValues(t, workers.Strings(), decls[0].SectorFileType.Strings()) - } else { - require.Len(t, decls, 0) - } - case !pinfo.CanStore && !pinfo.CanSeal: // genesis path - require.Len(t, decls, kit.DefaultPresealsPerBootstrapMiner) - default: // miner path - if miners != storiface.FTNone { - require.Len(t, decls, 1) - require.EqualValues(t, miners.Strings(), decls[0].SectorFileType.Strings()) - } else { - require.Len(t, decls, 0) - } - } - } - } - checkSectors(storiface.FTNone, storiface.FTNone) - - // get a sector for upgrading - miner.PledgeSectors(ctx, 1, 0, nil) - sl, err := miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - require.Len(t, sl, 1, "expected 1 sector") - - snum := sl[0] - - checkSectors(storiface.FTCache|storiface.FTSealed, storiface.FTNone) - - client.WaitForSectorActive(ctx, t, snum, maddr) - - // make available - err = miner.SectorMarkForUpgrade(ctx, snum, true) - require.NoError(t, err) - - // Start a deal - - dh := kit.NewDealHarness(t, client, miner, miner) - res, _ := client.CreateImportFile(ctx, 123, 0) - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - deal := dh.StartDeal(ctx, dp) - - // wait for the deal to be in a sector - dh.WaitDealSealed(ctx, deal, true, false, nil) - - // wait for replica update to happen - require.Eventually(t, func() bool { - sstate, err := miner.SectorsStatus(ctx, snum, false) - require.NoError(t, err) - return sstate.State == api.SectorState(sealing.ProveReplicaUpdate) - }, 10*time.Second, 50*time.Millisecond) - - // check that the sector was copied to the worker - checkSectors(storiface.FTCache|storiface.FTSealed, storiface.FTCache|storiface.FTSealed|storiface.FTUnsealed|storiface.FTUpdate|storiface.FTUpdateCache) - - // abort upgrade - err = miner.SectorAbortUpgrade(ctx, snum) - require.NoError(t, err) - - // the task is stuck in scheduler, so manually abort the task to get the sector fsm moving - si := miner.SchedInfo(ctx) - err = miner.SealingRemoveRequest(ctx, si.SchedInfo.Requests[0].SchedId) - require.NoError(t, err) - - var lastState api.SectorState - require.Eventually(t, func() bool { - sstate, err := miner.SectorsStatus(ctx, snum, false) - require.NoError(t, err) - lastState = sstate.State - - return sstate.State == api.SectorState(sealing.Proving) - }, 10*time.Second, 50*time.Millisecond, "last state was %s", &lastState) - - // check that nothing was left on the worker - checkSectors(storiface.FTCache|storiface.FTSealed, storiface.FTNone) -} diff --git a/node/impl/client/car_helpers.go b/node/impl/client/car_helpers.go deleted file mode 100644 index c638b4bef81..00000000000 --- a/node/impl/client/car_helpers.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -import ( - "fmt" - "io" - - "github.com/ipfs/go-cid" - cbor "github.com/ipfs/go-ipld-cbor" - "github.com/ipld/go-car/util" - "github.com/multiformats/go-varint" -) - -// ————————————————————————————————————————————————————————— -// -// This code is temporary, and should be deleted when -// https://github.com/ipld/go-car/issues/196 is resolved. -// -// ————————————————————————————————————————————————————————— - -func init() { - cbor.RegisterCborType(CarHeader{}) -} - -type CarHeader struct { - Roots []cid.Cid - Version uint64 -} - -func readHeader(r io.Reader) (*CarHeader, error) { - hb, err := ldRead(r, false) - if err != nil { - return nil, err - } - - var ch CarHeader - if err := cbor.DecodeInto(hb, &ch); err != nil { - return nil, fmt.Errorf("invalid header: %v", err) - } - - return &ch, nil -} - -func writeHeader(h *CarHeader, w io.Writer) error { - hb, err := cbor.DumpObject(h) - if err != nil { - return err - } - - return util.LdWrite(w, hb) -} - -func ldRead(r io.Reader, zeroLenAsEOF bool) ([]byte, error) { - l, err := varint.ReadUvarint(toByteReader(r)) - if err != nil { - // If the length of bytes read is non-zero when the error is EOF then signal an unclean EOF. - if l > 0 && err == io.EOF { - return nil, io.ErrUnexpectedEOF - } - return nil, err - } else if l == 0 && zeroLenAsEOF { - return nil, io.EOF - } - - buf := make([]byte, l) - if _, err := io.ReadFull(r, buf); err != nil { - return nil, err - } - - return buf, nil -} - -type readerPlusByte struct { - io.Reader -} - -func (rb readerPlusByte) ReadByte() (byte, error) { - return readByte(rb) -} - -func readByte(r io.Reader) (byte, error) { - var p [1]byte - _, err := io.ReadFull(r, p[:]) - return p[0], err -} - -func toByteReader(r io.Reader) io.ByteReader { - if br, ok := r.(io.ByteReader); ok { - return br - } - return &readerPlusByte{r} -} diff --git a/node/impl/client/client.go b/node/impl/client/client.go deleted file mode 100644 index c7bb252a10a..00000000000 --- a/node/impl/client/client.go +++ /dev/null @@ -1,1536 +0,0 @@ -package client - -import ( - "bufio" - "bytes" - "context" - "errors" - "fmt" - "io" - "os" - "sort" - "strings" - "sync" - "time" - - "github.com/ipfs/boxo/blockservice" - bstore "github.com/ipfs/boxo/blockstore" - offline "github.com/ipfs/boxo/exchange/offline" - "github.com/ipfs/boxo/files" - "github.com/ipfs/boxo/ipld/merkledag" - unixfile "github.com/ipfs/boxo/ipld/unixfs/file" - "github.com/ipfs/go-cid" - format "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log/v2" - "github.com/ipld/go-car" - "github.com/ipld/go-car/util" - carv2 "github.com/ipld/go-car/v2" - carv2bs "github.com/ipld/go-car/v2/blockstore" - "github.com/ipld/go-ipld-prime" - "github.com/ipld/go-ipld-prime/datamodel" - cidlink "github.com/ipld/go-ipld-prime/linking/cid" - basicnode "github.com/ipld/go-ipld-prime/node/basic" - "github.com/ipld/go-ipld-prime/traversal" - "github.com/ipld/go-ipld-prime/traversal/selector" - "github.com/ipld/go-ipld-prime/traversal/selector/builder" - selectorparse "github.com/ipld/go-ipld-prime/traversal/selector/parse" - textselector "github.com/ipld/go-ipld-selector-text-lite" - "github.com/libp2p/go-libp2p/core/host" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/multiformats/go-multibase" - "go.uber.org/fx" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - cborutil "github.com/filecoin-project/go-cbor-util" - "github.com/filecoin-project/go-commp-utils/writer" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/discovery" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-fil-markets/storagemarket/network" - "github.com/filecoin-project/go-fil-markets/stores" - "github.com/filecoin-project/go-padreader" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" - "github.com/filecoin-project/go-state-types/dline" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/actors/builtin/miner" - "github.com/filecoin-project/lotus/chain/store" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/unixfs" - "github.com/filecoin-project/lotus/markets/retrievaladapter" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/markets/utils" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/impl/full" - "github.com/filecoin-project/lotus/node/impl/paych" - "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo" - "github.com/filecoin-project/lotus/node/repo/imports" -) - -var log = logging.Logger("client") - -var DefaultHashFunction = unixfs.DefaultHashFunction - -// 8 days ~= SealDuration + PreCommit + MaxProveCommitDuration + 8 hour buffer -const dealStartBufferHours uint64 = 8 * 24 -const DefaultDAGStoreDir = "dagstore" - -type API struct { - fx.In - - full.ChainAPI - full.WalletAPI - paych.PaychAPI - full.StateAPI - - SMDealClient storagemarket.StorageClient - RetDiscovery discovery.PeerResolver - Retrieval rm.RetrievalClient - Chain *store.ChainStore - - // accessors for imports and retrievals. - Imports dtypes.ClientImportMgr - StorageBlockstoreAccessor storagemarket.BlockstoreAccessor - RtvlBlockstoreAccessor rm.BlockstoreAccessor - ApiBlockstoreAccessor *retrievaladapter.APIBlockstoreAccessor - - DataTransfer dtypes.ClientDataTransfer - Host host.Host - - Repo repo.LockedRepo -} - -func calcDealExpiration(minDuration uint64, md *dline.Info, startEpoch abi.ChainEpoch) abi.ChainEpoch { - // Make sure we give some time for the miner to seal - minExp := startEpoch + abi.ChainEpoch(minDuration) - - // Align on miners ProvingPeriodBoundary - exp := minExp + md.WPoStProvingPeriod - (minExp % md.WPoStProvingPeriod) + (md.PeriodStart % md.WPoStProvingPeriod) - 1 - // Should only be possible for miners created around genesis - for exp < minExp { - exp += md.WPoStProvingPeriod - } - - return exp -} - -// importManager converts the injected type to the required type. -func (a *API) importManager() *imports.Manager { - return a.Imports -} - -func (a *API) ClientStartDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) { - return a.dealStarter(ctx, params, false) -} - -func (a *API) ClientStatelessDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) { - return a.dealStarter(ctx, params, true) -} - -func (a *API) dealStarter(ctx context.Context, params *api.StartDealParams, isStateless bool) (*cid.Cid, error) { - if isStateless { - if params.Data.TransferType != storagemarket.TTManual { - return nil, xerrors.Errorf("invalid transfer type %s for stateless storage deal", params.Data.TransferType) - } - if !params.EpochPrice.IsZero() { - return nil, xerrors.New("stateless storage deals can only be initiated with storage price of 0") - } - } else if params.Data.TransferType == storagemarket.TTGraphsync { - bs, onDone, err := a.dealBlockstore(params.Data.Root) - if err != nil { - return nil, xerrors.Errorf("failed to find blockstore for root CID: %w", err) - } - if has, err := bs.Has(ctx, params.Data.Root); err != nil { - return nil, xerrors.Errorf("failed to query blockstore for root CID: %w", err) - } else if !has { - return nil, xerrors.Errorf("failed to find root CID in blockstore: %w", err) - } - onDone() - } - - walletKey, err := a.StateAccountKey(ctx, params.Wallet, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed resolving params.Wallet addr (%s): %w", params.Wallet, err) - } - - exist, err := a.WalletHas(ctx, walletKey) - if err != nil { - return nil, xerrors.Errorf("failed getting addr from wallet (%s): %w", params.Wallet, err) - } - if !exist { - return nil, xerrors.Errorf("provided address doesn't exist in wallet") - } - - mi, err := a.StateMinerInfo(ctx, params.Miner, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed getting peer ID: %w", err) - } - - md, err := a.StateMinerProvingDeadline(ctx, params.Miner, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed getting miner's deadline info: %w", err) - } - - if uint64(params.Data.PieceSize.Padded()) > uint64(mi.SectorSize) { - return nil, xerrors.New("data doesn't fit in a sector") - } - - dealStart := params.DealStartEpoch - if dealStart <= 0 { // unset, or explicitly 'epoch undefined' - ts, err := a.ChainHead(ctx) - if err != nil { - return nil, xerrors.Errorf("failed getting chain height: %w", err) - } - - blocksPerHour := 60 * 60 / build.BlockDelaySecs - dealStart = ts.Height() + abi.ChainEpoch(dealStartBufferHours*blocksPerHour) // TODO: Get this from storage ask - } - - networkVersion, err := a.StateNetworkVersion(ctx, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed to get network version: %w", err) - } - - st, err := miner.PreferredSealProofTypeFromWindowPoStType(networkVersion, mi.WindowPoStProofType, false) - if err != nil { - return nil, xerrors.Errorf("failed to get seal proof type: %w", err) - } - - // regular flow - if !isStateless { - providerInfo := utils.NewStorageProviderInfo(params.Miner, mi.Worker, mi.SectorSize, *mi.PeerId, mi.Multiaddrs) - - result, err := a.SMDealClient.ProposeStorageDeal(ctx, storagemarket.ProposeStorageDealParams{ - Addr: params.Wallet, - Info: &providerInfo, - Data: params.Data, - StartEpoch: dealStart, - EndEpoch: calcDealExpiration(params.MinBlocksDuration, md, dealStart), - Price: params.EpochPrice, - Collateral: params.ProviderCollateral, - Rt: st, - FastRetrieval: params.FastRetrieval, - VerifiedDeal: params.VerifiedDeal, - }) - - if err != nil { - return nil, xerrors.Errorf("failed to start deal: %w", err) - } - - return &result.ProposalCid, nil - } - - // - // stateless flow from here to the end - // - - label, err := markettypes.NewLabelFromString(params.Data.Root.Encode(multibase.MustNewEncoder('u'))) - if err != nil { - return nil, xerrors.Errorf("failed to encode label: %w", err) - } - - dealProposal := &markettypes.DealProposal{ - PieceCID: *params.Data.PieceCid, - PieceSize: params.Data.PieceSize.Padded(), - Client: walletKey, - Provider: params.Miner, - Label: label, - StartEpoch: dealStart, - EndEpoch: calcDealExpiration(params.MinBlocksDuration, md, dealStart), - StoragePricePerEpoch: big.Zero(), - ProviderCollateral: params.ProviderCollateral, - ClientCollateral: big.Zero(), - VerifiedDeal: params.VerifiedDeal, - } - - if dealProposal.ProviderCollateral.IsZero() { - networkCollateral, err := a.StateDealProviderCollateralBounds(ctx, params.Data.PieceSize.Padded(), params.VerifiedDeal, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed to determine minimum provider collateral: %w", err) - } - dealProposal.ProviderCollateral = networkCollateral.Min - } - - dealProposalSerialized, err := cborutil.Dump(dealProposal) - if err != nil { - return nil, xerrors.Errorf("failed to serialize deal proposal: %w", err) - } - - dealProposalSig, err := a.WalletSign(ctx, walletKey, dealProposalSerialized) - if err != nil { - return nil, xerrors.Errorf("failed to sign proposal : %w", err) - } - - dealProposalSigned := &markettypes.ClientDealProposal{ - Proposal: *dealProposal, - ClientSignature: *dealProposalSig, - } - dStream, err := network.NewFromLibp2pHost(a.Host, - // params duplicated from .../node/modules/client.go - // https://github.com/filecoin-project/lotus/pull/5961#discussion_r629768011 - network.RetryParameters(time.Second, 5*time.Minute, 15, 5), - ).NewDealStream(ctx, *mi.PeerId) - if err != nil { - return nil, xerrors.Errorf("opening dealstream to %s/%s failed: %w", params.Miner, *mi.PeerId, err) - } - - if err = dStream.WriteDealProposal(network.Proposal{ - FastRetrieval: true, - DealProposal: dealProposalSigned, - Piece: &storagemarket.DataRef{ - TransferType: storagemarket.TTManual, - Root: params.Data.Root, - PieceCid: params.Data.PieceCid, - PieceSize: params.Data.PieceSize, - }, - }); err != nil { - return nil, xerrors.Errorf("sending deal proposal failed: %w", err) - } - - resp, _, err := dStream.ReadDealResponse() - if err != nil { - return nil, xerrors.Errorf("reading proposal response failed: %w", err) - } - - dealProposalIpld, err := cborutil.AsIpld(dealProposalSigned) - if err != nil { - return nil, xerrors.Errorf("serializing proposal node failed: %w", err) - } - - if !dealProposalIpld.Cid().Equals(resp.Response.Proposal) { - return nil, xerrors.Errorf("provider returned proposal cid %s but we expected %s", resp.Response.Proposal, dealProposalIpld.Cid()) - } - - if resp.Response.State != storagemarket.StorageDealWaitingForData { - return nil, xerrors.Errorf("provider returned unexpected state %d for proposal %s, with message: %s", resp.Response.State, resp.Response.Proposal, resp.Response.Message) - } - - return &resp.Response.Proposal, nil -} - -func (a *API) ClientListDeals(ctx context.Context) ([]api.DealInfo, error) { - deals, err := a.SMDealClient.ListLocalDeals(ctx) - if err != nil { - return nil, err - } - - // Get a map of transfer ID => DataTransfer - dataTransfersByID, err := a.transfersByID(ctx) - if err != nil { - return nil, err - } - - out := make([]api.DealInfo, len(deals)) - for k, v := range deals { - // Find the data transfer associated with this deal - var transferCh *api.DataTransferChannel - if v.TransferChannelID != nil { - if ch, ok := dataTransfersByID[*v.TransferChannelID]; ok { - transferCh = &ch - } - } - - out[k] = a.newDealInfoWithTransfer(transferCh, v) - } - - return out, nil -} - -func (a *API) transfersByID(ctx context.Context) (map[datatransfer.ChannelID]api.DataTransferChannel, error) { - inProgressChannels, err := a.DataTransfer.InProgressChannels(ctx) - if err != nil { - return nil, err - } - - dataTransfersByID := make(map[datatransfer.ChannelID]api.DataTransferChannel, len(inProgressChannels)) - for id, channelState := range inProgressChannels { - ch := api.NewDataTransferChannel(a.Host.ID(), channelState) - dataTransfersByID[id] = ch - } - return dataTransfersByID, nil -} - -func (a *API) ClientGetDealInfo(ctx context.Context, d cid.Cid) (*api.DealInfo, error) { - v, err := a.SMDealClient.GetLocalDeal(ctx, d) - if err != nil { - return nil, err - } - - di := a.newDealInfo(ctx, v) - return &di, nil -} - -func (a *API) ClientGetDealUpdates(ctx context.Context) (<-chan api.DealInfo, error) { - updates := make(chan api.DealInfo) - - unsub := a.SMDealClient.SubscribeToEvents(func(_ storagemarket.ClientEvent, deal storagemarket.ClientDeal) { - updates <- a.newDealInfo(ctx, deal) - }) - - go func() { - defer unsub() - <-ctx.Done() - }() - - return updates, nil -} - -func (a *API) newDealInfo(ctx context.Context, v storagemarket.ClientDeal) api.DealInfo { - // Find the data transfer associated with this deal - var transferCh *api.DataTransferChannel - if v.TransferChannelID != nil { - state, err := a.DataTransfer.ChannelState(ctx, *v.TransferChannelID) - - // Note: If there was an error just ignore it, as the data transfer may - // be not found if it's no longer active - if err == nil { - ch := api.NewDataTransferChannel(a.Host.ID(), state) - ch.Stages = state.Stages() - transferCh = &ch - } - } - - di := a.newDealInfoWithTransfer(transferCh, v) - di.DealStages = v.DealStages - return di -} - -func (a *API) newDealInfoWithTransfer(transferCh *api.DataTransferChannel, v storagemarket.ClientDeal) api.DealInfo { - return api.DealInfo{ - ProposalCid: v.ProposalCid, - DataRef: v.DataRef, - State: v.State, - Message: v.Message, - Provider: v.Proposal.Provider, - PieceCID: v.Proposal.PieceCID, - Size: uint64(v.Proposal.PieceSize.Unpadded()), - PricePerEpoch: v.Proposal.StoragePricePerEpoch, - Duration: uint64(v.Proposal.Duration()), - DealID: v.DealID, - CreationTime: v.CreationTime.Time(), - Verified: v.Proposal.VerifiedDeal, - TransferChannelID: v.TransferChannelID, - DataTransfer: transferCh, - } -} - -func (a *API) ClientHasLocal(_ context.Context, root cid.Cid) (bool, error) { - _, onDone, err := a.dealBlockstore(root) - if err != nil { - return false, err - } - onDone() - return true, nil -} - -func (a *API) ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error) { - peers, err := a.RetDiscovery.GetPeers(root) - if err != nil { - return nil, err - } - - out := make([]api.QueryOffer, 0, len(peers)) - for _, p := range peers { - if piece != nil && !piece.Equals(*p.PieceCID) { - continue - } - - // do not rely on local data with respect to peer id - // fetch an up-to-date miner peer id from chain - mi, err := a.StateMinerInfo(ctx, p.Address, types.EmptyTSK) - if err != nil { - return nil, err - } - pp := rm.RetrievalPeer{ - Address: p.Address, - ID: *mi.PeerId, - } - - out = append(out, a.makeRetrievalQuery(ctx, pp, root, piece, rm.QueryParams{})) - } - - return out, nil -} - -func (a *API) ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) { - mi, err := a.StateMinerInfo(ctx, miner, types.EmptyTSK) - if err != nil { - return api.QueryOffer{}, err - } - rp := rm.RetrievalPeer{ - Address: miner, - ID: *mi.PeerId, - } - return a.makeRetrievalQuery(ctx, rp, root, piece, rm.QueryParams{}), nil -} - -func (a *API) makeRetrievalQuery(ctx context.Context, rp rm.RetrievalPeer, payload cid.Cid, piece *cid.Cid, qp rm.QueryParams) api.QueryOffer { - queryResponse, err := a.Retrieval.Query(ctx, rp, payload, qp) - if err != nil { - return api.QueryOffer{Err: err.Error(), Miner: rp.Address, MinerPeer: rp} - } - var errStr string - switch queryResponse.Status { - case rm.QueryResponseAvailable: - errStr = "" - case rm.QueryResponseUnavailable: - errStr = fmt.Sprintf("retrieval query offer was unavailable: %s", queryResponse.Message) - case rm.QueryResponseError: - errStr = fmt.Sprintf("retrieval query offer errored: %s", queryResponse.Message) - } - - return api.QueryOffer{ - Root: payload, - Piece: piece, - Size: queryResponse.Size, - MinPrice: queryResponse.PieceRetrievalPrice(), - UnsealPrice: queryResponse.UnsealPrice, - PricePerByte: queryResponse.MinPricePerByte, - PaymentInterval: queryResponse.MaxPaymentInterval, - PaymentIntervalIncrease: queryResponse.MaxPaymentIntervalIncrease, - Miner: queryResponse.PaymentAddress, // TODO: check - MinerPeer: rp, - Err: errStr, - } -} - -func (a *API) ClientImport(ctx context.Context, ref api.FileRef) (res *api.ImportRes, err error) { - var ( - imgr = a.importManager() - id imports.ID - root cid.Cid - carPath string - ) - - id, err = imgr.CreateImport() - if err != nil { - return nil, xerrors.Errorf("failed to create import: %w", err) - } - - if ref.IsCAR { - // user gave us a CAR file, use it as-is - // validate that it's either a carv1 or carv2, and has one root. - f, err := os.Open(ref.Path) - if err != nil { - return nil, xerrors.Errorf("failed to open CAR file: %w", err) - } - defer f.Close() //nolint:errcheck - - hd, err := car.ReadHeader(bufio.NewReader(f)) - if err != nil { - return nil, xerrors.Errorf("failed to read CAR header: %w", err) - } - if len(hd.Roots) != 1 { - return nil, xerrors.New("car file can have one and only one root") - } - if hd.Version != 1 && hd.Version != 2 { - return nil, xerrors.Errorf("car version must be 1 or 2, is %d", hd.Version) - } - - carPath = ref.Path - root = hd.Roots[0] - } else { - carPath, err = imgr.AllocateCAR(id) - if err != nil { - return nil, xerrors.Errorf("failed to create car path for import: %w", err) - } - - // remove the import if something went wrong. - defer func() { - if err != nil { - _ = os.Remove(carPath) - _ = imgr.Remove(id) - } - }() - - // perform the unixfs chunking. - root, err = unixfs.CreateFilestore(ctx, ref.Path, carPath) - if err != nil { - return nil, xerrors.Errorf("failed to import file using unixfs: %w", err) - } - } - - if err = imgr.AddLabel(id, imports.LSource, "import"); err != nil { - return nil, err - } - if err = imgr.AddLabel(id, imports.LFileName, ref.Path); err != nil { - return nil, err - } - if err = imgr.AddLabel(id, imports.LCARPath, carPath); err != nil { - return nil, err - } - if err = imgr.AddLabel(id, imports.LRootCid, root.String()); err != nil { - return nil, err - } - return &api.ImportRes{ - Root: root, - ImportID: id, - }, nil -} - -func (a *API) ClientRemoveImport(ctx context.Context, id imports.ID) error { - info, err := a.importManager().Info(id) - if err != nil { - return xerrors.Errorf("failed to get import metadata: %w", err) - } - - owner := info.Labels[imports.LCAROwner] - path := info.Labels[imports.LCARPath] - - // CARv2 file was not provided by the user, delete it. - if path != "" && owner == imports.CAROwnerImportMgr { - _ = os.Remove(path) - } - - return a.importManager().Remove(id) -} - -// ClientImportLocal imports a standard file into this node as a UnixFS payload, -// storing it in a CARv2 file. Note that this method is NOT integrated with the -// IPFS blockstore. That is, if client-side IPFS integration is enabled, this -// method won't import the file into that -func (a *API) ClientImportLocal(ctx context.Context, r io.Reader) (cid.Cid, error) { - file := files.NewReaderFile(r) - - // write payload to temp file - id, err := a.importManager().CreateImport() - if err != nil { - return cid.Undef, err - } - if err := a.importManager().AddLabel(id, imports.LSource, "import-local"); err != nil { - return cid.Undef, err - } - - path, err := a.importManager().AllocateCAR(id) - if err != nil { - return cid.Undef, err - } - - // writing a carv2 requires knowing the root ahead of time, which makes - // streaming cases impossible. - // https://github.com/ipld/go-car/issues/196 - // we work around this limitation by informing a placeholder root CID of the - // same length as our unixfs chunking strategy will generate. - // once the DAG is formed and the root is calculated, we overwrite the - // inner carv1 header with the final root. - - b, err := unixfs.CidBuilder() - if err != nil { - return cid.Undef, err - } - - // placeholder payload needs to be larger than inline CID threshold; 256 - // bytes is a safe value. - placeholderRoot, err := b.Sum(make([]byte, 256)) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to calculate placeholder root: %w", err) - } - - bs, err := carv2bs.OpenReadWrite(path, []cid.Cid{placeholderRoot}, carv2bs.UseWholeCIDs(true)) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to create carv2 read/write blockstore: %w", err) - } - - root, err := unixfs.Build(ctx, file, bs, false) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to build unixfs dag: %w", err) - } - - err = bs.Finalize() - if err != nil { - return cid.Undef, xerrors.Errorf("failed to finalize carv2 read/write blockstore: %w", err) - } - - // record the root in the import manager. - if err := a.importManager().AddLabel(id, imports.LRootCid, root.String()); err != nil { - return cid.Undef, xerrors.Errorf("failed to record root CID in import manager: %w", err) - } - - // now go ahead and overwrite the root in the carv1 header. - reader, err := carv2.OpenReader(path) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to create car reader: %w", err) - } - - // save the header offset. - headerOff := reader.Header.DataOffset - - // read the old header. - dr, err := reader.DataReader() - if err != nil { - return cid.Undef, fmt.Errorf("failed to get car data reader: %w", err) - } - header, err := readHeader(dr) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to read car reader: %w", err) - } - _ = reader.Close() // close the CAR reader. - - // write the old header into a buffer. - var oldBuf bytes.Buffer - if err = writeHeader(header, &oldBuf); err != nil { - return cid.Undef, xerrors.Errorf("failed to write header into buffer: %w", err) - } - - // replace the root. - header.Roots = []cid.Cid{root} - - // write the new header into a buffer. - var newBuf bytes.Buffer - err = writeHeader(header, &newBuf) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to write header into buffer: %w", err) - } - - // verify the length matches. - if newBuf.Len() != oldBuf.Len() { - return cid.Undef, xerrors.Errorf("failed to replace carv1 header; length mismatch (old: %d, new: %d)", oldBuf.Len(), newBuf.Len()) - } - - // open the file again, seek to the header position, and write. - f, err := os.OpenFile(path, os.O_WRONLY, 0755) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to open car: %w", err) - } - defer f.Close() //nolint:errcheck - - n, err := f.WriteAt(newBuf.Bytes(), int64(headerOff)) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to write new header to car (bytes written: %d): %w", n, err) - } - return root, nil -} - -func (a *API) ClientListImports(_ context.Context) ([]api.Import, error) { - ids, err := a.importManager().List() - if err != nil { - return nil, xerrors.Errorf("failed to fetch imports: %w", err) - } - - out := make([]api.Import, len(ids)) - for i, id := range ids { - info, err := a.importManager().Info(id) - if err != nil { - out[i] = api.Import{ - Key: id, - Err: xerrors.Errorf("getting info: %w", err).Error(), - } - continue - } - - ai := api.Import{ - Key: id, - Source: info.Labels[imports.LSource], - FilePath: info.Labels[imports.LFileName], - CARPath: info.Labels[imports.LCARPath], - } - - if info.Labels[imports.LRootCid] != "" { - c, err := cid.Parse(info.Labels[imports.LRootCid]) - if err != nil { - ai.Err = err.Error() - } else { - ai.Root = &c - } - } - - out[i] = ai - } - - return out, nil -} - -func (a *API) ClientCancelRetrievalDeal(ctx context.Context, dealID rm.DealID) error { - cerr := make(chan error) - go func() { - err := a.Retrieval.CancelDeal(dealID) - - select { - case cerr <- err: - case <-ctx.Done(): - } - }() - - select { - case err := <-cerr: - if err != nil { - return xerrors.Errorf("failed to cancel retrieval deal: %w", err) - } - - return nil - case <-ctx.Done(): - return xerrors.Errorf("context timeout while canceling retrieval deal: %w", ctx.Err()) - } -} - -func getDataSelector(dps *api.Selector, matchPath bool) (datamodel.Node, error) { - sel := selectorparse.CommonSelector_ExploreAllRecursively - if dps != nil { - - if strings.HasPrefix(string(*dps), "{") { - var err error - sel, err = selectorparse.ParseJSONSelector(string(*dps)) - if err != nil { - return nil, xerrors.Errorf("failed to parse json-selector '%s': %w", *dps, err) - } - } else { - ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any) - - selspec, err := textselector.SelectorSpecFromPath( - textselector.Expression(*dps), matchPath, - - ssb.ExploreRecursive( - selector.RecursionLimitNone(), - ssb.ExploreUnion(ssb.Matcher(), ssb.ExploreAll(ssb.ExploreRecursiveEdge())), - ), - ) - if err != nil { - return nil, xerrors.Errorf("failed to parse text-selector '%s': %w", *dps, err) - } - - sel = selspec.Node() - log.Infof("partial retrieval of datamodel-path-selector %s/*", *dps) - } - } - - return sel, nil -} - -func (a *API) ClientRetrieve(ctx context.Context, params api.RetrievalOrder) (*api.RestrievalRes, error) { - sel, err := getDataSelector(params.DataSelector, false) - if err != nil { - return nil, err - } - - di, err := a.doRetrieval(ctx, params, sel) - if err != nil { - return nil, err - } - - return &api.RestrievalRes{ - DealID: di, - }, nil -} - -func (a *API) doRetrieval(ctx context.Context, order api.RetrievalOrder, sel datamodel.Node) (rm.DealID, error) { - if order.MinerPeer == nil || order.MinerPeer.ID == "" { - mi, err := a.StateMinerInfo(ctx, order.Miner, types.EmptyTSK) - if err != nil { - return 0, err - } - - order.MinerPeer = &rm.RetrievalPeer{ - ID: *mi.PeerId, - Address: order.Miner, - } - } - - if order.Total.Int == nil { - return 0, xerrors.Errorf("cannot make retrieval deal for null total") - } - - if order.Size == 0 { - return 0, xerrors.Errorf("cannot make retrieval deal for zero bytes") - } - - ppb := types.BigDiv(big.Sub(order.Total, order.UnsealPrice), types.NewInt(order.Size)) - - params, err := rm.NewParamsV1(ppb, order.PaymentInterval, order.PaymentIntervalIncrease, sel, order.Piece, order.UnsealPrice) - if err != nil { - return 0, xerrors.Errorf("Error in retrieval params: %s", err) - } - - id := a.Retrieval.NextID() - - if order.RemoteStore != nil { - if err := a.ApiBlockstoreAccessor.RegisterDealToRetrievalStore(id, *order.RemoteStore); err != nil { - return 0, xerrors.Errorf("registering api store: %w", err) - } - } - - id, err = a.Retrieval.Retrieve( - ctx, - id, - order.Root, - params, - order.Total, - *order.MinerPeer, - order.Client, - order.Miner, - ) - - if err != nil { - return 0, xerrors.Errorf("Retrieve failed: %w", err) - } - - return id, nil -} - -func (a *API) ClientRetrieveWait(ctx context.Context, deal rm.DealID) error { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - subscribeEvents := make(chan rm.ClientDealState, 1) - - unsubscribe := a.Retrieval.SubscribeToEvents(func(event rm.ClientEvent, state rm.ClientDealState) { - // We'll check the deal IDs inside consumeAllEvents. - if state.ID != deal { - return - } - select { - case <-ctx.Done(): - case subscribeEvents <- state: - } - }) - defer unsubscribe() - - { - state, err := a.Retrieval.GetDeal(deal) - if err != nil { - return xerrors.Errorf("getting deal state: %w", err) - } - select { - case subscribeEvents <- state: - default: // already have an event queued from the subscription - } - } - - for { - select { - case <-ctx.Done(): - return xerrors.New("Retrieval Timed Out") - case state := <-subscribeEvents: - switch state.Status { - case rm.DealStatusCompleted: - return nil - case rm.DealStatusRejected: - return xerrors.Errorf("Retrieval Proposal Rejected: %s", state.Message) - case rm.DealStatusCancelled: - return xerrors.Errorf("Retrieval was cancelled externally: %s", state.Message) - case - rm.DealStatusDealNotFound, - rm.DealStatusErrored: - return xerrors.Errorf("Retrieval Error: %s", state.Message) - } - } - } -} - -type ExportDest struct { - Writer io.Writer - Path string -} - -func (ed *ExportDest) doWrite(cb func(io.Writer) error) error { - if ed.Writer != nil { - return cb(ed.Writer) - } - - f, err := os.OpenFile(ed.Path, os.O_CREATE|os.O_WRONLY, 0644) - if err != nil { - return err - } - - if err := cb(f); err != nil { - _ = f.Close() - return err - } - - return f.Close() -} - -func (a *API) ClientExport(ctx context.Context, exportRef api.ExportRef, ref api.FileRef) error { - return a.ClientExportInto(ctx, exportRef, ref.IsCAR, ExportDest{Path: ref.Path}) -} - -func (a *API) ClientExportInto(ctx context.Context, exportRef api.ExportRef, car bool, dest ExportDest) error { - proxyBss, retrieveIntoIPFS := a.RtvlBlockstoreAccessor.(*retrievaladapter.ProxyBlockstoreAccessor) - carBss, retrieveIntoCAR := a.RtvlBlockstoreAccessor.(*retrievaladapter.CARBlockstoreAccessor) - carPath := exportRef.FromLocalCAR - - if carPath == "" { - if !retrieveIntoIPFS && !retrieveIntoCAR { - return xerrors.Errorf("unsupported retrieval blockstore accessor") - } - - if retrieveIntoCAR { - carPath = carBss.PathFor(exportRef.DealID) - } - } - - var retrievalBs bstore.Blockstore - if retrieveIntoIPFS { - retrievalBs = proxyBss.Blockstore - } else { - cbs, err := stores.ReadOnlyFilestore(carPath) - if err != nil { - return err - } - defer cbs.Close() //nolint:errcheck - retrievalBs = cbs - } - - dserv := merkledag.NewDAGService(blockservice.New(retrievalBs, offline.Exchange(retrievalBs))) - - // Are we outputting a CAR? - if car { - // not IPFS and we do full selection - just extract the CARv1 from the CARv2 we stored the retrieval in - if !retrieveIntoIPFS && len(exportRef.DAGs) == 0 && dest.Writer == nil { - return carv2.ExtractV1File(carPath, dest.Path) - } - } - - roots, err := parseDagSpec(ctx, exportRef.Root, exportRef.DAGs, dserv, car) - if err != nil { - return xerrors.Errorf("parsing dag spec: %w", err) - } - if car { - return a.outputCAR(ctx, dserv, retrievalBs, exportRef.Root, roots, dest) - } - - if len(roots) != 1 { - return xerrors.Errorf("unixfs retrieval requires one root node, got %d", len(roots)) - } - - return a.outputUnixFS(ctx, roots[0].root, dserv, dest) -} - -func (a *API) outputCAR(ctx context.Context, ds format.DAGService, bs bstore.Blockstore, root cid.Cid, dags []dagSpec, dest ExportDest) error { - // generating a CARv1 from the configured blockstore - roots := make([]cid.Cid, len(dags)) - for i, dag := range dags { - roots[i] = dag.root - } - - var lk sync.Mutex - - return dest.doWrite(func(w io.Writer) error { - - if err := car.WriteHeader(&car.CarHeader{ - Roots: roots, - Version: 1, - }, w); err != nil { - return fmt.Errorf("failed to write car header: %s", err) - } - - cs := cid.NewSet() - - for _, dagSpec := range dags { - dagSpec := dagSpec - - if err := utils.TraverseDag( - ctx, - ds, - root, - dagSpec.selector, - func(node format.Node) error { - // if we're exporting merkle proofs for this dag, export all nodes read by the traversal - if dagSpec.exportAll { - lk.Lock() - defer lk.Unlock() - if cs.Visit(node.Cid()) { - err := util.LdWrite(w, node.Cid().Bytes(), node.RawData()) - if err != nil { - return xerrors.Errorf("writing block data: %w", err) - } - } - } - return nil - }, - func(p traversal.Progress, n ipld.Node, r traversal.VisitReason) error { - if !dagSpec.exportAll && r == traversal.VisitReason_SelectionMatch { - var c cid.Cid - if p.LastBlock.Link == nil { - c = root - } else { - cidLnk, castOK := p.LastBlock.Link.(cidlink.Link) - if !castOK { - return xerrors.Errorf("cidlink cast unexpectedly failed on '%s'", p.LastBlock.Link) - } - - c = cidLnk.Cid - } - - if cs.Visit(c) { - nb, err := bs.Get(ctx, c) - if err != nil { - return xerrors.Errorf("getting block data: %w", err) - } - - err = util.LdWrite(w, c.Bytes(), nb.RawData()) - if err != nil { - return xerrors.Errorf("writing block data: %w", err) - } - } - - return nil - } - return nil - }, - ); err != nil { - return xerrors.Errorf("error while traversing car dag: %w", err) - } - } - - return nil - }) -} - -func (a *API) outputUnixFS(ctx context.Context, root cid.Cid, ds format.DAGService, dest ExportDest) error { - nd, err := ds.Get(ctx, root) - if err != nil { - return xerrors.Errorf("ClientRetrieve: %w", err) - } - file, err := unixfile.NewUnixfsFile(ctx, ds, nd) - if err != nil { - return xerrors.Errorf("ClientRetrieve: %w", err) - } - - if dest.Writer == nil { - return files.WriteTo(file, dest.Path) - } - - switch f := file.(type) { - case files.File: - _, err = io.Copy(dest.Writer, f) - if err != nil { - return err - } - return nil - default: - return fmt.Errorf("file type %T is not supported", nd) - } -} - -type dagSpec struct { - root cid.Cid - selector ipld.Node - exportAll bool -} - -func parseDagSpec(ctx context.Context, root cid.Cid, dsp []api.DagSpec, ds format.DAGService, car bool) ([]dagSpec, error) { - if len(dsp) == 0 { - return []dagSpec{ - { - root: root, - selector: nil, - }, - }, nil - } - - out := make([]dagSpec, len(dsp)) - for i, spec := range dsp { - out[i].exportAll = spec.ExportMerkleProof - - if spec.DataSelector == nil { - return nil, xerrors.Errorf("invalid DagSpec at position %d: `DataSelector` can not be nil", i) - } - - // reify selector - var err error - out[i].selector, err = getDataSelector(spec.DataSelector, car && spec.ExportMerkleProof) - if err != nil { - return nil, err - } - - // find the pointed-at root node within the containing ds - var rsn ipld.Node - - if strings.HasPrefix(string(*spec.DataSelector), "{") { - var err error - rsn, err = selectorparse.ParseJSONSelector(string(*spec.DataSelector)) - if err != nil { - return nil, xerrors.Errorf("failed to parse json-selector '%s': %w", *spec.DataSelector, err) - } - } else { - selspec, _ := textselector.SelectorSpecFromPath(textselector.Expression(*spec.DataSelector), car && spec.ExportMerkleProof, nil) //nolint:errcheck - rsn = selspec.Node() - } - - var newRoot cid.Cid - var errHalt = errors.New("halt walk") - if err := utils.TraverseDag( - ctx, - ds, - root, - rsn, - nil, - func(p traversal.Progress, n ipld.Node, r traversal.VisitReason) error { - if r == traversal.VisitReason_SelectionMatch { - if !car && p.LastBlock.Path.String() != p.Path.String() { - return xerrors.Errorf("unsupported selection path '%s' does not correspond to a block boundary (a.k.a. CID link)", p.Path.String()) - } - - if p.LastBlock.Link == nil { - // this is likely the root node that we've matched here - newRoot = root - return errHalt - } - - cidLnk, castOK := p.LastBlock.Link.(cidlink.Link) - if !castOK { - return xerrors.Errorf("cidlink cast unexpectedly failed on '%s'", p.LastBlock.Link) - } - - newRoot = cidLnk.Cid - - return errHalt - } - return nil - }, - ); err != nil && err != errHalt { - return nil, xerrors.Errorf("error while locating partial retrieval sub-root: %w", err) - } - - if newRoot == cid.Undef { - return nil, xerrors.Errorf("path selection does not match a node within %s", root) - } - - out[i].root = newRoot - } - - return out, nil -} - -func (a *API) ClientListRetrievals(ctx context.Context) ([]api.RetrievalInfo, error) { - deals, err := a.Retrieval.ListDeals() - if err != nil { - return nil, err - } - dataTransfersByID, err := a.transfersByID(ctx) - if err != nil { - return nil, err - } - out := make([]api.RetrievalInfo, 0, len(deals)) - for _, v := range deals { - // Find the data transfer associated with this deal - var transferCh *api.DataTransferChannel - if v.ChannelID != nil { - if ch, ok := dataTransfersByID[*v.ChannelID]; ok { - transferCh = &ch - } - } - out = append(out, a.newRetrievalInfoWithTransfer(transferCh, v)) - } - sort.Slice(out, func(a, b int) bool { - return out[a].ID < out[b].ID - }) - return out, nil -} - -func (a *API) ClientGetRetrievalUpdates(ctx context.Context) (<-chan api.RetrievalInfo, error) { - updates := make(chan api.RetrievalInfo) - - unsub := a.Retrieval.SubscribeToEvents(func(evt rm.ClientEvent, deal rm.ClientDealState) { - update := a.newRetrievalInfo(ctx, deal) - update.Event = &evt - select { - case updates <- update: - case <-ctx.Done(): - } - }) - - go func() { - defer unsub() - <-ctx.Done() - }() - - return updates, nil -} - -func (a *API) newRetrievalInfoWithTransfer(ch *api.DataTransferChannel, deal rm.ClientDealState) api.RetrievalInfo { - return api.RetrievalInfo{ - PayloadCID: deal.PayloadCID, - ID: deal.ID, - PieceCID: deal.PieceCID, - PricePerByte: deal.PricePerByte, - UnsealPrice: deal.UnsealPrice, - Status: deal.Status, - Message: deal.Message, - Provider: deal.Sender, - BytesReceived: deal.TotalReceived, - BytesPaidFor: deal.BytesPaidFor, - TotalPaid: deal.FundsSpent, - TransferChannelID: deal.ChannelID, - DataTransfer: ch, - } -} - -func (a *API) newRetrievalInfo(ctx context.Context, v rm.ClientDealState) api.RetrievalInfo { - // Find the data transfer associated with this deal - var transferCh *api.DataTransferChannel - if v.ChannelID != nil { - state, err := a.DataTransfer.ChannelState(ctx, *v.ChannelID) - - // Note: If there was an error just ignore it, as the data transfer may - // be not found if it's no longer active - if err == nil { - ch := api.NewDataTransferChannel(a.Host.ID(), state) - ch.Stages = state.Stages() - transferCh = &ch - } - } - - return a.newRetrievalInfoWithTransfer(transferCh, v) -} - -const dealProtoPrefix = "/fil/storage/mk/" - -func (a *API) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*api.StorageAsk, error) { - mi, err := a.StateMinerInfo(ctx, miner, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed getting miner info: %w", err) - } - - info := utils.NewStorageProviderInfo(miner, mi.Worker, mi.SectorSize, p, mi.Multiaddrs) - ask, err := a.SMDealClient.GetAsk(ctx, info) - if err != nil { - return nil, err - } - res := &api.StorageAsk{ - Response: ask, - } - - ps, err := a.Host.Peerstore().GetProtocols(p) - if err != nil { - return nil, err - } - for _, s := range ps { - if strings.HasPrefix(string(s), dealProtoPrefix) { - res.DealProtocols = append(res.DealProtocols, string(s)) - } - } - sort.Strings(res.DealProtocols) - - return res, nil -} - -func (a *API) ClientCalcCommP(ctx context.Context, inpath string) (*api.CommPRet, error) { - rdr, err := os.Open(inpath) - if err != nil { - return nil, err - } - defer rdr.Close() //nolint:errcheck - - // check that the data is a car file; if it's not, retrieval won't work - _, err = car.ReadHeader(bufio.NewReader(rdr)) - if err != nil { - return nil, xerrors.Errorf("not a car file: %w", err) - } - - if _, err := rdr.Seek(0, io.SeekStart); err != nil { - return nil, xerrors.Errorf("seek to start: %w", err) - } - - w := &writer.Writer{} - _, err = io.CopyBuffer(w, rdr, make([]byte, writer.CommPBuf)) - if err != nil { - return nil, xerrors.Errorf("copy into commp writer: %w", err) - } - - commp, err := w.Sum() - if err != nil { - return nil, xerrors.Errorf("computing commP failed: %w", err) - } - - return &api.CommPRet{ - Root: commp.PieceCID, - Size: commp.PieceSize.Unpadded(), - }, nil -} - -type lenWriter int64 - -func (w *lenWriter) Write(p []byte) (n int, err error) { - *w += lenWriter(len(p)) - return len(p), nil -} - -func (a *API) ClientDealSize(ctx context.Context, root cid.Cid) (api.DataSize, error) { - bs, onDone, err := a.dealBlockstore(root) - if err != nil { - return api.DataSize{}, err - } - defer onDone() - - dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) - - var w lenWriter - err = car.WriteCar(ctx, dag, []cid.Cid{root}, &w) - if err != nil { - return api.DataSize{}, err - } - - up := padreader.PaddedSize(uint64(w)) - - return api.DataSize{ - PayloadSize: int64(w), - PieceSize: up.Padded(), - }, nil -} - -func (a *API) ClientDealPieceCID(ctx context.Context, root cid.Cid) (api.DataCIDSize, error) { - bs, onDone, err := a.dealBlockstore(root) - if err != nil { - return api.DataCIDSize{}, err - } - defer onDone() - - dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) - w := &writer.Writer{} - bw := bufio.NewWriterSize(w, int(writer.CommPBuf)) - - err = car.WriteCar(ctx, dag, []cid.Cid{root}, w) - if err != nil { - return api.DataCIDSize{}, err - } - - if err := bw.Flush(); err != nil { - return api.DataCIDSize{}, err - } - - dataCIDSize, err := w.Sum() - return api.DataCIDSize(dataCIDSize), err -} - -func (a *API) ClientGenCar(ctx context.Context, ref api.FileRef, outputPath string) error { - // create a temporary import to represent this job and obtain a staging CAR. - id, err := a.importManager().CreateImport() - if err != nil { - return xerrors.Errorf("failed to create temporary import: %w", err) - } - defer a.importManager().Remove(id) //nolint:errcheck - - tmp, err := a.importManager().AllocateCAR(id) - if err != nil { - return xerrors.Errorf("failed to allocate temporary CAR: %w", err) - } - defer os.Remove(tmp) //nolint:errcheck - - // generate and import the UnixFS DAG into a filestore (positional reference) CAR. - root, err := unixfs.CreateFilestore(ctx, ref.Path, tmp) - if err != nil { - return xerrors.Errorf("failed to import file using unixfs: %w", err) - } - - // open the positional reference CAR as a filestore. - fs, err := stores.ReadOnlyFilestore(tmp) - if err != nil { - return xerrors.Errorf("failed to open filestore from carv2 in path %s: %w", tmp, err) - } - defer fs.Close() //nolint:errcheck - - f, err := os.Create(outputPath) - if err != nil { - return err - } - - // build a dense deterministic CAR (dense = containing filled leaves) - if err := car.NewSelectiveCar( - ctx, - fs, - []car.Dag{{ - Root: root, - Selector: selectorparse.CommonSelector_ExploreAllRecursively, - }}, - car.MaxTraversalLinks(config.MaxTraversalLinks), - ).Write( - f, - ); err != nil { - return xerrors.Errorf("failed to write CAR to output file: %w", err) - } - - return f.Close() -} - -func (a *API) ClientListDataTransfers(ctx context.Context) ([]api.DataTransferChannel, error) { - inProgressChannels, err := a.DataTransfer.InProgressChannels(ctx) - if err != nil { - return nil, err - } - - apiChannels := make([]api.DataTransferChannel, 0, len(inProgressChannels)) - for _, channelState := range inProgressChannels { - apiChannels = append(apiChannels, api.NewDataTransferChannel(a.Host.ID(), channelState)) - } - - return apiChannels, nil -} - -func (a *API) ClientDataTransferUpdates(ctx context.Context) (<-chan api.DataTransferChannel, error) { - channels := make(chan api.DataTransferChannel) - - unsub := a.DataTransfer.SubscribeToEvents(func(evt datatransfer.Event, channelState datatransfer.ChannelState) { - channel := api.NewDataTransferChannel(a.Host.ID(), channelState) - select { - case <-ctx.Done(): - case channels <- channel: - } - }) - - go func() { - defer unsub() - <-ctx.Done() - }() - - return channels, nil -} - -func (a *API) ClientRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error { - selfPeer := a.Host.ID() - if isInitiator { - return a.DataTransfer.RestartDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: selfPeer, Responder: otherPeer, ID: transferID}) - } - return a.DataTransfer.RestartDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: otherPeer, Responder: selfPeer, ID: transferID}) -} - -func (a *API) ClientCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error { - selfPeer := a.Host.ID() - if isInitiator { - return a.DataTransfer.CloseDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: selfPeer, Responder: otherPeer, ID: transferID}) - } - return a.DataTransfer.CloseDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: otherPeer, Responder: selfPeer, ID: transferID}) -} - -func (a *API) ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error { - return a.Retrieval.TryRestartInsufficientFunds(paymentChannel) -} - -func (a *API) ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) { - ststr, ok := storagemarket.DealStates[statusCode] - if !ok { - return "", fmt.Errorf("no such deal state %d", statusCode) - } - - return ststr, nil -} - -// dealBlockstore picks the source blockstore for a storage deal; either the -// IPFS blockstore, or an import CARv2 file. It also returns a function that -// must be called when done. -func (a *API) dealBlockstore(root cid.Cid) (bstore.Blockstore, func(), error) { - switch acc := a.StorageBlockstoreAccessor.(type) { - case *storageadapter.ImportsBlockstoreAccessor: - bs, err := acc.Get(root) - if err != nil { - return nil, nil, xerrors.Errorf("no import found for root %s: %w", root, err) - } - - doneFn := func() { - _ = acc.Done(root) //nolint:errcheck - } - return bs, doneFn, nil - - case *storageadapter.ProxyBlockstoreAccessor: - return acc.Blockstore, func() {}, nil - - default: - return nil, nil, xerrors.Errorf("unsupported blockstore accessor type: %T", acc) - } -} diff --git a/node/impl/client/client_test.go b/node/impl/client/client_test.go deleted file mode 100644 index 67a35013166..00000000000 --- a/node/impl/client/client_test.go +++ /dev/null @@ -1,136 +0,0 @@ -// stm: #unit -package client - -import ( - "bytes" - "context" - "embed" - "os" - "path/filepath" - "strings" - "testing" - - "github.com/ipfs/boxo/blockservice" - blockstore "github.com/ipfs/boxo/blockstore" - offline "github.com/ipfs/boxo/exchange/offline" - "github.com/ipfs/boxo/files" - "github.com/ipfs/boxo/ipld/merkledag" - unixfile "github.com/ipfs/boxo/ipld/unixfs/file" - "github.com/ipfs/go-cid" - "github.com/ipfs/go-datastore" - dssync "github.com/ipfs/go-datastore/sync" - "github.com/ipld/go-car" - carv2 "github.com/ipld/go-car/v2" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/node/repo/imports" -) - -//go:embed testdata/* -var testdata embed.FS - -func TestImportLocal(t *testing.T) { - // stm: @CLIENT_STORAGE_DEALS_IMPORT_LOCAL_001, @CLIENT_RETRIEVAL_FIND_001 - ds := dssync.MutexWrap(datastore.NewMapDatastore()) - dir := t.TempDir() - im := imports.NewManager(ds, dir) - ctx := context.Background() - - a := &API{ - Imports: im, - StorageBlockstoreAccessor: storageadapter.NewImportsBlockstoreAccessor(im), - } - - b, err := testdata.ReadFile("testdata/payload.txt") - require.NoError(t, err) - - // stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 - root, err := a.ClientImportLocal(ctx, bytes.NewReader(b)) - require.NoError(t, err) - require.NotEqual(t, cid.Undef, root) - - list, err := a.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 1) - - it := list[0] - require.Equal(t, root, *it.Root) - require.True(t, strings.HasPrefix(it.CARPath, dir)) - - // stm: @CLIENT_DATA_HAS_LOCAL_001 - local, err := a.ClientHasLocal(ctx, root) - require.NoError(t, err) - require.True(t, local) - - order := api.ExportRef{ - Root: root, - FromLocalCAR: it.CARPath, - } - - // retrieve as UnixFS. - out1 := filepath.Join(dir, "retrieval1.data") // as unixfs - out2 := filepath.Join(dir, "retrieval2.data") // as car - err = a.ClientExport(ctx, order, api.FileRef{ - Path: out1, - }) - require.NoError(t, err) - - outBytes, err := os.ReadFile(out1) - require.NoError(t, err) - require.Equal(t, b, outBytes) - - err = a.ClientExport(ctx, order, api.FileRef{ - Path: out2, - IsCAR: true, - }) - require.NoError(t, err) - - // open the CARv2 being custodied by the import manager - orig, err := carv2.OpenReader(it.CARPath) - require.NoError(t, err) - - // open the CARv1 we just exported - exported, err := carv2.OpenReader(out2) - require.NoError(t, err) - - require.EqualValues(t, 1, exported.Version) - require.EqualValues(t, 2, orig.Version) - - origRoots, err := orig.Roots() - require.NoError(t, err) - require.Len(t, origRoots, 1) - - exportedRoots, err := exported.Roots() - require.NoError(t, err) - require.Len(t, exportedRoots, 1) - - require.EqualValues(t, origRoots, exportedRoots) - - // recreate the unixfs dag, and see if it matches the original file byte by byte - // import the car into a memory blockstore, then export the unixfs file. - bs := blockstore.NewBlockstore(datastore.NewMapDatastore()) - r, err := exported.DataReader() - require.NoError(t, err) - _, err = car.LoadCar(ctx, bs, r) - require.NoError(t, err) - - dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) - - nd, err := dag.Get(ctx, exportedRoots[0]) - require.NoError(t, err) - - file, err := unixfile.NewUnixfsFile(ctx, dag, nd) - require.NoError(t, err) - - exportedPath := filepath.Join(dir, "exported.data") - err = files.WriteTo(file, exportedPath) - require.NoError(t, err) - - exportedBytes, err := os.ReadFile(exportedPath) - require.NoError(t, err) - - // compare original file to recreated unixfs file. - require.Equal(t, b, exportedBytes) -} diff --git a/node/impl/client/testdata/duplicate_blocks.txt b/node/impl/client/testdata/duplicate_blocks.txt deleted file mode 100644 index 53695d7b95f..00000000000 --- a/node/impl/client/testdata/duplicate_blocks.txt +++ /dev/null @@ -1 +0,0 @@ -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd \ No newline at end of file diff --git a/node/impl/client/testdata/payload.txt b/node/impl/client/testdata/payload.txt deleted file mode 100644 index fd4a2f3c1ff..00000000000 --- a/node/impl/client/testdata/payload.txt +++ /dev/null @@ -1,49 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae semper quis lectus nulla at volutpat diam ut venenatis. Ac tortor dignissim convallis aenean et tortor at. Faucibus ornare suspendisse sed nisi lacus sed. Commodo ullamcorper a lacus vestibulum sed arcu non. Est pellentesque elit ullamcorper dignissim. Quam quisque id diam vel quam. Pretium aenean pharetra magna ac. In nulla posuere sollicitudin aliquam ultrices. Sed arcu non odio euismod lacinia at. Suspendisse ultrices gravida dictum fusce ut placerat orci nulla pellentesque. Feugiat vivamus at augue eget arcu. - -Pellentesque nec nam aliquam sem et tortor. Vitae tortor condimentum lacinia quis vel. Cras pulvinar mattis nunc sed. In massa tempor nec feugiat. Ornare arcu odio ut sem nulla. Diam maecenas sed enim ut sem. Pretium vulputate sapien nec sagittis. Bibendum arcu vitae elementum curabitur vitae nunc sed velit dignissim. Duis ut diam quam nulla porttitor massa. Viverra mauris in aliquam sem fringilla ut morbi. Ullamcorper eget nulla facilisi etiam dignissim. Vulputate mi sit amet mauris commodo quis imperdiet massa tincidunt. Nunc consequat interdum varius sit. Nunc mi ipsum faucibus vitae aliquet nec ullamcorper. Nunc sed augue lacus viverra. Lobortis scelerisque fermentum dui faucibus in ornare quam. Urna neque viverra justo nec ultrices. Varius vel pharetra vel turpis nunc eget lorem dolor sed. - -Feugiat nisl pretium fusce id velit ut tortor pretium. Lorem dolor sed viverra ipsum nunc aliquet bibendum. Ultrices vitae auctor eu augue ut lectus. Pharetra massa massa ultricies mi quis. Nibh cras pulvinar mattis nunc sed blandit libero. Ac felis donec et odio pellentesque diam volutpat. Lectus proin nibh nisl condimentum id venenatis. Quis vel eros donec ac odio. Commodo sed egestas egestas fringilla phasellus faucibus scelerisque eleifend donec. Adipiscing diam donec adipiscing tristique. - -Tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis. Libero nunc consequat interdum varius sit. Et pharetra pharetra massa massa. Feugiat pretium nibh ipsum consequat. Amet commodo nulla facilisi nullam vehicula. Ornare arcu dui vivamus arcu felis bibendum ut tristique. At erat pellentesque adipiscing commodo elit at imperdiet dui. Auctor neque vitae tempus quam pellentesque nec nam aliquam sem. Eget velit aliquet sagittis id consectetur. Enim diam vulputate ut pharetra sit amet aliquam id diam. Eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar. Amet porttitor eget dolor morbi. Felis eget velit aliquet sagittis id. Facilisis magna etiam tempor orci eu. Lacus suspendisse faucibus interdum posuere lorem. Pharetra et ultrices neque ornare aenean euismod. Platea dictumst quisque sagittis purus. - -Quis varius quam quisque id diam vel quam elementum. Augue mauris augue neque gravida in fermentum et sollicitudin. Sapien nec sagittis aliquam malesuada bibendum arcu. Urna duis convallis convallis tellus id interdum velit. Tellus in hac habitasse platea dictumst vestibulum. Fames ac turpis egestas maecenas pharetra convallis. Diam volutpat commodo sed egestas egestas fringilla phasellus faucibus. Placerat orci nulla pellentesque dignissim enim sit amet venenatis. Sed adipiscing diam donec adipiscing. Praesent elementum facilisis leo vel fringilla est. Sed enim ut sem viverra aliquet eget sit amet tellus. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra. Turpis egestas pretium aenean pharetra magna ac placerat vestibulum. Massa id neque aliquam vestibulum morbi blandit cursus risus. Vitae congue eu consequat ac. Egestas erat imperdiet sed euismod nisi porta lorem mollis aliquam. Dolor purus non enim praesent elementum facilisis. Ultrices mi tempus imperdiet nulla malesuada pellentesque elit. In est ante in nibh. - -Facilisis gravida neque convallis a. Urna nunc id cursus metus aliquam eleifend mi. Lacus luctus accumsan tortor posuere ac. Molestie nunc non blandit massa. Iaculis urna id volutpat lacus laoreet non. Cursus vitae congue mauris rhoncus aenean. Nunc vel risus commodo viverra maecenas. A pellentesque sit amet porttitor eget dolor morbi. Leo vel orci porta non pulvinar neque laoreet suspendisse. Sit amet facilisis magna etiam tempor. Consectetur a erat nam at lectus urna duis convallis convallis. Vestibulum morbi blandit cursus risus at ultrices. Dolor purus non enim praesent elementum. Adipiscing elit pellentesque habitant morbi tristique senectus et netus et. Et odio pellentesque diam volutpat commodo sed egestas egestas fringilla. Leo vel fringilla est ullamcorper eget nulla. Dui ut ornare lectus sit amet. Erat pellentesque adipiscing commodo elit at imperdiet dui accumsan sit. - -Tristique senectus et netus et. Pellentesque diam volutpat commodo sed egestas egestas fringilla. Mauris pharetra et ultrices neque ornare aenean. Amet tellus cras adipiscing enim. Convallis aenean et tortor at risus viverra adipiscing at. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. Dictumst vestibulum rhoncus est pellentesque elit. Fringilla ut morbi tincidunt augue interdum velit euismod in pellentesque. Dictum at tempor commodo ullamcorper a lacus vestibulum. Sed viverra tellus in hac habitasse platea. Sed id semper risus in hendrerit. In hendrerit gravida rutrum quisque non tellus orci ac. Sit amet risus nullam eget. Sit amet est placerat in egestas erat imperdiet sed. In nisl nisi scelerisque eu ultrices. Sit amet mattis vulputate enim nulla aliquet. - -Dignissim suspendisse in est ante in nibh mauris cursus. Vitae proin sagittis nisl rhoncus. Id leo in vitae turpis massa sed elementum. Lobortis elementum nibh tellus molestie nunc non blandit massa enim. Arcu dictum varius duis at consectetur. Suspendisse faucibus interdum posuere lorem ipsum dolor sit amet consectetur. Imperdiet nulla malesuada pellentesque elit eget gravida cum sociis. Sed adipiscing diam donec adipiscing. Purus sit amet volutpat consequat mauris nunc congue nisi vitae. Elementum nisi quis eleifend quam adipiscing vitae proin sagittis nisl. Mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa. Sit amet nisl purus in mollis nunc sed. Turpis tincidunt id aliquet risus feugiat in ante. Id diam maecenas ultricies mi eget mauris pharetra et ultrices. - -Aliquam purus sit amet luctus venenatis lectus magna fringilla urna. Id diam vel quam elementum pulvinar. Elementum sagittis vitae et leo duis. Viverra aliquet eget sit amet tellus cras adipiscing enim eu. Et tortor at risus viverra adipiscing at in tellus integer. Purus in massa tempor nec feugiat. Augue neque gravida in fermentum et sollicitudin ac orci. Sodales ut eu sem integer vitae justo eget magna fermentum. Netus et malesuada fames ac. Augue interdum velit euismod in. Sed elementum tempus egestas sed sed risus pretium. Mattis vulputate enim nulla aliquet porttitor lacus luctus. Dui vivamus arcu felis bibendum ut tristique et egestas quis. - -Viverra justo nec ultrices dui sapien. Quisque egestas diam in arcu cursus euismod quis viverra nibh. Nam libero justo laoreet sit amet cursus sit amet. Lacus sed viverra tellus in hac habitasse. Blandit aliquam etiam erat velit scelerisque in. Ut sem nulla pharetra diam sit amet nisl suscipit adipiscing. Diam sollicitudin tempor id eu nisl nunc. Eget duis at tellus at urna condimentum mattis. Urna porttitor rhoncus dolor purus non enim praesent elementum facilisis. Sed turpis tincidunt id aliquet risus feugiat. Est velit egestas dui id ornare arcu odio ut sem. Nibh sit amet commodo nulla facilisi nullam vehicula. Sit amet consectetur adipiscing elit duis tristique sollicitudin. Eu facilisis sed odio morbi. Massa id neque aliquam vestibulum morbi. In eu mi bibendum neque egestas congue quisque egestas. Massa sed elementum tempus egestas sed sed risus. Quam elementum pulvinar etiam non. At augue eget arcu dictum varius duis at consectetur lorem. - -Penatibus et magnis dis parturient montes nascetur ridiculus. Dictumst quisque sagittis purus sit amet volutpat consequat. Bibendum at varius vel pharetra. Sed adipiscing diam donec adipiscing tristique risus nec feugiat in. Phasellus faucibus scelerisque eleifend donec pretium. Vitae tortor condimentum lacinia quis vel eros. Ac tincidunt vitae semper quis lectus nulla at volutpat diam. Eget sit amet tellus cras adipiscing. Morbi tristique senectus et netus. Nullam vehicula ipsum a arcu cursus vitae congue mauris rhoncus. Auctor urna nunc id cursus metus aliquam eleifend. Ultrices vitae auctor eu augue. Eu non diam phasellus vestibulum lorem sed risus ultricies. Fames ac turpis egestas sed tempus. Volutpat blandit aliquam etiam erat. Dictum varius duis at consectetur lorem. Sit amet volutpat consequat mauris nunc congue. Volutpat sed cras ornare arcu dui vivamus arcu felis. - -Scelerisque fermentum dui faucibus in ornare quam viverra. Interdum velit laoreet id donec ultrices tincidunt arcu. Netus et malesuada fames ac. Netus et malesuada fames ac turpis. Suscipit tellus mauris a diam maecenas sed enim ut sem. Id velit ut tortor pretium. Neque aliquam vestibulum morbi blandit cursus risus at. Cum sociis natoque penatibus et magnis dis parturient. Lobortis elementum nibh tellus molestie nunc non blandit. Ipsum dolor sit amet consectetur adipiscing elit duis tristique. Amet nisl purus in mollis. Amet massa vitae tortor condimentum lacinia quis vel eros donec. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. - -Nullam ac tortor vitae purus faucibus. Dis parturient montes nascetur ridiculus mus mauris. Molestie at elementum eu facilisis sed odio morbi. Scelerisque felis imperdiet proin fermentum leo vel orci porta. Lectus proin nibh nisl condimentum id venenatis a. Eget nullam non nisi est sit amet facilisis. Hendrerit gravida rutrum quisque non tellus orci ac auctor. Ut faucibus pulvinar elementum integer enim. Rhoncus dolor purus non enim praesent elementum facilisis. Enim sed faucibus turpis in eu mi bibendum. Faucibus nisl tincidunt eget nullam. - -Cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque. Pretium nibh ipsum consequat nisl vel pretium lectus quam. Semper viverra nam libero justo laoreet sit amet cursus sit. Augue eget arcu dictum varius duis at consectetur lorem donec. Et malesuada fames ac turpis. Erat nam at lectus urna duis convallis convallis. Dictum sit amet justo donec enim. Urna condimentum mattis pellentesque id nibh tortor id. Morbi tempus iaculis urna id. Lectus proin nibh nisl condimentum id venenatis a condimentum. Nibh sit amet commodo nulla facilisi nullam vehicula. Dui faucibus in ornare quam. Gravida arcu ac tortor dignissim convallis aenean. Consectetur adipiscing elit pellentesque habitant morbi tristique. Pulvinar elementum integer enim neque volutpat ac tincidunt vitae. Pharetra pharetra massa massa ultricies mi quis hendrerit. Dictum at tempor commodo ullamcorper a lacus vestibulum sed. Mattis pellentesque id nibh tortor id. Ultricies integer quis auctor elit sed vulputate. Pretium vulputate sapien nec sagittis aliquam malesuada. - -Auctor augue mauris augue neque gravida. Porttitor lacus luctus accumsan tortor posuere ac ut. Urna neque viverra justo nec ultrices dui. Sit amet est placerat in egestas. Urna nec tincidunt praesent semper feugiat nibh sed pulvinar. Tincidunt eget nullam non nisi est sit amet facilisis magna. Elementum tempus egestas sed sed risus pretium quam vulputate dignissim. Fermentum posuere urna nec tincidunt praesent semper feugiat nibh sed. Porttitor eget dolor morbi non arcu risus quis. Non quam lacus suspendisse faucibus interdum. Venenatis cras sed felis eget velit aliquet sagittis id. Arcu ac tortor dignissim convallis aenean et. Morbi tincidunt ornare massa eget egestas purus. Ac feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper. Vestibulum morbi blandit cursus risus at ultrices. Volutpat blandit aliquam etiam erat velit scelerisque. - -Et egestas quis ipsum suspendisse. Amet consectetur adipiscing elit duis. Purus ut faucibus pulvinar elementum integer enim neque. Cursus vitae congue mauris rhoncus aenean vel elit scelerisque mauris. Tincidunt eget nullam non nisi est. Aliquam purus sit amet luctus. Dui ut ornare lectus sit amet est placerat in. Fringilla ut morbi tincidunt augue interdum velit euismod in. Felis eget nunc lobortis mattis aliquam faucibus purus in. Suspendisse interdum consectetur libero id faucibus nisl. - -Scelerisque fermentum dui faucibus in ornare quam. Lectus proin nibh nisl condimentum id venenatis a condimentum vitae. Fames ac turpis egestas integer eget aliquet nibh praesent tristique. Arcu non sodales neque sodales ut etiam sit. Pharetra convallis posuere morbi leo urna. Nec dui nunc mattis enim ut tellus. Nunc sed augue lacus viverra vitae. Consequat id porta nibh venenatis cras sed felis. Dolor sit amet consectetur adipiscing. Tellus rutrum tellus pellentesque eu tincidunt tortor aliquam nulla. - -Metus aliquam eleifend mi in nulla posuere. Blandit massa enim nec dui nunc mattis enim. Aliquet nibh praesent tristique magna. In aliquam sem fringilla ut. Magna fermentum iaculis eu non. Eget aliquet nibh praesent tristique magna sit amet purus. Ultrices gravida dictum fusce ut placerat orci. Fermentum posuere urna nec tincidunt praesent. Enim tortor at auctor urna nunc. Ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel. Sed id semper risus in hendrerit gravida rutrum. Vestibulum lectus mauris ultrices eros in cursus turpis. Et sollicitudin ac orci phasellus egestas tellus rutrum. Pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at. Metus vulputate eu scelerisque felis imperdiet proin fermentum leo. Porta non pulvinar neque laoreet suspendisse. Suscipit adipiscing bibendum est ultricies integer quis auctor elit sed. Euismod in pellentesque massa placerat duis ultricies lacus sed. Pellentesque adipiscing commodo elit at imperdiet dui accumsan sit amet. - -Pellentesque eu tincidunt tortor aliquam nulla facilisi. Commodo nulla facilisi nullam vehicula ipsum a arcu. Commodo quis imperdiet massa tincidunt nunc pulvinar sapien et. Faucibus purus in massa tempor. Purus semper eget duis at tellus at urna condimentum. Vivamus at augue eget arcu dictum. Lacus vel facilisis volutpat est velit egestas dui id. Malesuada fames ac turpis egestas maecenas pharetra. Nunc faucibus a pellentesque sit amet porttitor eget dolor. Ultricies tristique nulla aliquet enim. Vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat. Dignissim diam quis enim lobortis scelerisque. Donec ultrices tincidunt arcu non sodales neque sodales ut etiam. - -Vitae proin sagittis nisl rhoncus mattis rhoncus urna neque. Fermentum leo vel orci porta non. At elementum eu facilisis sed. Quis enim lobortis scelerisque fermentum. Fermentum odio eu feugiat pretium nibh ipsum consequat. Habitant morbi tristique senectus et netus et. Enim praesent elementum facilisis leo vel fringilla est ullamcorper. Egestas quis ipsum suspendisse ultrices gravida dictum. Nam libero justo laoreet sit amet cursus sit amet. Viverra tellus in hac habitasse platea dictumst vestibulum. Varius vel pharetra vel turpis nunc eget. Nullam non nisi est sit amet facilisis magna. Ullamcorper eget nulla facilisi etiam dignissim diam. Ante metus dictum at tempor commodo ullamcorper a lacus. - -Etiam non quam lacus suspendisse. Ut venenatis tellus in metus vulputate eu scelerisque felis. Pulvinar sapien et ligula ullamcorper malesuada proin libero. Consequat interdum varius sit amet mattis. Nunc eget lorem dolor sed viverra ipsum nunc aliquet. Potenti nullam ac tortor vitae purus faucibus ornare. Urna et pharetra pharetra massa massa ultricies mi quis hendrerit. Purus in mollis nunc sed id. Pharetra vel turpis nunc eget lorem dolor sed viverra. Et netus et malesuada fames ac turpis. Libero id faucibus nisl tincidunt eget nullam non nisi. Cursus sit amet dictum sit amet. Porttitor lacus luctus accumsan tortor. - -Volutpat diam ut venenatis tellus in metus vulputate eu scelerisque. Sed viverra tellus in hac habitasse. Aliquam sem et tortor consequat id. Pellentesque habitant morbi tristique senectus et netus et. Consectetur purus ut faucibus pulvinar elementum. Aliquam malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. Malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. Sollicitudin tempor id eu nisl nunc mi ipsum. Fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. Quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Bibendum neque egestas congue quisque egestas. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Pulvinar etiam non quam lacus. Adipiscing commodo elit at imperdiet. Scelerisque eu ultrices vitae auctor. Sed cras ornare arcu dui vivamus arcu felis bibendum ut. Ornare lectus sit amet est. - -Consequat semper viverra nam libero justo laoreet sit. Imperdiet sed euismod nisi porta lorem mollis aliquam ut porttitor. Cras sed felis eget velit aliquet sagittis id consectetur. Dolor morbi non arcu risus quis. Adipiscing tristique risus nec feugiat in fermentum posuere urna. Dolor magna eget est lorem ipsum dolor. Mauris pharetra et ultrices neque ornare aenean euismod. Nulla facilisi etiam dignissim diam quis. Ultrices tincidunt arcu non sodales. Fames ac turpis egestas maecenas pharetra convallis posuere morbi leo. Interdum varius sit amet mattis vulputate. Tincidunt praesent semper feugiat nibh sed pulvinar. Quisque sagittis purus sit amet volutpat. - -Sed vulputate odio ut enim blandit. Vitae auctor eu augue ut lectus arcu bibendum. Consectetur adipiscing elit pellentesque habitant morbi tristique senectus et. Scelerisque eu ultrices vitae auctor eu augue. Etiam dignissim diam quis enim lobortis scelerisque fermentum dui faucibus. Tellus integer feugiat scelerisque varius. Vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor. Amet nisl purus in mollis. Scelerisque viverra mauris in aliquam sem fringilla ut morbi tincidunt. Semper eget duis at tellus at. Erat velit scelerisque in dictum non consectetur a erat nam. Gravida rutrum quisque non tellus orci. Morbi blandit cursus risus at. Mauris sit amet massa vitae. Non odio euismod lacinia at quis risus sed vulputate. Fermentum posuere urna nec tincidunt praesent. Ut eu sem integer vitae justo eget magna fermentum iaculis. Ullamcorper velit sed ullamcorper morbi tincidunt ornare massa. Arcu cursus euismod quis viverra nibh. Arcu dui vivamus arcu felis bibendum. - -Eros in cursus turpis massa tincidunt dui ut. Urna condimentum mattis pellentesque id nibh tortor id aliquet lectus. Nibh venenatis cras sed felis. Ac felis donec et odio pellentesque diam. Ultricies lacus sed turpis tincidunt id aliquet risus. Diam volutpat commodo sed egestas. Dignissim sodales ut eu sem integer vitae. Pellentesque eu tincidunt tortor aliquam nulla facilisi. Et tortor consequat id porta nibh venenatis cras sed. \ No newline at end of file diff --git a/node/impl/client/testdata/payload2.txt b/node/impl/client/testdata/payload2.txt deleted file mode 100644 index 16fb150f5b2..00000000000 --- a/node/impl/client/testdata/payload2.txt +++ /dev/null @@ -1,49 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae semper quis lectus nulla at volutpat diam ut venenatis. Ac tortor dignissim convallis aenean et tortor at. Faucibus ornare suspendisse sed nisi lacus sed. Commodo ullamcorper a lacus vestibulum sed arcu non. Est pellentesque elit ullamcorper dignissim. Quam quisque id diam vel quam. Pretium aenean pharetra magna ac. In nulla posuere sollicitudin aliquam ultrices. Sed arcu non odio euismod lacinia at. Suspendisse ultrices gravida dictum fusce ut placerat orci nulla pellentesque. Feugiat vivamus at augue eget arcu. - -Pellentesque nec nam aliquam sem et tortor. Vitae tortor condimentum lacinia quis vel. Cras pulvinar mattis nunc sed. In massa tempor nec feugiat. Ornare arcu odio ut sem nulla. Diam maecenas sed enim ut sem. Pretium vulputate sapien nec sagittis. Bibendum arcu vitae elementum curabitur vitae nunc sed velit dignissim. Duis ut diam quam nulla porttitor massa. Viverra mauris in aliquam sem fringilla ut morbi. Ullamcorper eget nulla facilisi etiam dignissim. Vulputate mi sit amet mauris commodo quis imperdiet massa tincidunt. Nunc consequat interdum varius sit. Nunc mi ipsum faucibus vitae aliquet nec ullamcorper. Nunc sed augue lacus viverra. Lobortis scelerisque fermentum dui faucibus in ornare quam. Urna neque viverra justo nec ultrices. Varius vel pharetra vel turpis nunc eget lorem dolor sed. - -Feugiat nisl pretium fusce id velit ut tortor pretium. Lorem dolor sed viverra ipsum nunc aliquet bibendum. Ultrices vitae auctor eu augue ut lectus. Pharetra massa massa ultricies mi quis. Nibh cras pulvinar mattis nunc sed blandit libero. Ac felis donec et odio pellentesque diam volutpat. Lectus proin nibh nisl condimentum id venenatis. Quis vel eros donec ac odio. Commodo sed egestas egestas fringilla phasellus faucibus scelerisque eleifend donec. Adipiscing diam donec adipiscing tristique. - -Tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis. Libero nunc consequat interdum varius sit. Et pharetra pharetra massa massa. Feugiat pretium nibh ipsum consequat. Amet commodo nulla facilisi nullam vehicula. Ornare arcu dui vivamus arcu felis bibendum ut tristique. At erat pellentesque adipiscing commodo elit at imperdiet dui. Auctor neque vitae tempus quam pellentesque nec nam aliquam sem. Eget velit aliquet sagittis id consectetur. Enim diam vulputate ut pharetra sit amet aliquam id diam. Eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar. Amet porttitor eget dolor morbi. Felis eget velit aliquet sagittis id. Facilisis magna etiam tempor orci eu. Lacus suspendisse faucibus interdum posuere lorem. Pharetra et ultrices neque ornare aenean euismod. Platea dictumst quisque sagittis purus. - -Quis varius quam quisque id diam vel quam elementum. Augue mauris augue neque gravida in fermentum et sollicitudin. Sapien nec sagittis aliquam malesuada bibendum arcu. Urna duis convallis convallis tellus id interdum velit. Tellus in hac habitasse platea dictumst vestibulum. Fames ac turpis egestas maecenas pharetra convallis. Diam volutpat commodo sed egestas egestas fringilla phasellus faucibus. Placerat orci nulla pellentesque dignissim enim sit amet venenatis. Sed adipiscing diam donec adipiscing. Praesent elementum facilisis leo vel fringilla est. Sed enim ut sem viverra aliquet eget sit amet tellus. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra. Turpis egestas pretium aenean pharetra magna ac placerat vestibulum. Massa id neque aliquam vestibulum morbi blandit cursus risus. Vitae congue eu consequat ac. Egestas erat imperdiet sed euismod nisi porta lorem mollis aliquam. Dolor purus non enim praesent elementum facilisis. Ultrices mi tempus imperdiet nulla malesuada pellentesque elit. In est ante in nibh. - -Facilisis gravida neque convallis a. Urna nunc id cursus metus aliquam eleifend mi. Lacus luctus accumsan tortor posuere ac. Molestie nunc non blandit massa. Iaculis urna id volutpat lacus laoreet non. Cursus vitae congue mauris rhoncus aenean. Nunc vel risus commodo viverra maecenas. A pellentesque sit amet porttitor eget dolor morbi. Leo vel orci porta non pulvinar neque laoreet suspendisse. Sit amet facilisis magna etiam tempor. Consectetur a erat nam at lectus urna duis convallis convallis. Vestibulum morbi blandit cursus risus at ultrices. Dolor purus non enim praesent elementum. Adipiscing elit pellentesque habitant morbi tristique senectus et netus et. Et odio pellentesque diam volutpat commodo sed egestas egestas fringilla. Leo vel fringilla est ullamcorper eget nulla. Dui ut ornare lectus sit amet. Erat pellentesque adipiscing commodo elit at imperdiet dui accumsan sit. - -Tristique senectus et netus et. Pellentesque diam volutpat commodo sed egestas egestas fringilla. Mauris pharetra et ultrices neque ornare aenean. Amet tellus cras adipiscing enim. Convallis aenean et tortor at risus viverra adipiscing at. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. Dictumst vestibulum rhoncus est pellentesque elit. Fringilla ut morbi tincidunt augue interdum velit euismod in pellentesque. Dictum at tempor commodo ullamcorper a lacus vestibulum. Sed viverra tellus in hac habitasse platea. Sed id semper risus in hendrerit. In hendrerit gravida rutrum quisque non tellus orci ac. Sit amet risus nullam eget. Sit amet est placerat in egestas erat imperdiet sed. In nisl nisi scelerisque eu ultrices. Sit amet mattis vulputate enim nulla aliquet. - -Dignissim suspendisse in est ante in nibh mauris cursus. Vitae proin sagittis nisl rhoncus. Id leo in vitae turpis massa sed elementum. Lobortis elementum nibh tellus molestie nunc non blandit massa enim. Arcu dictum varius duis at consectetur. Suspendisse faucibus interdum posuere lorem ipsum dolor sit amet consectetur. Imperdiet nulla malesuada pellentesque elit eget gravida cum sociis. Sed adipiscing diam donec adipiscing. Purus sit amet volutpat consequat mauris nunc congue nisi vitae. Elementum nisi quis eleifend quam adipiscing vitae proin sagittis nisl. Mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa. Sit amet nisl purus in mollis nunc sed. Turpis tincidunt id aliquet risus feugiat in ante. Id diam maecenas ultricies mi eget mauris pharetra et ultrices. - -Aliquam purus sit amet luctus venenatis lectus magna fringilla urna. Id diam vel quam elementum pulvinar. Elementum sagittis vitae et leo duis. Viverra aliquet eget sit amet tellus cras adipiscing enim eu. Et tortor at risus viverra adipiscing at in tellus integer. Purus in massa tempor nec feugiat. Augue neque gravida in fermentum et sollicitudin ac orci. Sodales ut eu sem integer vitae justo eget magna fermentum. Netus et malesuada fames ac. Augue interdum velit euismod in. Sed elementum tempus egestas sed sed risus pretium. Mattis vulputate enim nulla aliquet porttitor lacus luctus. Dui vivamus arcu felis bibendum ut tristique et egestas quis. - -Viverra justo nec ultrices dui sapien. Quisque egestas diam in arcu cursus euismod quis viverra nibh. Nam libero justo laoreet sit amet cursus sit amet. Lacus sed viverra tellus in hac habitasse. Blandit aliquam etiam erat velit scelerisque in. Ut sem nulla pharetra diam sit amet nisl suscipit adipiscing. Diam sollicitudin tempor id eu nisl nunc. Eget duis at tellus at urna condimentum mattis. Urna porttitor rhoncus dolor purus non enim praesent elementum facilisis. Sed turpis tincidunt id aliquet risus feugiat. Est velit egestas dui id ornare arcu odio ut sem. Nibh sit amet commodo nulla facilisi nullam vehicula. Sit amet consectetur adipiscing elit duis tristique sollicitudin. Eu facilisis sed odio morbi. Massa id neque aliquam vestibulum morbi. In eu mi bibendum neque egestas congue quisque egestas. Massa sed elementum tempus egestas sed sed risus. Quam elementum pulvinar etiam non. At augue eget arcu dictum varius duis at consectetur lorem. - -Penatibus et magnis dis parturient montes nascetur ridiculus. Dictumst quisque sagittis purus sit amet volutpat consequat. Bibendum at varius vel pharetra. Sed adipiscing diam donec adipiscing tristique risus nec feugiat in. Phasellus faucibus scelerisque eleifend donec pretium. Vitae tortor condimentum lacinia quis vel eros. Ac tincidunt vitae semper quis lectus nulla at volutpat diam. Eget sit amet tellus cras adipiscing. Morbi tristique senectus et netus. Nullam vehicula ipsum a arcu cursus vitae congue mauris rhoncus. Auctor urna nunc id cursus metus aliquam eleifend. Ultrices vitae auctor eu augue. Eu non diam phasellus vestibulum lorem sed risus ultricies. Fames ac turpis egestas sed tempus. Volutpat blandit aliquam etiam erat. Dictum varius duis at consectetur lorem. Sit amet volutpat consequat mauris nunc congue. Volutpat sed cras ornare arcu dui vivamus arcu felis. - -Scelerisque fermentum dui faucibus in ornare quam viverra. Interdum velit laoreet id donec ultrices tincidunt arcu. Netus et malesuada fames ac. Netus et malesuada fames ac turpis. Suscipit tellus mauris a diam maecenas sed enim ut sem. Id velit ut tortor pretium. Neque aliquam vestibulum morbi blandit cursus risus at. Cum sociis natoque penatibus et magnis dis parturient. Lobortis elementum nibh tellus molestie nunc non blandit. Ipsum dolor sit amet consectetur adipiscing elit duis tristique. Amet nisl purus in mollis. Amet massa vitae tortor condimentum lacinia quis vel eros donec. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. - -Nullam ac tortor vitae purus faucibus. Dis parturient montes nascetur ridiculus mus mauris. Molestie at elementum eu facilisis sed odio morbi. Scelerisque felis imperdiet proin fermentum leo vel orci porta. Lectus proin nibh nisl condimentum id venenatis a. Eget nullam non nisi est sit amet facilisis. Hendrerit gravida rutrum quisque non tellus orci ac auctor. Ut faucibus pulvinar elementum integer enim. Rhoncus dolor purus non enim praesent elementum facilisis. Enim sed faucibus turpis in eu mi bibendum. Faucibus nisl tincidunt eget nullam. - -Cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque. Pretium nibh ipsum consequat nisl vel pretium lectus quam. Semper viverra nam libero justo laoreet sit amet cursus sit. Augue eget arcu dictum varius duis at consectetur lorem donec. Et malesuada fames ac turpis. Erat nam at lectus urna duis convallis convallis. Dictum sit amet justo donec enim. Urna condimentum mattis pellentesque id nibh tortor id. Morbi tempus iaculis urna id. Lectus proin nibh nisl condimentum id venenatis a condimentum. Nibh sit amet commodo nulla facilisi nullam vehicula. Dui faucibus in ornare quam. Gravida arcu ac tortor dignissim convallis aenean. Consectetur adipiscing elit pellentesque habitant morbi tristique. Pulvinar elementum integer enim neque volutpat ac tincidunt vitae. Pharetra pharetra massa massa ultricies mi quis hendrerit. Dictum at tempor commodo ullamcorper a lacus vestibulum sed. Mattis pellentesque id nibh tortor id. Ultricies integer quis auctor elit sed vulputate. Pretium vulputate sapien nec sagittis aliquam malesuada. - -Auctor augue mauris augue neque gravida. Porttitor lacus luctus accumsan tortor posuere ac ut. Urna neque viverra justo nec ultrices dui. Sit amet est placerat in egestas. Urna nec tincidunt praesent semper feugiat nibh sed pulvinar. Tincidunt eget nullam non nisi est sit amet facilisis magna. Elementum tempus egestas sed sed risus pretium quam vulputate dignissim. Fermentum posuere urna nec tincidunt praesent semper feugiat nibh sed. Porttitor eget dolor morbi non arcu risus quis. Non quam lacus suspendisse faucibus interdum. Venenatis cras sed felis eget velit aliquet sagittis id. Arcu ac tortor dignissim convallis aenean et. Morbi tincidunt ornare massa eget egestas purus. Ac feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper. Vestibulum morbi blandit cursus risus at ultrices. Volutpat blandit aliquam etiam erat velit scelerisque. - -Et egestas quis ipsum suspendisse. Amet consectetur adipiscing elit duis. Purus ut faucibus pulvinar elementum integer enim neque. Cursus vitae congue mauris rhoncus aenean vel elit scelerisque mauris. Tincidunt eget nullam non nisi est. Aliquam purus sit amet luctus. Dui ut ornare lectus sit amet est placerat in. Fringilla ut morbi tincidunt augue interdum velit euismod in. Felis eget nunc lobortis mattis aliquam faucibus purus in. Suspendisse interdum consectetur libero id faucibus nisl. - -Scelerisque fermentum dui faucibus in ornare quam. Lectus proin nibh nisl condimentum id venenatis a condimentum vitae. Fames ac turpis egestas integer eget aliquet nibh praesent tristique. Arcu non sodales neque sodales ut etiam sit. Pharetra convallis posuere morbi leo urna. Nec dui nunc mattis enim ut tellus. Nunc sed augue lacus viverra vitae. Consequat id porta nibh venenatis cras sed felis. Dolor sit amet consectetur adipiscing. Tellus rutrum tellus pellentesque eu tincidunt tortor aliquam nulla. - -Metus aliquam eleifend mi in nulla posuere. Blandit massa enim nec dui nunc mattis enim. Aliquet nibh praesent tristique magna. In aliquam sem fringilla ut. Magna fermentum iaculis eu non. Eget aliquet nibh praesent tristique magna sit amet purus. Ultrices gravida dictum fusce ut placerat orci. Fermentum posuere urna nec tincidunt praesent. Enim tortor at auctor urna nunc. Ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel. Sed id semper risus in hendrerit gravida rutrum. Vestibulum lectus mauris ultrices eros in cursus turpis. Et sollicitudin ac orci phasellus egestas tellus rutrum. Pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at. Metus vulputate eu scelerisque felis imperdiet proin fermentum leo. Porta non pulvinar neque laoreet suspendisse. Suscipit adipiscing bibendum est ultricies integer quis auctor elit sed. Euismod in pellentesque massa placerat duis ultricies lacus sed. Pellentesque adipiscing commodo elit at imperdiet dui accumsan sit amet. - -Pellentesque eu tincidunt tortor aliquam nulla facilisi. Commodo nulla facilisi nullam vehicula ipsum a arcu. Commodo quis imperdiet massa tincidunt nunc pulvinar sapien et. Faucibus purus in massa tempor. Purus semper eget duis at tellus at urna condimentum. Vivamus at augue eget arcu dictum. Lacus vel facilisis volutpat est velit egestas dui id. Malesuada fames ac turpis egestas maecenas pharetra. Nunc faucibus a pellentesque sit amet porttitor eget dolor. Ultricies tristique nulla aliquet enim. Vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat. Dignissim diam quis enim lobortis scelerisque. Donec ultrices tincidunt arcu non sodales neque sodales ut etiam. - -Vitae proin sagittis nisl rhoncus mattis rhoncus urna neque. Fermentum leo vel orci porta non. At elementum eu facilisis sed. Quis enim lobortis scelerisque fermentum. Fermentum odio eu feugiat pretium nibh ipsum consequat. Habitant morbi tristique senectus et netus et. Enim praesent elementum facilisis leo vel fringilla est ullamcorper. Egestas quis ipsum suspendisse ultrices gravida dictum. Nam libero justo laoreet sit amet cursus sit amet. Viverra tellus in hac habitasse platea dictumst vestibulum. Varius vel pharetra vel turpis nunc eget. Nullam non nisi est sit amet facilisis magna. Ullamcorper eget nulla facilisi etiam dignissim diam. Ante metus dictum at tempor commodo ullamcorper a lacus. - -Etiam non quam lacus suspendisse. Ut venenatis tellus in metus vulputate eu scelerisque felis. Pulvinar sapien et ligula ullamcorper malesuada proin libero. Consequat interdum varius sit amet mattis. Nunc eget lorem dolor sed viverra ipsum nunc aliquet. Potenti nullam ac tortor vitae purus faucibus ornare. Urna et pharetra pharetra massa massa ultricies mi quis hendrerit. Purus in mollis nunc sed id. Pharetra vel turpis nunc eget lorem dolor sed viverra. Et netus et malesuada fames ac turpis. Libero id faucibus nisl tincidunt eget nullam non nisi. Cursus sit amet dictum sit amet. Porttitor lacus luctus accumsan tortor. - -Volutpat diam ut venenatis tellus in metus vulputate eu scelerisque. Sed viverra tellus in hac habitasse. Aliquam sem et tortor consequat id. Pellentesque habitant morbi tristique senectus et netus et. Consectetur purus ut faucibus pulvinar elementum. Aliquam malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. Malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. Sollicitudin tempor id eu nisl nunc mi ipsum. Fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. Quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Bibendum neque egestas congue quisque egestas. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Pulvinar etiam non quam lacus. Adipiscing commodo elit at imperdiet. Scelerisque eu ultrices vitae auctor. Sed cras ornare arcu dui vivamus arcu felis bibendum ut. Ornare lectus sit amet est. - -Consequat semper viverra nam libero justo laoreet sit. Imperdiet sed euismod nisi porta lorem mollis aliquam ut porttitor. Cras sed felis eget velit aliquet sagittis id consectetur. Dolor morbi non arcu risus quis. Adipiscing tristique risus nec feugiat in fermentum posuere urna. Dolor magna eget est lorem ipsum dolor. Mauris pharetra et ultrices neque ornare aenean euismod. Nulla facilisi etiam dignissim diam quis. Ultrices tincidunt arcu non sodales. Fames ac turpis egestas maecenas pharetra convallis posuere morbi leo. Interdum varius sit amet mattis vulputate. Tincidunt praesent semper feugiat nibh sed pulvinar. Quisque sagittis purus sit amet volutpat. - -Sed vulputate odio ut enim blandit. Vitae auctor eu augue ut lectus arcu bibendum. Consectetur adipiscing elit pellentesque habitant morbi tristique senectus et. Scelerisque eu ultrices vitae auctor eu augue. Etiam dignissim diam quis enim lobortis scelerisque fermentum dui faucibus. Tellus integer feugiat scelerisque varius. Vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor. Amet nisl purus in mollis. Scelerisque viverra mauris in aliquam sem fringilla ut morbi tincidunt. Semper eget duis at tellus at. Erat velit scelerisque in dictum non consectetur a erat nam. Gravida rutrum quisque non tellus orci. Morbi blandit cursus risus at. Mauris sit amet massa vitae. Non odio euismod lacinia at quis risus sed vulputate. Fermentum posuere urna nec tincidunt praesent. Ut eu sem integer vitae justo eget magna fermentum iaculis. Ullamcorper velit sed ullamcorper morbi tincidunt ornare massa. Arcu cursus euismod quis viverra nibh. Arcu dui vivamus arcu felis bibendum. - -Eros in cursus turpis massa tincidunt dui ut. Aarsh shah is simply an amazing person. Urna condimentum mattis pellentesque id nibh tortor id aliquet lectus. Nibh venenatis cras sed felis. Ac felis donec et odio pellentesque diam. Ultricies lacus sed turpis tincidunt id aliquet risus. Diam volutpat commodo sed egestas. Dignissim sodales ut eu sem integer vitae. Pellentesque eu tincidunt tortor aliquam nulla facilisi. Et tortor consequat id porta nibh venenatis cras sed. \ No newline at end of file diff --git a/node/impl/full.go b/node/impl/full.go index 527a5538436..aef7a75cb2a 100644 --- a/node/impl/full.go +++ b/node/impl/full.go @@ -9,7 +9,6 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/node/impl/client" "github.com/filecoin-project/lotus/node/impl/common" "github.com/filecoin-project/lotus/node/impl/full" "github.com/filecoin-project/lotus/node/impl/market" @@ -25,7 +24,6 @@ type FullNodeAPI struct { common.CommonAPI net.NetAPI full.ChainAPI - client.API full.MpoolAPI full.GasAPI market.MarketAPI diff --git a/node/rpc.go b/node/rpc.go index 7a47d1b68ee..ede1b924cd4 100644 --- a/node/rpc.go +++ b/node/rpc.go @@ -2,8 +2,6 @@ package node import ( "context" - "encoding/json" - "fmt" "net" "net/http" _ "net/http/pprof" @@ -11,10 +9,7 @@ import ( "strconv" "time" - "github.com/google/uuid" "github.com/gorilla/mux" - "github.com/gorilla/websocket" - "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log/v2" "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" @@ -27,12 +22,10 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v0api" "github.com/filecoin-project/lotus/api/v1api" - bstore "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/lib/rpcenc" "github.com/filecoin-project/lotus/metrics" "github.com/filecoin-project/lotus/metrics/proxy" "github.com/filecoin-project/lotus/node/impl" - "github.com/filecoin-project/lotus/node/impl/client" ) var rpclog = logging.Logger("rpc") @@ -98,33 +91,6 @@ func FullNodeHandler(a v1api.FullNode, permissioned bool, opts ...jsonrpc.Server serveRpc("/rpc/v1", fnapi) serveRpc("/rpc/v0", v0) - // Import handler - handleImportFunc := handleImport(a.(*impl.FullNodeAPI)) - handleExportFunc := handleExport(a.(*impl.FullNodeAPI)) - handleRemoteStoreFunc := handleRemoteStore(a.(*impl.FullNodeAPI)) - if permissioned { - importAH := &auth.Handler{ - Verify: a.AuthVerify, - Next: handleImportFunc, - } - m.Handle("/rest/v0/import", importAH) - exportAH := &auth.Handler{ - Verify: a.AuthVerify, - Next: handleExportFunc, - } - m.Handle("/rest/v0/export", exportAH) - - storeAH := &auth.Handler{ - Verify: a.AuthVerify, - Next: handleRemoteStoreFunc, - } - m.Handle("/rest/v0/store/{uuid}", storeAH) - } else { - m.HandleFunc("/rest/v0/import", handleImportFunc) - m.HandleFunc("/rest/v0/export", handleExportFunc) - m.HandleFunc("/rest/v0/store/{uuid}", handleRemoteStoreFunc) - } - // debugging m.Handle("/debug/metrics", metrics.Exporter()) m.Handle("/debug/pprof-set/block", handleFractionOpt("BlockProfileRate", runtime.SetBlockProfileRate)) @@ -191,61 +157,6 @@ func MinerHandler(a api.StorageMiner, permissioned bool) (http.Handler, error) { return rootMux, nil } -func handleImport(a *impl.FullNodeAPI) func(w http.ResponseWriter, r *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - if r.Method != "PUT" { - w.WriteHeader(404) - return - } - if !auth.HasPerm(r.Context(), nil, api.PermWrite) { - w.WriteHeader(401) - _ = json.NewEncoder(w).Encode(struct{ Error string }{"unauthorized: missing write permission"}) - return - } - - c, err := a.ClientImportLocal(r.Context(), r.Body) - if err != nil { - w.WriteHeader(500) - _ = json.NewEncoder(w).Encode(struct{ Error string }{err.Error()}) - return - } - w.WriteHeader(200) - err = json.NewEncoder(w).Encode(struct{ Cid cid.Cid }{c}) - if err != nil { - rpclog.Errorf("/rest/v0/import: Writing response failed: %+v", err) - return - } - } -} - -func handleExport(a *impl.FullNodeAPI) func(w http.ResponseWriter, r *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - if r.Method != "GET" { - w.WriteHeader(404) - return - } - if !auth.HasPerm(r.Context(), nil, api.PermWrite) { - w.WriteHeader(401) - _ = json.NewEncoder(w).Encode(struct{ Error string }{"unauthorized: missing write permission"}) - return - } - - var eref api.ExportRef - if err := json.Unmarshal([]byte(r.FormValue("export")), &eref); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - car := r.FormValue("car") == "true" - - err := a.ClientExportInto(r.Context(), eref, car, client.ExportDest{Writer: w}) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - } -} - func handleFractionOpt(name string, setter func(int)) http.HandlerFunc { return func(rw http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost { @@ -272,34 +183,3 @@ func handleFractionOpt(name string, setter func(int)) http.HandlerFunc { setter(fr) } } - -var upgrader = websocket.Upgrader{ - CheckOrigin: func(r *http.Request) bool { - return true - }, -} - -func handleRemoteStore(a *impl.FullNodeAPI) func(w http.ResponseWriter, r *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - vars := mux.Vars(r) - id, err := uuid.Parse(vars["uuid"]) - if err != nil { - http.Error(w, fmt.Sprintf("parse uuid: %s", err), http.StatusBadRequest) - return - } - - c, err := upgrader.Upgrade(w, r, nil) - if err != nil { - log.Error(err) - w.WriteHeader(500) - return - } - - nstore := bstore.NewNetworkStoreWS(c) - if err := a.ApiBlockstoreAccessor.RegisterApiStore(id, nstore); err != nil { - log.Errorw("registering api bstore", "error", err) - _ = c.Close() - return - } - } -} From ba3e26cfe93c8d60e167b80124a6c62f44647a8c Mon Sep 17 00:00:00 2001 From: aarshkshah1992 Date: Thu, 16 May 2024 13:13:40 +0530 Subject: [PATCH 5/6] update go mod --- go.mod | 3 +-- go.sum | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/go.mod b/go.mod index b38f36ae6b0..74745a59430 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,6 @@ require ( github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921 - github.com/buger/goterm v1.0.3 github.com/charmbracelet/lipgloss v0.10.0 github.com/chzyer/readline v1.5.1 github.com/codeskyblue/go-sh v0.0.0-20200712050446-30169cf553fe @@ -127,7 +126,6 @@ require ( github.com/multiformats/go-base32 v0.1.0 github.com/multiformats/go-multiaddr v0.12.3 github.com/multiformats/go-multiaddr-dns v0.3.1 - github.com/multiformats/go-multibase v0.2.0 github.com/multiformats/go-multicodec v0.9.0 github.com/multiformats/go-multihash v0.2.3 github.com/multiformats/go-varint v0.0.7 @@ -289,6 +287,7 @@ require ( github.com/muesli/termenv v0.15.2 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect + github.com/multiformats/go-multibase v0.2.0 // indirect github.com/multiformats/go-multistream v0.5.0 // indirect github.com/nikkolasg/hexjson v0.1.0 // indirect github.com/nkovacs/streamquote v1.0.0 // indirect diff --git a/go.sum b/go.sum index c98d3a32150..dd221b51154 100644 --- a/go.sum +++ b/go.sum @@ -154,8 +154,6 @@ github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3 github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0 h1:J9B4L7e3oqhXOcm+2IuNApwzQec85lE+QaikUcCs+dk= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/buger/goterm v1.0.3 h1:7V/HeAQHrzPk/U4BvyH2g9u+xbUW9nr4yRPyG59W4fM= -github.com/buger/goterm v1.0.3/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= @@ -2059,7 +2057,6 @@ golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210317225723-c4fcb01b228e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From 42a0799c46a8f67accedb9b355efd30cd5aac216 Mon Sep 17 00:00:00 2001 From: aarshkshah1992 Date: Thu, 30 May 2024 13:23:15 +0530 Subject: [PATCH 6/6] changes as per review --- cmd/lotus-miner/sectors.go | 27 +++++++++++++++++++++++++++ documentation/en/cli-lotus-miner.md | 13 +++++++++++++ 2 files changed, 40 insertions(+) diff --git a/cmd/lotus-miner/sectors.go b/cmd/lotus-miner/sectors.go index c05cf37e614..c3217a1a729 100644 --- a/cmd/lotus-miner/sectors.go +++ b/cmd/lotus-miner/sectors.go @@ -45,6 +45,7 @@ var sectorsCmd = &cli.Command{ Subcommands: []*cli.Command{ spcli.SectorsStatusCmd(LMActorOrEnvGetter, getOnDiskInfo), sectorsListCmd, + sectorsRefsCmd, sectorsUpdateCmd, sectorsPledgeCmd, sectorsNumbersCmd, @@ -583,6 +584,32 @@ var sectorsListUpgradeBoundsCmd = &cli.Command{ }, } +var sectorsRefsCmd = &cli.Command{ + Name: "refs", + Usage: "List References to sectors", + Action: func(cctx *cli.Context) error { + nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx) + if err != nil { + return err + } + defer closer() + ctx := lcli.ReqContext(cctx) + + refs, err := nodeApi.SectorsRefs(ctx) + if err != nil { + return err + } + + for name, refs := range refs { + fmt.Printf("Block %s:\n", name) + for _, ref := range refs { + fmt.Printf("\t%d+%d %d bytes\n", ref.SectorID, ref.Offset, ref.Size) + } + } + return nil + }, +} + var sectorsTerminateCmd = &cli.Command{ Name: "terminate", Usage: "Terminate sector on-chain then remove (WARNING: This means losing power and collateral for the removed sector)", diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index 917d9f7dcc7..eb20c634bbd 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -598,6 +598,7 @@ USAGE: COMMANDS: status Get the seal status of a sector by its number list List sectors + refs List References to sectors update-state ADVANCED: manually update the state of a sector, this may aid in error recovery pledge store random data in a sector numbers manage sector number assignments @@ -677,6 +678,18 @@ OPTIONS: --help, -h show help ``` +### lotus-miner sectors refs +``` +NAME: + lotus-miner sectors refs - List References to sectors + +USAGE: + lotus-miner sectors refs [command options] [arguments...] + +OPTIONS: + --help, -h show help +``` + ### lotus-miner sectors update-state ``` NAME: