Allow for settling of accountant promises - #1421
Merged
Merged
Conversation
Initial implementation of the accountant promise settling. The promise settler is launched on node start. Once launched, it checks the local keystore for addresses. For each address, it keeps a state in memory. The state is loaded from BC and local DB. The state stores the current balance information as well as registration status for the provider. It also listens for service start events, and performs the steps mentioned above if a new identity is used for service start. It is also listening for events that are emitted once a new accountant promise is emitted. These events cause the internal state to be updated with the latest promise. After the mentioned state update a check is performed. If the current balance is less than the threshold * available balance it indicates it's time to settle the promise. The settle part is missing still, as the transactor is missing the relevant endpoint. Updates #1413
soffokl
approved these changes
Nov 25, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial implementation of the accountant promise settling.
The promise settler is launched on node start.
Once launched, it checks the local keystore for addresses.
For each address, it keeps a state in memory. The state is loaded from BC and local DB.
The state stores the current balance information as well as registration status for the provider.
It also listens for service start events, and performs the steps mentioned above if a new identity is used for service start.
It is also listening for events that are emitted once a new accountant promise is emitted. These events cause the internal state to be updated with the latest promise.
After the mentioned state update a check is performed. If the current balance is less than the threshold * available balance it indicates it's time to settle the promise.
The settle part is missing still, as the transactor is missing the relevant endpoint.
Updates #1413