akash-network / support

Akash Support and Issue Tracking
5 stars 4 forks source link

feature-request: provider to send earned funds to an external account automatically when a threshold is reached #12

Open andy108369 opened 1 year ago

andy108369 commented 1 year ago

Rationale

Provider pod needs to be stopped for the provider owner to use the earned funds.

This also requires manual intervention for stopping the provider and issuing the transaction. Having a provider wallet anywhere beyond the provider pod (keplr, laptop) is an anti-pattern.

It also makes provider scaling PITA as provider owner would have to do all of the above on each.

The provider could automatically send the earned funds to an external akash1... account (typically owned by the provider owner) when a certain threshold is reached.

Implementation ideas

The provider could have two additional options such as these:

--beneficiary-account                   Beneficiary account address for sending earned funds to, once the withdrawal threshold is reached
--beneficiary-withdrawal-threshold      Provider account balance withdrawal threshold (minus --minimum-balance) to beneficiary account (default 10000000)

So that the provider would be sending earned funds to an external account once it reaches the threshold (--beneficiary-withdrawal-threshold), which is 10 AKT by default.

The CLI arguments, descriptions, and defaults can be re-worded/different, but that's what I came up with so to give the idea and avoid semantic collisions with the current arguments:

$ provider-services run --help
...
  -a, --account-number uint                         The account number of the signing account (offline mode only)
      --fee-account string                          Fee account pays fees for the transaction instead of deducting from the signer
      --withdrawal-period duration                  period at which withdrawals are made from the escrow accounts (default 24h0m0s)
      --lease-funds-monitor-interval duration       interval at which the lease is checked for funds available on the escrow accounts. >= 1m (default 10m0s)
...