github.com/decred/dcrlnd@v0.7.6/lnrpc/wtclientrpc/wtclient.proto (about) 1 syntax = "proto3"; 2 3 package wtclientrpc; 4 5 option go_package = "github.com/decred/dcrlnd/lnrpc/wtclientrpc"; 6 7 // WatchtowerClient is a service that grants access to the watchtower client 8 // functionality of the daemon. 9 service WatchtowerClient { 10 /* 11 AddTower adds a new watchtower reachable at the given address and 12 considers it for new sessions. If the watchtower already exists, then 13 any new addresses included will be considered when dialing it for 14 session negotiations and backups. 15 */ 16 rpc AddTower (AddTowerRequest) returns (AddTowerResponse); 17 18 /* 19 RemoveTower removes a watchtower from being considered for future session 20 negotiations and from being used for any subsequent backups until it's added 21 again. If an address is provided, then this RPC only serves as a way of 22 removing the address from the watchtower instead. 23 */ 24 rpc RemoveTower (RemoveTowerRequest) returns (RemoveTowerResponse); 25 26 // ListTowers returns the list of watchtowers registered with the client. 27 rpc ListTowers (ListTowersRequest) returns (ListTowersResponse); 28 29 // GetTowerInfo retrieves information for a registered watchtower. 30 rpc GetTowerInfo (GetTowerInfoRequest) returns (Tower); 31 32 // Stats returns the in-memory statistics of the client since startup. 33 rpc Stats (StatsRequest) returns (StatsResponse); 34 35 // Policy returns the active watchtower client policy configuration. 36 rpc Policy (PolicyRequest) returns (PolicyResponse); 37 } 38 39 message AddTowerRequest { 40 // The identifying public key of the watchtower to add. 41 bytes pubkey = 1; 42 43 // A network address the watchtower is reachable over. 44 string address = 2; 45 } 46 47 message AddTowerResponse { 48 } 49 50 message RemoveTowerRequest { 51 // The identifying public key of the watchtower to remove. 52 bytes pubkey = 1; 53 54 /* 55 If set, then the record for this address will be removed, indicating that is 56 is stale. Otherwise, the watchtower will no longer be used for future 57 session negotiations and backups. 58 */ 59 string address = 2; 60 } 61 62 message RemoveTowerResponse { 63 } 64 65 message GetTowerInfoRequest { 66 // The identifying public key of the watchtower to retrieve information for. 67 bytes pubkey = 1; 68 69 // Whether we should include sessions with the watchtower in the response. 70 bool include_sessions = 2; 71 } 72 73 message TowerSession { 74 /* 75 The total number of successful backups that have been made to the 76 watchtower session. 77 */ 78 uint32 num_backups = 1; 79 80 /* 81 The total number of backups in the session that are currently pending to be 82 acknowledged by the watchtower. 83 */ 84 uint32 num_pending_backups = 2; 85 86 // The maximum number of backups allowed by the watchtower session. 87 uint32 max_backups = 3; 88 89 /* 90 The fee rate, in satoshis per vbyte, that will be used by the watchtower for 91 the justice transaction in the event of a channel breach. 92 */ 93 uint32 sweep_atoms_per_byte = 4; 94 95 // Upstream, this is used for the sweep_sats_per_vbyte field. 96 reserved 5; 97 } 98 99 message Tower { 100 // The identifying public key of the watchtower. 101 bytes pubkey = 1; 102 103 // The list of addresses the watchtower is reachable over. 104 repeated string addresses = 2; 105 106 // Whether the watchtower is currently a candidate for new sessions. 107 bool active_session_candidate = 3; 108 109 // The number of sessions that have been negotiated with the watchtower. 110 uint32 num_sessions = 4; 111 112 // The list of sessions that have been negotiated with the watchtower. 113 repeated TowerSession sessions = 5; 114 } 115 116 message ListTowersRequest { 117 // Whether we should include sessions with the watchtower in the response. 118 bool include_sessions = 1; 119 } 120 121 message ListTowersResponse { 122 // The list of watchtowers available for new backups. 123 repeated Tower towers = 1; 124 } 125 126 message StatsRequest { 127 } 128 129 message StatsResponse { 130 /* 131 The total number of backups made to all active and exhausted watchtower 132 sessions. 133 */ 134 uint32 num_backups = 1; 135 136 /* 137 The total number of backups that are pending to be acknowledged by all 138 active and exhausted watchtower sessions. 139 */ 140 uint32 num_pending_backups = 2; 141 142 /* 143 The total number of backups that all active and exhausted watchtower 144 sessions have failed to acknowledge. 145 */ 146 uint32 num_failed_backups = 3; 147 148 // The total number of new sessions made to watchtowers. 149 uint32 num_sessions_acquired = 4; 150 151 // The total number of watchtower sessions that have been exhausted. 152 uint32 num_sessions_exhausted = 5; 153 } 154 155 enum PolicyType { 156 // Selects the policy from the legacy tower client. 157 LEGACY = 0; 158 159 // Selects the policy from the anchor tower client. 160 ANCHOR = 1; 161 } 162 163 message PolicyRequest { 164 /* 165 The client type from which to retrieve the active offering policy. 166 */ 167 PolicyType policy_type = 1; 168 } 169 170 message PolicyResponse { 171 /* 172 The maximum number of updates each session we negotiate with watchtowers 173 should allow. 174 */ 175 uint32 max_updates = 1; 176 177 /* 178 The fee rate, in satoshis per vbyte, that will be used by watchtowers for 179 justice transactions in response to channel breaches. 180 */ 181 uint32 sweep_atoms_per_byte = 2; 182 183 // Upstream, this is used for the sweep_sats_per_vbyte field. 184 reserved 3; 185 }