lnrpc/autopilotrpc: add QueryScores API

Adds a new lnrpc API that lets the caller get ("dry run") the scores
that would be given to a set of node by the available autopilot
heuristics.
This commit is contained in:
Johan T. Halseth
2018-12-19 14:54:55 +01:00
parent 8f54a2bd6f
commit a654be5884
2 changed files with 219 additions and 22 deletions

View File

@@ -18,6 +18,13 @@ service Autopilot {
enabling or disabling it.
*/
rpc ModifyStatus(ModifyStatusRequest) returns (ModifyStatusResponse);
/**
QueryScores queries all available autopilot heuristics, in addition to any
active combination of these heruristics, for the scores they would give to
the given nodes.
*/
rpc QueryScores(QueryScoresRequest) returns (QueryScoresResponse);
}
message StatusRequest{
@@ -34,3 +41,16 @@ message ModifyStatusRequest{
}
message ModifyStatusResponse {}
message QueryScoresRequest{
repeated string pubkeys = 1 [json_name = "pubkeys"];
}
message QueryScoresResponse {
message HeuristicResult {
string heuristic = 1 [json_name = "heuristic"];
map<string, double> scores= 2 [json_name = "scores"];
}
repeated HeuristicResult results = 1 [json_name = "results"];
}