我试图通过Python API Yapapi在Golem上运行一个任务,但它说我没有足够的资金进行分配。当我查看yagna payment status --driver zksync
时,它说我有很多资金处于保留状态。
我该怎么把它们弄出来?
Status for account: [redacted]
┌────────────────────┬───────────────────────────────┬───────────────────────────────┬─────────────┬────────────┬────────────────────────────────┐
│ platform │ total amount │ reserved │ amount │ incoming │ outgoing │
├────────────────────┼───────────────────────────────┼───────────────────────────────┼─────────────┼────────────┼────────────────────────────────┤
│ driver: zksync │ 111.271646252988321632 GLM │ 106.310490959782071751 GLM │ accepted │ 0 GLM │ 305.416973117029318531 GLM │
│ network: mainnet │ │ │ confirmed │ 0 GLM │ 14.533081348947285750 GLM │
│ token: GLM │ │ │ requested │ 0 GLM │ 853.498111482561896347 GLM │
└────────────────────┴───────────────────────────────┴───────────────────────────────┴─────────────┴────────────┴────────────────────────────────┘
Golem在当前阶段(v0.8.0(没有任何内置功能来自动清空保留状态。因此,您可以使用此bash脚本联系当地API以清除保留资金。
#!/bin/bash
appkey="$(yagna app-key list --json | jq -r .values[0][1])"
auth=("--header" "authorization: Bearer ${appkey}")
api_url="http://127.0.0.1:7465/payment-api/v1"
allocation_ids="$(curl "${auth[@]}" "${api_url}/allocations" | jq -r '.[]["allocationId"]')"
for allocation_id in ${allocation_ids}; do
curl "${auth[@]}" -X DELETE "${api_url}/allocations/${allocation_id}"
done