Active leases and balance details at height
А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
Hi. Such API will be developed in data-services next year - approximetally February.
Still there's no such API in data services neither node. I agree with bodrych that it would be useful for leasing reward calculations
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.
btw, why do you need active leases at certain height ?
there is a limit of 2000 blocks
that can be increased :upside_down_face:
yes. it can be increased even now with config file, but it will increase Node state size.
@pivoo81 not extremely :) I have increased it to 3,000,000 blocks when waves-metrics was alive
So what about the use case for active leases at height ? what algorythm would you implement for reward calculations ?
@bodrych in this case not only state size is increasing. In current implementation all operations (reading and writing) are slowering because of database size.
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