koinos / koinos-cli

A command line utility used for key management and to interact with the Koinos blockchain.
Other
9 stars 7 forks source link

[FEATURE]: Simplified rclimit management when payer is another wallet #168

Open lukemwillis opened 1 year ago

lukemwillis commented 1 year ago

Is there an existing issue for this?

New feature

Currently, managing rclimit with delegated mana is manual.

🔓 > rclimit
Current rc limit: 10.000000

🔓 > rclimit 100
Set rc limit to 100.000000

🔓 > upload contract.wasm contract.abi
cannot upload contract, payer does not have the rc to cover transaction rc limit

🔓 > rclimit 90
Set rc limit to 90.000000

🔓 > upload contract.wasm contract.abi
Contract uploaded with address <some-address>
Transaction with ID <some-id> containing 1 operations submitted.
Mana cost: 11.20280306 (Disk: 43604, Network: 48962, Compute: 680636)

If the delegator has a lot of mana, it's easy, but it would be easier if you could set it as a percentage of the payer's mana balance. Similar to the default experience where it's set to 100% of the current wallet's mana balance.

🔓 > rclimit
Current rc limit: 100.000000% (10117.572038)

Anything else?

No response

sgerbino commented 1 year ago

You should be able to do: rclimit 10%, is that the feature you are proposing?

Ah, when you set rclimit 10% it should consider who the payer is. That makes sense.

koinos-ci commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

roaminro commented 1 year ago

FYI, the line that needs to be udpated: https://github.com/koinos/koinos-cli/blob/43f03e1571fb5e242c05b651e8c0cb069cb7b34f/internal/cli/interpreter.go#L203

Should be

limit, err := ee.RPCClient.GetAccountRc(ctx, ee.GetPayerAddress())
mvandeberg commented 1 year ago

If it is a one line change, could you make a PR?