Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add market support #4

Merged
merged 19 commits into from
Feb 13, 2025
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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ go-gen:
go generate ./...

gen: go-gen curio-rpc-gen type-gen

clean:
rm -f curio-dashboard
cd ui && rm -rf dist node_modules
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require (
github.com/ipfs/go-ipld-cbor v0.2.0
github.com/ipfs/go-log/v2 v2.5.1
github.com/labstack/echo/v4 v4.12.0
github.com/libp2p/go-libp2p v0.37.2
github.com/multiformats/go-multiaddr v0.13.0
github.com/pelletier/go-toml v1.2.0
github.com/prometheus/client_golang v1.20.5
Expand Down Expand Up @@ -161,7 +162,6 @@ require (
github.com/lib/pq v1.10.9 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.2.0 // indirect
github.com/libp2p/go-libp2p v0.37.2 // indirect
github.com/libp2p/go-libp2p-pubsub v0.12.0 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
Expand Down
8 changes: 6 additions & 2 deletions gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,18 @@ models:
- github.com/99designs/gqlgen/graphql.Int64
ActorID:
model: "github.com/strahe/curio-dashboard/types.ActorID"
ByteArray:
model: "github.com/strahe/curio-dashboard/types.ByteArray"
Bytes:
model: "github.com/strahe/curio-dashboard/types.Bytes"
Address:
model: "github.com/strahe/curio-dashboard/types.Address"
BigInt:
model: "github.com/strahe/curio-dashboard/types.BigInt"
JSONB:
model: "github.com/strahe/curio-dashboard/types.JSONB"
FIL:
model: "github.com/strahe/curio-dashboard/types.FIL"
PeerID:
model: "github.com/strahe/curio-dashboard/types.PeerID"
Porep:
fields:
id:
Expand Down
208 changes: 208 additions & 0 deletions graph/curiorpc/proxy_gen.go

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

19 changes: 19 additions & 0 deletions graph/curiorpc/webrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ type WebRPC interface {
UpgradeResetTaskIDs(ctx context.Context, spid, sectorNum uint64) error
UpgradeDelete(ctx context.Context, spid, sectorNum uint64) error
WinStats(ctx context.Context) ([]webrpc.WinStats, error)

SetStorageAsk(ctx context.Context, ask *webrpc.StorageAsk) error
MarketBalance(ctx context.Context) ([]webrpc.MarketBalanceStatus, error)
MoveBalanceToEscrow(ctx context.Context, miner string, amount string, wallet string) (string, error)
GetPriceFilters(ctx context.Context) ([]webrpc.PriceFilter, error)
SetPriceFilters(ctx context.Context, name string, minDur, maxDur int, minSize, maxSize int64, price int64, verified bool) error
AddPriceFilters(ctx context.Context, name string, minDur, maxDur int, minSize, maxSize int64, price int64, verified bool) error
RemovePricingFilter(ctx context.Context, name string) error
GetClientFilters(ctx context.Context) ([]webrpc.ClientFilter, error)
SetClientFilters(ctx context.Context, name string, active bool, wallets, peers []string, filters []string, maxDealPerHour, maxDealSizePerHour int64, info string) error
AddClientFilters(ctx context.Context, name string, active bool, wallets, peers []string, filters []string, maxDealPerHour, maxDealSizePerHour int64, info string) error
RemoveClientFilter(ctx context.Context, name string) error

// Client Address Allow/Deny
GetAllowDenyList(ctx context.Context) ([]webrpc.AllowDeny, error)
SetAllowDenyList(ctx context.Context, wallet string, status bool) error
AddAllowDenyList(ctx context.Context, wallet string, status bool) error
RemoveAllowFilter(ctx context.Context, wallet string) error
DefaultAllowBehaviour(ctx context.Context) (bool, error)
}

type sectorListEntry struct {
Expand Down
Loading