我试着通过Python在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 │
└────────────────────┴───────────────────────────────┴───────────────────────────────┴─────────────┴────────────┴────────────────────────────────┘发布于 2021-11-24 13:32:58
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}"
donehttps://stackoverflow.com/questions/70097006
复制相似问题