1
0
mirror of https://github.com/bumi/lnrpc synced 2026-02-13 15:17:48 +00:00

Add support for v0.11 GRPC services

This also refactors the client GRPC wrapper to dynamically load the
request objects.
All GRPC generated client files now live under lib/grpc_services
This commit is contained in:
2020-08-28 14:09:57 +02:00
parent 579fc423ea
commit 404ed3b99e
31 changed files with 2758 additions and 5878 deletions

View File

@@ -0,0 +1,75 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: wtclientrpc/wtclient.proto
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("wtclientrpc/wtclient.proto", :syntax => :proto3) do
add_message "wtclientrpc.AddTowerRequest" do
optional :pubkey, :bytes, 1
optional :address, :string, 2
end
add_message "wtclientrpc.AddTowerResponse" do
end
add_message "wtclientrpc.RemoveTowerRequest" do
optional :pubkey, :bytes, 1
optional :address, :string, 2
end
add_message "wtclientrpc.RemoveTowerResponse" do
end
add_message "wtclientrpc.GetTowerInfoRequest" do
optional :pubkey, :bytes, 1
optional :include_sessions, :bool, 2
end
add_message "wtclientrpc.TowerSession" do
optional :num_backups, :uint32, 1
optional :num_pending_backups, :uint32, 2
optional :max_backups, :uint32, 3
optional :sweep_sat_per_byte, :uint32, 4
end
add_message "wtclientrpc.Tower" do
optional :pubkey, :bytes, 1
repeated :addresses, :string, 2
optional :active_session_candidate, :bool, 3
optional :num_sessions, :uint32, 4
repeated :sessions, :message, 5, "wtclientrpc.TowerSession"
end
add_message "wtclientrpc.ListTowersRequest" do
optional :include_sessions, :bool, 1
end
add_message "wtclientrpc.ListTowersResponse" do
repeated :towers, :message, 1, "wtclientrpc.Tower"
end
add_message "wtclientrpc.StatsRequest" do
end
add_message "wtclientrpc.StatsResponse" do
optional :num_backups, :uint32, 1
optional :num_pending_backups, :uint32, 2
optional :num_failed_backups, :uint32, 3
optional :num_sessions_acquired, :uint32, 4
optional :num_sessions_exhausted, :uint32, 5
end
add_message "wtclientrpc.PolicyRequest" do
end
add_message "wtclientrpc.PolicyResponse" do
optional :max_updates, :uint32, 1
optional :sweep_sat_per_byte, :uint32, 2
end
end
end
module Wtclientrpc
AddTowerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.AddTowerRequest").msgclass
AddTowerResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.AddTowerResponse").msgclass
RemoveTowerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.RemoveTowerRequest").msgclass
RemoveTowerResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.RemoveTowerResponse").msgclass
GetTowerInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.GetTowerInfoRequest").msgclass
TowerSession = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.TowerSession").msgclass
Tower = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.Tower").msgclass
ListTowersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.ListTowersRequest").msgclass
ListTowersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.ListTowersResponse").msgclass
StatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.StatsRequest").msgclass
StatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.StatsResponse").msgclass
PolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.PolicyRequest").msgclass
PolicyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.PolicyResponse").msgclass
end

View File

@@ -0,0 +1,43 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: wtclientrpc/wtclient.proto for package 'wtclientrpc'
require 'grpc'
require 'wtclientrpc/wtclient_pb'
module Wtclientrpc
module WatchtowerClient
# WatchtowerClient is a service that grants access to the watchtower client
# functionality of the daemon.
class Service
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
self.service_name = 'wtclientrpc.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.
rpc :AddTower, AddTowerRequest, AddTowerResponse
#
# 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.
rpc :RemoveTower, RemoveTowerRequest, RemoveTowerResponse
# ListTowers returns the list of watchtowers registered with the client.
rpc :ListTowers, ListTowersRequest, ListTowersResponse
# GetTowerInfo retrieves information for a registered watchtower.
rpc :GetTowerInfo, GetTowerInfoRequest, Tower
# Stats returns the in-memory statistics of the client since startup.
rpc :Stats, StatsRequest, StatsResponse
# Policy returns the active watchtower client policy configuration.
rpc :Policy, PolicyRequest, PolicyResponse
end
Stub = Service.rpc_stub_class
end
end