Skip to content

Commit

Permalink
feat: market: add api DagstoreDestroyShards
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Mar 24, 2023
1 parent 0c81d3d commit 19d5c76
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 0 deletions.
3 changes: 3 additions & 0 deletions venus-shared/api/market/v0/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ type IMarket interface {
// DagstoreGC runs garbage collection on the DAG store.
DagstoreGC(ctx context.Context) ([]market.DagstoreShardResult, error) //perm:admin

// DagstoreDestroyShards destroy shards by keys
DagstoreDestroyShards(ctx context.Context, keys []string) error //perm:admin

MarkDealsAsPacking(ctx context.Context, miner address.Address, deals []abi.DealID) error //perm:write
UpdateDealOnPacking(ctx context.Context, miner address.Address, dealID abi.DealID, sectorid abi.SectorNumber, offset abi.PaddedPieceSize) error //perm:write
UpdateDealStatus(ctx context.Context, miner address.Address, dealID abi.DealID, pieceStatus market.PieceStatus) error //perm:write
Expand Down
18 changes: 18 additions & 0 deletions venus-shared/api/market/v0/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ curl http://<ip>:<port>/rpc/v0 -X POST -H "Content-Type: application/json" -H "
* [AddFsPieceStorage](#addfspiecestorage)
* [AddS3PieceStorage](#adds3piecestorage)
* [AssignUnPackedDeals](#assignunpackeddeals)
* [DagstoreDestroyShards](#dagstoredestroyshards)
* [DagstoreGC](#dagstoregc)
* [DagstoreInitializeAll](#dagstoreinitializeall)
* [DagstoreInitializeShard](#dagstoreinitializeshard)
Expand Down Expand Up @@ -272,6 +273,23 @@ Response:
]
```

### DagstoreDestroyShards
DagstoreDestroyShards destroy shards by keys


Perms: admin

Inputs:
```json
[
[
"string value"
]
]
```

Response: `{}`

### DagstoreGC
DagstoreGC runs garbage collection on the DAG store.

Expand Down
14 changes: 14 additions & 0 deletions venus-shared/api/market/v0/mock/mock_imarket.go

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

4 changes: 4 additions & 0 deletions venus-shared/api/market/v0/proxy_gen.go

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

3 changes: 3 additions & 0 deletions venus-shared/api/market/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ type IMarket interface {
// DagstoreGC runs garbage collection on the DAG store.
DagstoreGC(ctx context.Context) ([]market.DagstoreShardResult, error) //perm:admin

// DagstoreDestroyShards destroy shards by keys
DagstoreDestroyShards(ctx context.Context, keys []string) error //perm:admin

MarkDealsAsPacking(ctx context.Context, miner address.Address, deals []abi.DealID) error //perm:write
UpdateDealOnPacking(ctx context.Context, miner address.Address, dealID abi.DealID, sectorid abi.SectorNumber, offset abi.PaddedPieceSize) error //perm:write
UpdateDealStatus(ctx context.Context, miner address.Address, dealID abi.DealID, pieceStatus market.PieceStatus, dealStatus storagemarket.StorageDealStatus) error //perm:write
Expand Down
18 changes: 18 additions & 0 deletions venus-shared/api/market/v1/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ curl http://<ip>:<port>/rpc/v1 -X POST -H "Content-Type: application/json" -H "
* [AddFsPieceStorage](#addfspiecestorage)
* [AddS3PieceStorage](#adds3piecestorage)
* [AssignUnPackedDeals](#assignunpackeddeals)
* [DagstoreDestroyShards](#dagstoredestroyshards)
* [DagstoreGC](#dagstoregc)
* [DagstoreInitializeAll](#dagstoreinitializeall)
* [DagstoreInitializeShard](#dagstoreinitializeshard)
Expand Down Expand Up @@ -273,6 +274,23 @@ Response:
]
```

### DagstoreDestroyShards
DagstoreDestroyShards destroy shards by keys


Perms: admin

Inputs:
```json
[
[
"string value"
]
]
```

Response: `{}`

### DagstoreGC
DagstoreGC runs garbage collection on the DAG store.

Expand Down
14 changes: 14 additions & 0 deletions venus-shared/api/market/v1/mock/mock_imarket.go

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

4 changes: 4 additions & 0 deletions venus-shared/api/market/v1/proxy_gen.go

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

0 comments on commit 19d5c76

Please sign in to comment.