Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package api
// * Generate openrpc blobs

type Boost interface {
Market
Common
Net
}
Expand Down
29 changes: 29 additions & 0 deletions api/market.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package api

import (
"context"
"time"
)

// MODIFYING THE API INTERFACE
//
// When adding / changing methods in this file:
// * Do the change here
// * Adjust implementation in `node/impl/`
// * Run `make gen` - this will:
// * Generate proxy structs
// * Generate mocks
// * Generate markdown docs
// * Generate openrpc blobs

type Market interface {
// MethodGroup: Market

MarketDummyDeal(context.Context) (*ProviderDealRejectionInfo, error) //perm:admin
}

// ProviderDealRejectionInfo is the information sent by the Storage Provider to the Client when it rejects a valid deal.
type ProviderDealRejectionInfo struct {
Reason string
Backoff time.Duration
}
27 changes: 26 additions & 1 deletion api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions cmd/boost/dummydeal.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package main

import (
"github.com/davecgh/go-spew/spew"
"fmt"

"github.com/urfave/cli/v2"
"golang.org/x/xerrors"

Expand All @@ -21,14 +22,17 @@ var dummydealCmd = &cli.Command{

ctx := lcli.DaemonContext(cctx)

log.Debug("Get boost identity")

res, err := boostApi.ID(ctx)
log.Debug("Make API call to start dummy deal")
rej, err := boostApi.MarketDummyDeal(ctx)
if err != nil {
return xerrors.Errorf("couldnt get boost identity: %w", err)
return xerrors.Errorf("creating dummy deal: %w", err)
}

spew.Dump(res)
if rej != nil && rej.Reason != "" {
fmt.Printf("Dummy deal rejected: %s\n", rej.Reason)
return nil
}
fmt.Println("Made dummy deal")

return nil
},
Expand Down
2 changes: 2 additions & 0 deletions cmd/boost/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const (

func main() {
_ = logging.SetLogLevel("boost", "INFO")
_ = logging.SetLogLevel("provider", "INFO")
_ = logging.SetLogLevel("gql", "INFO")

app := &cli.App{
Name: "boost",
Expand Down
7 changes: 0 additions & 7 deletions gql.go

This file was deleted.

66 changes: 0 additions & 66 deletions gql/mocktransfer.go

This file was deleted.

Loading