wtclientrpc: format wtclient.proto and remove json_name fields
We now use the jsonpb marshaler to convert the RPC responses to JSON in lncli and REST. The jsonpb has a setting to use the original name as defined in the proto file and the explicit json_name definition is not necessary any more. The jsonpb setting is called OrigName and needs to be true.
This commit is contained in:
2 files changed
+89
-86
No files matched your search
@@ -6,10 +6,10 @@ option go_package = "github.com/lightningnetwork/lnd/lnrpc/wtclientrpc";
|
||||
|
||||
message AddTowerRequest {
|
||||
// The identifying public key of the watchtower to add.
|
||||
bytes pubkey = 1 [json_name = "pubkey"];
|
||||
bytes pubkey = 1;
|
||||
|
||||
// A network address the watchtower is reachable over.
|
||||
string address = 2 [json_name = "address"];
|
||||
string address = 2;
|
||||
}
|
||||
|
||||
message AddTowerResponse {
|
||||
@@ -17,14 +17,14 @@ message AddTowerResponse {
|
||||
|
||||
message RemoveTowerRequest {
|
||||
// The identifying public key of the watchtower to remove.
|
||||
bytes pubkey = 1 [json_name = "pubkey"];
|
||||
bytes pubkey = 1;
|
||||
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
string address = 2 [json_name = "address"];
|
||||
string address = 2;
|
||||
}
|
||||
|
||||
message RemoveTowerResponse {
|
||||
@@ -32,10 +32,10 @@ message RemoveTowerResponse {
|
||||
|
||||
message GetTowerInfoRequest {
|
||||
// The identifying public key of the watchtower to retrieve information for.
|
||||
bytes pubkey = 1 [json_name = "pubkey"];
|
||||
bytes pubkey = 1;
|
||||
|
||||
// Whether we should include sessions with the watchtower in the response.
|
||||
bool include_sessions = 2 [json_name = "include_sessions"];
|
||||
bool include_sessions = 2;
|
||||
}
|
||||
|
||||
message TowerSession {
|
||||
@@ -43,49 +43,49 @@ message TowerSession {
|
||||
The total number of successful backups that have been made to the
|
||||
watchtower session.
|
||||
*/
|
||||
uint32 num_backups = 1 [json_name = "num_backups"];
|
||||
uint32 num_backups = 1;
|
||||
|
||||
/*
|
||||
The total number of backups in the session that are currently pending to be
|
||||
acknowledged by the watchtower.
|
||||
*/
|
||||
uint32 num_pending_backups = 2 [json_name = "num_pending_backups"];
|
||||
uint32 num_pending_backups = 2;
|
||||
|
||||
// The maximum number of backups allowed by the watchtower session.
|
||||
uint32 max_backups = 3 [json_name = "max_backups"];
|
||||
uint32 max_backups = 3;
|
||||
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
uint32 sweep_sat_per_byte = 4 [json_name = "sweep_sat_per_byte"];
|
||||
uint32 sweep_sat_per_byte = 4;
|
||||
}
|
||||
|
||||
message Tower {
|
||||
// The identifying public key of the watchtower.
|
||||
bytes pubkey = 1 [json_name = "pubkey"];
|
||||
bytes pubkey = 1;
|
||||
|
||||
// The list of addresses the watchtower is reachable over.
|
||||
repeated string addresses = 2 [json_name = "addresses"];
|
||||
repeated string addresses = 2;
|
||||
|
||||
// Whether the watchtower is currently a candidate for new sessions.
|
||||
bool active_session_candidate = 3 [json_name = "active_session_candidate"];
|
||||
bool active_session_candidate = 3;
|
||||
|
||||
// The number of sessions that have been negotiated with the watchtower.
|
||||
uint32 num_sessions = 4 [json_name = "num_sessions"];
|
||||
uint32 num_sessions = 4;
|
||||
|
||||
// The list of sessions that have been negotiated with the watchtower.
|
||||
repeated TowerSession sessions = 5 [json_name = "sessions"];
|
||||
repeated TowerSession sessions = 5;
|
||||
}
|
||||
|
||||
message ListTowersRequest {
|
||||
// Whether we should include sessions with the watchtower in the response.
|
||||
bool include_sessions = 1 [json_name = "include_sessions"];
|
||||
bool include_sessions = 1;
|
||||
}
|
||||
|
||||
message ListTowersResponse {
|
||||
// The list of watchtowers available for new backups.
|
||||
repeated Tower towers = 1 [json_name = "towers"];
|
||||
repeated Tower towers = 1;
|
||||
}
|
||||
|
||||
message StatsRequest {
|
||||
@@ -96,25 +96,25 @@ message StatsResponse {
|
||||
The total number of backups made to all active and exhausted watchtower
|
||||
sessions.
|
||||
*/
|
||||
uint32 num_backups = 1 [json_name = "num_backups"];
|
||||
uint32 num_backups = 1;
|
||||
|
||||
/*
|
||||
The total number of backups that are pending to be acknowledged by all
|
||||
active and exhausted watchtower sessions.
|
||||
*/
|
||||
uint32 num_pending_backups = 2 [json_name = "num_pending_backups"];
|
||||
uint32 num_pending_backups = 2;
|
||||
|
||||
/*
|
||||
The total number of backups that all active and exhausted watchtower
|
||||
sessions have failed to acknowledge.
|
||||
*/
|
||||
uint32 num_failed_backups = 3 [json_name = "num_failed_backups"];
|
||||
uint32 num_failed_backups = 3;
|
||||
|
||||
// The total number of new sessions made to watchtowers.
|
||||
uint32 num_sessions_acquired = 4 [json_name = "num_sessions_acquired"];
|
||||
uint32 num_sessions_acquired = 4;
|
||||
|
||||
// The total number of watchtower sessions that have been exhausted.
|
||||
uint32 num_sessions_exhausted = 5 [json_name = "num_sessions_exhausted"];
|
||||
uint32 num_sessions_exhausted = 5;
|
||||
}
|
||||
|
||||
message PolicyRequest {
|
||||
@@ -125,13 +125,13 @@ message PolicyResponse {
|
||||
The maximum number of updates each session we negotiate with watchtowers
|
||||
should allow.
|
||||
*/
|
||||
uint32 max_updates = 1 [json_name = "max_updates"];
|
||||
uint32 max_updates = 1;
|
||||
|
||||
/*
|
||||
The fee rate, in satoshis per vbyte, that will be used by watchtowers for
|
||||
justice transactions in response to channel breaches.
|
||||
*/
|
||||
uint32 sweep_sat_per_byte = 2 [json_name = "sweep_sat_per_byte"];
|
||||
uint32 sweep_sat_per_byte = 2;
|
||||
}
|
||||
|
||||
service WatchtowerClient {
|
||||
@@ -141,7 +141,7 @@ service WatchtowerClient {
|
||||
any new addresses included will be considered when dialing it for
|
||||
session negotiations and backups.
|
||||
*/
|
||||
rpc AddTower(AddTowerRequest) returns (AddTowerResponse);
|
||||
rpc AddTower (AddTowerRequest) returns (AddTowerResponse);
|
||||
|
||||
/*
|
||||
RemoveTower removes a watchtower from being considered for future session
|
||||
@@ -149,17 +149,17 @@ service WatchtowerClient {
|
||||
again. If an address is provided, then this RPC only serves as a way of
|
||||
removing the address from the watchtower instead.
|
||||
*/
|
||||
rpc RemoveTower(RemoveTowerRequest) returns (RemoveTowerResponse);
|
||||
rpc RemoveTower (RemoveTowerRequest) returns (RemoveTowerResponse);
|
||||
|
||||
// ListTowers returns the list of watchtowers registered with the client.
|
||||
rpc ListTowers(ListTowersRequest) returns (ListTowersResponse);
|
||||
rpc ListTowers (ListTowersRequest) returns (ListTowersResponse);
|
||||
|
||||
// GetTowerInfo retrieves information for a registered watchtower.
|
||||
rpc GetTowerInfo(GetTowerInfoRequest) returns (Tower);
|
||||
rpc GetTowerInfo (GetTowerInfoRequest) returns (Tower);
|
||||
|
||||
// Stats returns the in-memory statistics of the client since startup.
|
||||
rpc Stats(StatsRequest) returns (StatsResponse);
|
||||
rpc Stats (StatsRequest) returns (StatsResponse);
|
||||
|
||||
// Policy returns the active watchtower client policy configuration.
|
||||
rpc Policy(PolicyRequest) returns (PolicyResponse);
|
||||
rpc Policy (PolicyRequest) returns (PolicyResponse);
|
||||
}
|
||||
Reference in new issue
Block a user