Skip to content

Commit

Permalink
feat: update doc about deal filter
Browse files Browse the repository at this point in the history
  • Loading branch information
LinZexiao committed May 17, 2023
1 parent 59357e3 commit 360097f
Showing 1 changed file with 25 additions and 20 deletions.
45 changes: 25 additions & 20 deletions docs/zh/订单过滤器.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,29 @@
```json
{
"IsOffline": false,
"Proposal": {
"PieceCID": {
"/": "baga6ea4seaqihx2pxanewwxvqwgeyrcmal7aomucelef52vhqy7qaarciamaqoq"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "f3r3hr3xl27unpefvipve2f4hlfvdnq3forgr253z6dqahufvanatdandxm74zikheccvx74ys7by5vzafq2va",
"Provider": "f01000",
"Label": "bafk2bzacebiupsywspqnsvc5v7ing74i3u4y3r7wtgjioor7pqn3cxopq7lo4",
"StartEpoch": 18171,
"EndEpoch": 536571,
"StoragePricePerEpoch": "1",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ClientSignature": {
"Type": 2,
"Data": "oEnUUL1WejrLawl3sP9o/TZYRZgPYA86xmF3RMQt5bPQJbrK/5x3UXYxeUKoIDMjE96fA1GSqfrE14tFl/nMyatPLUvzzZ0ulsPTQVwfb54Mgx0yBSMYTf/O8Bg09MNq"
"FormatVersion": "1.0.0",
"FastRetrieval": false,
"TransferType" : "manual",
"ClientDealProposal":{
"Proposal": {
"PieceCID": {
"/": "baga6ea4seaqihx2pxanewwxvqwgeyrcmal7aomucelef52vhqy7qaarciamaqoq"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "f3r3hr3xl27unpefvipve2f4hlfvdnq3forgr253z6dqahufvanatdandxm74zikheccvx74ys7by5vzafq2va",
"Provider": "f01000",
"Label": "bafk2bzacebiupsywspqnsvc5v7ing74i3u4y3r7wtgjioor7pqn3cxopq7lo4",
"StartEpoch": 18171,
"EndEpoch": 536571,
"StoragePricePerEpoch": "1",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ClientSignature": {
"Type": 2,
"Data": "oEnUUL1WejrLawl3sP9o/TZYRZgPYA86xmF3RMQt5bPQJbrK/5x3UXYxeUKoIDMjE96fA1GSqfrE14tFl/nMyatPLUvzzZ0ulsPTQVwfb54Mgx0yBSMYTf/O8Bg09MNq"
},
},
"DealType": "storage",
"Agent": "venus-market"
Expand Down Expand Up @@ -95,7 +100,7 @@ Filter = "exit 0"
- 例子: 只接受来自 `f01000` 的订单

```toml
Filter = "jq -r '.Proposal.Provider' | grep -q '^f01000$'"
Filter = "jq -r '.ClientDealProposal.Proposal.Provider' | grep -q '^f01000$'"
```

- 例子: 使用 `python` 脚本
Expand All @@ -114,7 +119,7 @@ try:
json_str = sys.stdin.read()
data = json.loads(json_str)

if data['Proposal']['PieceSize'] < 2048:
if data["ClientDealProposal"]['Proposal']['PieceSize'] < 2048:
print("")
sys.exit(0)
else:
Expand Down

0 comments on commit 360097f

Please sign in to comment.