2019-06-08 03:46:31 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package wtclientrpc;
|
|
|
|
|
|
|
|
option go_package = "github.com/lightningnetwork/lnd/lnrpc/wtclientrpc";
|
|
|
|
|
|
|
|
message AddTowerRequest {
|
|
|
|
// The identifying public key of the watchtower to add.
|
2020-02-11 16:06:44 +03:00
|
|
|
bytes pubkey = 1;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// A network address the watchtower is reachable over.
|
2020-02-11 16:06:44 +03:00
|
|
|
string address = 2;
|
2019-06-08 03:46:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message AddTowerResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message RemoveTowerRequest {
|
|
|
|
// The identifying public key of the watchtower to remove.
|
2020-02-11 16:06:44 +03:00
|
|
|
bytes pubkey = 1;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
If set, then the record for this address will be removed, indicating that is
|
|
|
|
is stale. Otherwise, the watchtower will no longer be used for future
|
|
|
|
session negotiations and backups.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
string address = 2;
|
2019-06-08 03:46:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message RemoveTowerResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetTowerInfoRequest {
|
|
|
|
// The identifying public key of the watchtower to retrieve information for.
|
2020-02-11 16:06:44 +03:00
|
|
|
bytes pubkey = 1;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// Whether we should include sessions with the watchtower in the response.
|
2020-02-11 16:06:44 +03:00
|
|
|
bool include_sessions = 2;
|
2019-06-08 03:46:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message TowerSession {
|
|
|
|
/*
|
|
|
|
The total number of successful backups that have been made to the
|
|
|
|
watchtower session.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 num_backups = 1;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
The total number of backups in the session that are currently pending to be
|
|
|
|
acknowledged by the watchtower.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 num_pending_backups = 2;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// The maximum number of backups allowed by the watchtower session.
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 max_backups = 3;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
The fee rate, in satoshis per vbyte, that will be used by the watchtower for
|
|
|
|
the justice transaction in the event of a channel breach.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 sweep_sat_per_byte = 4;
|
2019-06-08 03:46:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message Tower {
|
|
|
|
// The identifying public key of the watchtower.
|
2020-02-11 16:06:44 +03:00
|
|
|
bytes pubkey = 1;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// The list of addresses the watchtower is reachable over.
|
2020-02-11 16:06:44 +03:00
|
|
|
repeated string addresses = 2;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// Whether the watchtower is currently a candidate for new sessions.
|
2020-02-11 16:06:44 +03:00
|
|
|
bool active_session_candidate = 3;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// The number of sessions that have been negotiated with the watchtower.
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 num_sessions = 4;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// The list of sessions that have been negotiated with the watchtower.
|
2020-02-11 16:06:44 +03:00
|
|
|
repeated TowerSession sessions = 5;
|
2019-06-08 03:46:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message ListTowersRequest {
|
|
|
|
// Whether we should include sessions with the watchtower in the response.
|
2020-02-11 16:06:44 +03:00
|
|
|
bool include_sessions = 1;
|
2019-06-08 03:46:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message ListTowersResponse {
|
|
|
|
// The list of watchtowers available for new backups.
|
2020-02-11 16:06:44 +03:00
|
|
|
repeated Tower towers = 1;
|
2019-06-08 03:46:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message StatsRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message StatsResponse {
|
|
|
|
/*
|
|
|
|
The total number of backups made to all active and exhausted watchtower
|
|
|
|
sessions.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 num_backups = 1;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
The total number of backups that are pending to be acknowledged by all
|
|
|
|
active and exhausted watchtower sessions.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 num_pending_backups = 2;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
The total number of backups that all active and exhausted watchtower
|
|
|
|
sessions have failed to acknowledge.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 num_failed_backups = 3;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// The total number of new sessions made to watchtowers.
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 num_sessions_acquired = 4;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// The total number of watchtower sessions that have been exhausted.
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 num_sessions_exhausted = 5;
|
2019-06-08 03:46:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message PolicyRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message PolicyResponse {
|
|
|
|
/*
|
|
|
|
The maximum number of updates each session we negotiate with watchtowers
|
|
|
|
should allow.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 max_updates = 1;
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
The fee rate, in satoshis per vbyte, that will be used by watchtowers for
|
|
|
|
justice transactions in response to channel breaches.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
uint32 sweep_sat_per_byte = 2;
|
2019-06-08 03:46:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
service WatchtowerClient {
|
|
|
|
/*
|
|
|
|
AddTower adds a new watchtower reachable at the given address and
|
|
|
|
considers it for new sessions. If the watchtower already exists, then
|
|
|
|
any new addresses included will be considered when dialing it for
|
|
|
|
session negotiations and backups.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
rpc AddTower (AddTowerRequest) returns (AddTowerResponse);
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
RemoveTower removes a watchtower from being considered for future session
|
|
|
|
negotiations and from being used for any subsequent backups until it's added
|
|
|
|
again. If an address is provided, then this RPC only serves as a way of
|
|
|
|
removing the address from the watchtower instead.
|
|
|
|
*/
|
2020-02-11 16:06:44 +03:00
|
|
|
rpc RemoveTower (RemoveTowerRequest) returns (RemoveTowerResponse);
|
2019-06-08 03:46:31 +03:00
|
|
|
|
2020-03-02 17:35:25 +03:00
|
|
|
// ListTowers returns the list of watchtowers registered with the client.
|
2020-02-11 16:06:44 +03:00
|
|
|
rpc ListTowers (ListTowersRequest) returns (ListTowersResponse);
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// GetTowerInfo retrieves information for a registered watchtower.
|
2020-02-11 16:06:44 +03:00
|
|
|
rpc GetTowerInfo (GetTowerInfoRequest) returns (Tower);
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// Stats returns the in-memory statistics of the client since startup.
|
2020-02-11 16:06:44 +03:00
|
|
|
rpc Stats (StatsRequest) returns (StatsResponse);
|
2019-06-08 03:46:31 +03:00
|
|
|
|
|
|
|
// Policy returns the active watchtower client policy configuration.
|
2020-02-11 16:06:44 +03:00
|
|
|
rpc Policy (PolicyRequest) returns (PolicyResponse);
|
2019-06-08 03:46:31 +03:00
|
|
|
}
|