Waves icon indicating copy to clipboard operation
Waves copied to clipboard

Active leases and balance details at height

Open bodrych opened this issue 6 years ago • 10 comments

Аbstract There is no node API for obtaining active leases and balance details at a certain height

Motivation and Purposes It would be useful for leasing reward calculations

Specification /leasing/active/{address}/{height} /addresses/balance/details/{address}/{height}

Backwards Compatibility The proposition can't affect any existing features

bodrych avatar Dec 26 '19 22:12 bodrych

Hi. Such API will be developed in data-services next year - approximetally February.

pivoo19 avatar Dec 27 '19 14:12 pivoo19

Still there's no such API in data services neither node. I agree with bodrych that it would be useful for leasing reward calculations

BoxiGod avatar Sep 28 '20 07:09 BoxiGod

Hi, yes. The development of dataservices is postponed. If this would be developed in the node then there is a limit of 2000 blocks in depth for such things. But there is an extension will be published soon, which can help you to develop own service for this. Here is PR for it https://github.com/wavesplatform/Waves/pull/3226

Soon the docs and howto will be available for this extension.

pivoo19 avatar Sep 28 '20 12:09 pivoo19

btw, why do you need active leases at certain height ?

pivoo19 avatar Sep 28 '20 12:09 pivoo19

there is a limit of 2000 blocks

that can be increased :upside_down_face:

bodrych avatar Sep 28 '20 14:09 bodrych

yes. it can be increased even now with config file, but it will increase Node state size.

pivoo19 avatar Oct 04 '20 08:10 pivoo19

@pivoo81 not extremely :) I have increased it to 3,000,000 blocks when waves-metrics was alive

bodrych avatar Oct 04 '20 18:10 bodrych

So what about the use case for active leases at height ? what algorythm would you implement for reward calculations ?

pivoo19 avatar Oct 13 '20 07:10 pivoo19

@bodrych in this case not only state size is increasing. In current implementation all operations (reading and writing) are slowering because of database size.

pivoo19 avatar Oct 13 '20 10:10 pivoo19

In my case I have a telegram bot(@BoxiNodeBot), this bot is sending live messages of distributed rewards of the mined block for each leaser. So, the bot is monitoring blocks in real-time and calculating rewards in real-time(it's cool as leasers can see their rewards in real-time). Active leases at height will be very useful as I will use it in the bot for every mined block to calculate it more precisely if the bot will miss blocks for any reason. For now, I have a script for it(it super slow actually), but it would be better if will be just an API call

BoxiGod avatar Oct 13 '20 13:10 BoxiGod