blocknetdx / exrproxy-env

erp-ethserver
7 stars 10 forks source link

Option to `cli/projects.py` to display addrs containing non-zero balances #209

Closed ConanMishler closed 1 year ago

ConanMishler commented 1 year ago

To make it easy for SNode operators to withdraw funds received for XQuery/Hydra services rendered, it will be useful to add an option to cli/projects/py which displays addr & priv key of all addrs containing non-zero balances.

IMPORTANT: This option should also display whether or not the project associated with each such address is in the pending state, which is the state a project goes into for 1 hour after create_project or extend_project method has been called for the project. (Pending = activation/extension pending payment.)The option should color addresses of projects in the pending state in RED color and display a message for the SNode op saying: "IMPORTANT: Do NOT withdraw funds from any addresses in the pending state as there is a slight risk it could cause a client's deposit to be ignored by the Payment Processor."

shrnkld commented 1 year ago

Isn't this what ./projects.py --host IP --balances is supposed to do already (but doesn't) ?

--balances should "show all payments and their details" but instead it returns a list of all projects with their associated priv key.

I'd suggest we change this to only show projects containing non-zero balances as you describe above.

ConanMishler commented 1 year ago

I'd suggest we change this to only show projects containing non-zero balances as you describe above.

I wasn't aware there was already a --balances option. Yes, we should refine this existing --balances option so it only returns details of payment addresses containing non-zero balances. It should also display those details in an easily readable format (unlike the current --balances option). And lastly, it should color the displayed data RED if the project is currently in a pending state, and mention that the SNode OP should NOT withdraw from any project/address in a pending state because there is a extremely small chance it could cause a client's payment to go unacknowledged if the SNode OP withdraws from an address at exactly the same time (within 10 seconds) that a client sends funds to that same address.