Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active leases and balance details at height #2854

Open
bodrych opened this issue Dec 26, 2019 · 10 comments
Open

Active leases and balance details at height #2854

bodrych opened this issue Dec 26, 2019 · 10 comments
Assignees
Labels

Comments

@bodrych
Copy link

bodrych commented Dec 26, 2019

А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

@pivoo81
Copy link
Member

pivoo81 commented Dec 27, 2019

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

@BoxiGod
Copy link

BoxiGod commented Sep 28, 2020

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

@pivoo81
Copy link
Member

pivoo81 commented Sep 28, 2020

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 #3226

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

@pivoo81
Copy link
Member

pivoo81 commented Sep 28, 2020

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

@bodrych
Copy link
Author

bodrych commented Sep 28, 2020

there is a limit of 2000 blocks

that can be increased 🙃

@pivoo81
Copy link
Member

pivoo81 commented Oct 4, 2020

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

@bodrych
Copy link
Author

bodrych commented Oct 4, 2020

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

@pivoo81
Copy link
Member

pivoo81 commented Oct 13, 2020

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

@pivoo81
Copy link
Member

pivoo81 commented Oct 13, 2020

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

@BoxiGod
Copy link

BoxiGod commented Oct 13, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants