Skip to content

Commit

Permalink
feat: get signer deal
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Mar 16, 2023
1 parent 73746ce commit daf0ec6
Show file tree
Hide file tree
Showing 8 changed files with 352 additions and 0 deletions.
2 changes: 2 additions & 0 deletions venus-shared/api/market/v0/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ type IMarket interface {
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:admin
MarketImportPublishedDeal(ctx context.Context, deal market.MinerDeal) error //perm:write
MarketListDeals(ctx context.Context, addrs []address.Address) ([]*types.MarketDeal, error) //perm:read
MarketGetDeal(ctx context.Context, dealPropCid cid.Cid) (*market.MinerDeal, error) //perm:read
MarketListRetrievalDeals(ctx context.Context) ([]market.ProviderDealState, error) //perm:read
MarketGetRetrievalDeal(ctx context.Context, receiver peer.ID, dealID uint64) (*market.ProviderDealState, error) //perm:read
MarketGetDealUpdates(ctx context.Context) (<-chan market.MinerDeal, error) //perm:admin
MarketListIncompleteDeals(ctx context.Context, mAddr address.Address) ([]market.MinerDeal, error) //perm:read
MarketSetAsk(ctx context.Context, mAddr address.Address, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error //perm:admin
Expand Down
136 changes: 136 additions & 0 deletions venus-shared/api/market/v0/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ curl http://<ip>:<port>/rpc/v0 -X POST -H "Content-Type: application/json" -H "
* [MarketDataTransferPath](#marketdatatransferpath)
* [MarketDataTransferUpdates](#marketdatatransferupdates)
* [MarketGetAsk](#marketgetask)
* [MarketGetDeal](#marketgetdeal)
* [MarketGetDealUpdates](#marketgetdealupdates)
* [MarketGetReserved](#marketgetreserved)
* [MarketGetRetrievalAsk](#marketgetretrievalask)
* [MarketGetRetrievalDeal](#marketgetretrievaldeal)
* [MarketImportDealData](#marketimportdealdata)
* [MarketImportPublishedDeal](#marketimportpublisheddeal)
* [MarketListDataTransfers](#marketlistdatatransfers)
Expand Down Expand Up @@ -1134,6 +1136,89 @@ Response:
}
```

### MarketGetDeal


Perms: read

Inputs:
```json
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]
```

Response:
```json
{
"Proposal": {
"PieceCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1032,
"VerifiedDeal": true,
"Client": "f01234",
"Provider": "f01234",
"Label": "",
"StartEpoch": 10101,
"EndEpoch": 10101,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ClientSignature": {
"Type": 2,
"Data": "Ynl0ZSBhcnJheQ=="
},
"ProposalCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"AddFundsCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PublishCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Miner": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"Client": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"State": 42,
"PiecePath": "/some/path",
"PayloadSize": 42,
"MetadataPath": "/some/path",
"SlashEpoch": 10101,
"FastRetrieval": true,
"Message": "string value",
"FundsReserved": "0",
"Ref": {
"TransferType": "string value",
"Root": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PieceSize": 1024,
"RawBlockSize": 42
},
"AvailableForRetrieval": true,
"DealID": 5432,
"CreationTime": "0001-01-01T00:00:00Z",
"TransferChannelId": {
"Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"ID": 3
},
"SectorNumber": 9,
"Offset": 1032,
"PieceStatus": "Undefine",
"InboundCAR": "string value",
"CreatedAt": 42,
"UpdatedAt": 42
}
```

### MarketGetDealUpdates


Expand Down Expand Up @@ -1246,6 +1331,57 @@ Response:
}
```

### MarketGetRetrievalDeal


Perms: read

Inputs:
```json
[
"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
42
]
```

Response:
```json
{
"PayloadCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"ID": 5,
"Selector": {
"Raw": "Ynl0ZSBhcnJheQ=="
},
"PieceCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"PricePerByte": "0",
"PaymentInterval": 42,
"PaymentIntervalIncrease": 42,
"UnsealPrice": "0",
"StoreID": 42,
"SelStorageProposalCid": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"ChannelID": {
"Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"ID": 3
},
"Status": 0,
"Receiver": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf",
"TotalSent": 42,
"FundsReceived": "0",
"Message": "string value",
"CurrentInterval": 42,
"LegacyProtocol": true,
"CreatedAt": 42,
"UpdatedAt": 42
}
```

### MarketImportDealData


Expand Down
30 changes: 30 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.

8 changes: 8 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.

2 changes: 2 additions & 0 deletions venus-shared/api/market/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ type IMarket interface {
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:admin
MarketImportPublishedDeal(ctx context.Context, deal market.MinerDeal) error //perm:write
MarketListDeals(ctx context.Context, addrs []address.Address) ([]*types.MarketDeal, error) //perm:read
MarketGetDeal(ctx context.Context, dealPropCid cid.Cid) (*market.MinerDeal, error) //perm:read
MarketListRetrievalDeals(ctx context.Context) ([]market.ProviderDealState, error) //perm:read
MarketGetRetrievalDeal(ctx context.Context, receiver peer.ID, dealID uint64) (*market.ProviderDealState, error) //perm:read
MarketGetDealUpdates(ctx context.Context) (<-chan market.MinerDeal, error) //perm:admin
MarketListIncompleteDeals(ctx context.Context, mAddr address.Address) ([]market.MinerDeal, error) //perm:read
MarketSetAsk(ctx context.Context, mAddr address.Address, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error //perm:admin
Expand Down
Loading

0 comments on commit daf0ec6

Please sign in to comment.