lnrpc: add API SetScores

Used to set the external scores for the running autopilot agent.
This commit is contained in:
Johan T. Halseth
2019-02-14 11:37:47 +01:00
parent 749d9cccca
commit 83edcb7153
3 changed files with 195 additions and 35 deletions

View File

@@ -25,6 +25,12 @@ service Autopilot {
the given nodes.
*/
rpc QueryScores(QueryScoresRequest) returns (QueryScoresResponse);
/**
SetScores attempts to set the scores used by the running autopilot agent,
if the external scoring heuristic is enabled.
*/
rpc SetScores(SetScoresRequest) returns (SetScoresResponse);
}
message StatusRequest{
@@ -54,3 +60,16 @@ message QueryScoresResponse {
repeated HeuristicResult results = 1 [json_name = "results"];
}
message SetScoresRequest{
/// The name of the heuristic to provide scores to.
string heuristic = 1 [json_name = "heuristic"];
/**
A map from hex-encoded public keys to scores. Scores must be in the range
[0.0, 1.0].
*/
map<string, double> scores = 2 [json_name = "scores"];
}
message SetScoresResponse {}