2018-12-13 14:26:29 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package autopilotrpc;
|
|
|
|
|
2018-12-11 13:42:43 +03:00
|
|
|
option go_package = "github.com/lightningnetwork/lnd/lnrpc/autopilotrpc";
|
|
|
|
|
2018-12-13 14:26:29 +03:00
|
|
|
// Autopilot is a service that can be used to get information about the current
|
|
|
|
// state of the daemon's autopilot agent, and also supply it with information
|
|
|
|
// that can be used when deciding where to open channels.
|
|
|
|
service Autopilot {
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2018-12-13 14:26:29 +03:00
|
|
|
Status returns whether the daemon's autopilot agent is active.
|
|
|
|
*/
|
2020-02-11 15:56:08 +03:00
|
|
|
rpc Status (StatusRequest) returns (StatusResponse);
|
2018-12-13 14:26:29 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2018-12-13 14:26:29 +03:00
|
|
|
ModifyStatus is used to modify the status of the autopilot agent, like
|
|
|
|
enabling or disabling it.
|
|
|
|
*/
|
2020-02-11 15:56:08 +03:00
|
|
|
rpc ModifyStatus (ModifyStatusRequest) returns (ModifyStatusResponse);
|
2018-12-19 16:54:55 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2018-12-19 16:54:55 +03:00
|
|
|
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.
|
|
|
|
*/
|
2020-02-11 15:56:08 +03:00
|
|
|
rpc QueryScores (QueryScoresRequest) returns (QueryScoresResponse);
|
2019-02-14 13:37:47 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-02-14 13:37:47 +03:00
|
|
|
SetScores attempts to set the scores used by the running autopilot agent,
|
|
|
|
if the external scoring heuristic is enabled.
|
|
|
|
*/
|
2020-02-11 15:56:08 +03:00
|
|
|
rpc SetScores (SetScoresRequest) returns (SetScoresResponse);
|
2018-12-13 14:26:29 +03:00
|
|
|
}
|
|
|
|
|
2020-02-11 15:56:08 +03:00
|
|
|
message StatusRequest {
|
2018-12-13 14:26:29 +03:00
|
|
|
}
|
|
|
|
|
2020-02-11 15:56:08 +03:00
|
|
|
message StatusResponse {
|
2020-05-06 17:51:14 +03:00
|
|
|
// Indicates whether the autopilot is active or not.
|
2020-02-11 15:56:08 +03:00
|
|
|
bool active = 1;
|
2018-12-13 14:26:29 +03:00
|
|
|
}
|
|
|
|
|
2020-02-11 15:56:08 +03:00
|
|
|
message ModifyStatusRequest {
|
2020-05-06 17:51:14 +03:00
|
|
|
// Whether the autopilot agent should be enabled or not.
|
2020-02-11 15:56:08 +03:00
|
|
|
bool enable = 1;
|
2018-12-13 14:26:29 +03:00
|
|
|
}
|
|
|
|
|
2020-02-11 15:56:08 +03:00
|
|
|
message ModifyStatusResponse {
|
|
|
|
}
|
2018-12-19 16:54:55 +03:00
|
|
|
|
2020-02-11 15:56:08 +03:00
|
|
|
message QueryScoresRequest {
|
|
|
|
repeated string pubkeys = 1;
|
2019-03-18 16:36:00 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// If set, we will ignore the local channel state when calculating scores.
|
2020-02-11 15:56:08 +03:00
|
|
|
bool ignore_local_state = 2;
|
2018-12-19 16:54:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message QueryScoresResponse {
|
|
|
|
message HeuristicResult {
|
2020-02-11 15:56:08 +03:00
|
|
|
string heuristic = 1;
|
|
|
|
map<string, double> scores = 2;
|
2018-12-19 16:54:55 +03:00
|
|
|
}
|
|
|
|
|
2020-02-11 15:56:08 +03:00
|
|
|
repeated HeuristicResult results = 1;
|
2018-12-19 16:54:55 +03:00
|
|
|
}
|
2019-02-14 13:37:47 +03:00
|
|
|
|
2020-02-11 15:56:08 +03:00
|
|
|
message SetScoresRequest {
|
2020-05-06 17:51:14 +03:00
|
|
|
// The name of the heuristic to provide scores to.
|
2020-02-11 15:56:08 +03:00
|
|
|
string heuristic = 1;
|
2019-02-14 13:37:47 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-02-14 13:37:47 +03:00
|
|
|
A map from hex-encoded public keys to scores. Scores must be in the range
|
|
|
|
[0.0, 1.0].
|
|
|
|
*/
|
2020-02-11 15:56:08 +03:00
|
|
|
map<string, double> scores = 2;
|
2019-02-14 13:37:47 +03:00
|
|
|
}
|
|
|
|
|
2020-02-11 15:56:08 +03:00
|
|
|
message SetScoresResponse {
|
|
|
|
}
|