Merge pull request #3224 from cfromknecht/wtserver-key-family
watchtower: use separate key family for wtserver public key, add watchtower subserver
This commit is contained in:
21 files changed
+756
-24
No files matched your search
@@ -0,0 +1,13 @@
|
||||
// +build watchtowerrpc
|
||||
|
||||
package watchtowerrpc
|
||||
|
||||
// Config is the primary configuration struct for the watchtower RPC server. It
|
||||
// contains all items required for the RPC server to carry out its duties. The
|
||||
// fields with struct tags are meant to parsed as normal configuration options,
|
||||
// while if able to be populated, the latter fields MUST also be specified.
|
||||
type Config struct {
|
||||
// Tower is the active watchtower which serves as the primary source for
|
||||
// information presented via RPC.
|
||||
Tower WatchtowerBackend
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// +build !watchtowerrpc
|
||||
|
||||
package watchtowerrpc
|
||||
|
||||
// Config is empty for non-watchtowerrpc builds.
|
||||
type Config struct{}
|
||||
@@ -0,0 +1,55 @@
|
||||
// +build watchtowerrpc
|
||||
|
||||
package watchtowerrpc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
)
|
||||
|
||||
// createNewSubServer is a helper method that will create the new sub server
|
||||
// given the main config dispatcher method. If we're unable to find the config
|
||||
// that is meant for us in the config dispatcher, then we'll exit with an
|
||||
// error.
|
||||
func createNewSubServer(configRegistry lnrpc.SubServerConfigDispatcher) (
|
||||
lnrpc.SubServer, lnrpc.MacaroonPerms, error) {
|
||||
|
||||
// We'll attempt to look up the config that we expect, according to our
|
||||
// subServerName name. If we can't find this, then we'll exit with an
|
||||
// error, as we're unable to properly initialize ourselves without this
|
||||
// config.
|
||||
subServerConf, ok := configRegistry.FetchConfig(subServerName)
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("unable to find config for "+
|
||||
"subserver type %s", subServerName)
|
||||
}
|
||||
|
||||
// Now that we've found an object mapping to our service name, we'll
|
||||
// ensure that it's the type we need.
|
||||
config, ok := subServerConf.(*Config)
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("wrong type of config for "+
|
||||
"subserver %s, expected %T got %T", subServerName,
|
||||
&Config{}, subServerConf)
|
||||
}
|
||||
|
||||
return New(config)
|
||||
}
|
||||
|
||||
func init() {
|
||||
subServer := &lnrpc.SubServerDriver{
|
||||
SubServerName: subServerName,
|
||||
New: func(c lnrpc.SubServerConfigDispatcher) (lnrpc.SubServer,
|
||||
lnrpc.MacaroonPerms, error) {
|
||||
return createNewSubServer(c)
|
||||
},
|
||||
}
|
||||
|
||||
// If the build tag is active, then we'll register ourselves as a
|
||||
// sub-RPC server within the global lnrpc package namespace.
|
||||
if err := lnrpc.RegisterSubServer(subServer); err != nil {
|
||||
panic(fmt.Sprintf("failed to register sub server driver "+
|
||||
"'%s': %v", subServerName, err))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
// +build watchtowerrpc
|
||||
|
||||
package watchtowerrpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
fmt "fmt"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"google.golang.org/grpc"
|
||||
"gopkg.in/macaroon-bakery.v2/bakery"
|
||||
)
|
||||
|
||||
const (
|
||||
// subServerName is the name of the sub rpc server. We'll use this name
|
||||
// to register ourselves, and we also require that the main
|
||||
// SubServerConfigDispatcher instance recognizes it as the name of our
|
||||
// RPC service.
|
||||
subServerName = "WatchtowerRPC"
|
||||
)
|
||||
|
||||
var (
|
||||
// macPermissions maps RPC calls to the permissions they require.
|
||||
macPermissions = map[string][]bakery.Op{
|
||||
"/watchtowerrpc.Watchtower/GetInfo": {{
|
||||
Entity: "info",
|
||||
Action: "read",
|
||||
}},
|
||||
}
|
||||
|
||||
// ErrTowerNotActive signals that RPC calls cannot be processed because
|
||||
// the watchtower is not active.
|
||||
ErrTowerNotActive = errors.New("watchtower not active")
|
||||
)
|
||||
|
||||
// Handler is the RPC server we'll use to interact with the backing active
|
||||
// watchtower.
|
||||
type Handler struct {
|
||||
cfg Config
|
||||
}
|
||||
|
||||
// A compile time check to ensure that Handler fully implements the Handler gRPC
|
||||
// service.
|
||||
var _ WatchtowerServer = (*Handler)(nil)
|
||||
|
||||
// New returns a new instance of the Watchtower sub-server. We also return the
|
||||
// set of permissions for the macaroons that we may create within this method.
|
||||
// If the macaroons we need aren't found in the filepath, then we'll create them
|
||||
// on start up. If we're unable to locate, or create the macaroons we need, then
|
||||
// we'll return with an error.
|
||||
func New(cfg *Config) (*Handler, lnrpc.MacaroonPerms, error) {
|
||||
return &Handler{*cfg}, macPermissions, nil
|
||||
}
|
||||
|
||||
// Start launches any helper goroutines required for the Handler to function.
|
||||
//
|
||||
// NOTE: This is part of the lnrpc.SubServer interface.
|
||||
func (c *Handler) Start() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Stop signals any active goroutines for a graceful closure.
|
||||
//
|
||||
// NOTE: This is part of the lnrpc.SubServer interface.
|
||||
func (c *Handler) Stop() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Name returns a unique string representation of the sub-server. This can be
|
||||
// used to identify the sub-server and also de-duplicate them.
|
||||
//
|
||||
// NOTE: This is part of the lnrpc.SubServer interface.
|
||||
func (c *Handler) Name() string {
|
||||
return subServerName
|
||||
}
|
||||
|
||||
// RegisterWithRootServer will be called by the root gRPC server to direct a sub
|
||||
// RPC server to register itself with the main gRPC root server. Until this is
|
||||
// called, each sub-server won't be able to have requests routed towards it.
|
||||
//
|
||||
// NOTE: This is part of the lnrpc.SubServer interface.
|
||||
func (c *Handler) RegisterWithRootServer(grpcServer *grpc.Server) error {
|
||||
// We make sure that we register it with the main gRPC server to ensure
|
||||
// all our methods are routed properly.
|
||||
RegisterWatchtowerServer(grpcServer, c)
|
||||
|
||||
log.Debugf("Watchtower RPC server successfully register with root " +
|
||||
"gRPC server")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// 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.
|
||||
func (c *Handler) GetInfo(ctx context.Context,
|
||||
req *GetInfoRequest) (*GetInfoResponse, error) {
|
||||
|
||||
if err := c.isActive(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pubkey := c.cfg.Tower.PubKey().SerializeCompressed()
|
||||
|
||||
var listeners []string
|
||||
for _, addr := range c.cfg.Tower.ListeningAddrs() {
|
||||
listeners = append(listeners, addr.String())
|
||||
}
|
||||
|
||||
var uris []string
|
||||
for _, addr := range c.cfg.Tower.ExternalIPs() {
|
||||
uris = append(uris, fmt.Sprintf("%x@%v", pubkey, addr))
|
||||
}
|
||||
|
||||
return &GetInfoResponse{
|
||||
Pubkey: pubkey,
|
||||
Listeners: listeners,
|
||||
Uris: uris,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// isActive returns nil if the tower backend is initialized, and the Handler can
|
||||
// proccess RPC requests.
|
||||
func (c *Handler) isActive() error {
|
||||
if c.cfg.Tower != nil {
|
||||
return nil
|
||||
}
|
||||
return ErrTowerNotActive
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package watchtowerrpc
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
)
|
||||
|
||||
// WatchtowerBackend abstracts access to the watchtower information that is
|
||||
// served via RPC connections.
|
||||
type WatchtowerBackend interface {
|
||||
// PubKey returns the public key for the watchtower used to
|
||||
// authentication and encrypt traffic with clients.
|
||||
PubKey() *btcec.PublicKey
|
||||
|
||||
// ListeningAddrs returns the listening addresses where the watchtower
|
||||
// server can accept client connections.
|
||||
ListeningAddrs() []net.Addr
|
||||
|
||||
// ExternalIPs returns the addresses where the watchtower can be reached
|
||||
// by clients externally.
|
||||
ExternalIPs() []net.Addr
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package watchtowerrpc
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btclog"
|
||||
"github.com/lightningnetwork/lnd/build"
|
||||
)
|
||||
|
||||
// Subsystem defines the logging code for this subsystem.
|
||||
const Subsystem = "WRPC"
|
||||
|
||||
// log is a logger that is initialized with no output filters. This means the
|
||||
// package will not perform any logging by default until the caller requests it.
|
||||
var log btclog.Logger
|
||||
|
||||
// The default amount of logging is none.
|
||||
func init() {
|
||||
UseLogger(build.NewSubLogger(Subsystem, nil))
|
||||
}
|
||||
|
||||
// DisableLog disables all library log output. Logging output is disabled by by
|
||||
// default until UseLogger is called.
|
||||
func DisableLog() {
|
||||
UseLogger(btclog.Disabled)
|
||||
}
|
||||
|
||||
// UseLogger uses a specified Logger to output package logging info. This
|
||||
// should be used in preference to SetLogWriter if the caller is also using
|
||||
// btclog.
|
||||
func UseLogger(logger btclog.Logger) {
|
||||
log = logger
|
||||
}
|
||||
|
||||
// logClosure is used to provide a closure over expensive logging operations so
|
||||
// don't have to be performed when the logging level doesn't warrant it.
|
||||
type logClosure func() string
|
||||
|
||||
// String invokes the underlying function and returns the result.
|
||||
func (c logClosure) String() string {
|
||||
return c()
|
||||
}
|
||||
|
||||
// newLogClosure returns a new closure over a function that returns a string
|
||||
// which itself provides a Stringer interface so that it can be used with the
|
||||
// logging system.
|
||||
func newLogClosure(c func() string) logClosure {
|
||||
return logClosure(c)
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: watchtowerrpc/watchtower.proto
|
||||
|
||||
package watchtowerrpc
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
grpc "google.golang.org/grpc"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type GetInfoRequest struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetInfoRequest) Reset() { *m = GetInfoRequest{} }
|
||||
func (m *GetInfoRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetInfoRequest) ProtoMessage() {}
|
||||
func (*GetInfoRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9f019c0e859ad3d6, []int{0}
|
||||
}
|
||||
|
||||
func (m *GetInfoRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetInfoRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *GetInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_GetInfoRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *GetInfoRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_GetInfoRequest.Merge(m, src)
|
||||
}
|
||||
func (m *GetInfoRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_GetInfoRequest.Size(m)
|
||||
}
|
||||
func (m *GetInfoRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_GetInfoRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_GetInfoRequest proto.InternalMessageInfo
|
||||
|
||||
type GetInfoResponse struct {
|
||||
/// The public key of the watchtower.
|
||||
Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
|
||||
/// The listening addresses of the watchtower.
|
||||
Listeners []string `protobuf:"bytes,2,rep,name=listeners,proto3" json:"listeners,omitempty"`
|
||||
/// The URIs of the watchtower.
|
||||
Uris []string `protobuf:"bytes,3,rep,name=uris,proto3" json:"uris,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetInfoResponse) Reset() { *m = GetInfoResponse{} }
|
||||
func (m *GetInfoResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetInfoResponse) ProtoMessage() {}
|
||||
func (*GetInfoResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9f019c0e859ad3d6, []int{1}
|
||||
}
|
||||
|
||||
func (m *GetInfoResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_GetInfoResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *GetInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_GetInfoResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *GetInfoResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_GetInfoResponse.Merge(m, src)
|
||||
}
|
||||
func (m *GetInfoResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_GetInfoResponse.Size(m)
|
||||
}
|
||||
func (m *GetInfoResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_GetInfoResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_GetInfoResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *GetInfoResponse) GetPubkey() []byte {
|
||||
if m != nil {
|
||||
return m.Pubkey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetInfoResponse) GetListeners() []string {
|
||||
if m != nil {
|
||||
return m.Listeners
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetInfoResponse) GetUris() []string {
|
||||
if m != nil {
|
||||
return m.Uris
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*GetInfoRequest)(nil), "watchtowerrpc.GetInfoRequest")
|
||||
proto.RegisterType((*GetInfoResponse)(nil), "watchtowerrpc.GetInfoResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("watchtowerrpc/watchtower.proto", fileDescriptor_9f019c0e859ad3d6) }
|
||||
|
||||
var fileDescriptor_9f019c0e859ad3d6 = []byte{
|
||||
// 213 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0x4f, 0x2c, 0x49,
|
||||
0xce, 0x28, 0xc9, 0x2f, 0x4f, 0x2d, 0x2a, 0x2a, 0x48, 0xd6, 0x47, 0xf0, 0xf4, 0x0a, 0x8a, 0xf2,
|
||||
0x4b, 0xf2, 0x85, 0x78, 0x51, 0xe4, 0x95, 0x04, 0xb8, 0xf8, 0xdc, 0x53, 0x4b, 0x3c, 0xf3, 0xd2,
|
||||
0xf2, 0x83, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x94, 0xa2, 0xb9, 0xf8, 0xe1, 0x22, 0xc5, 0x05,
|
||||
0xf9, 0x79, 0xc5, 0xa9, 0x42, 0x62, 0x5c, 0x6c, 0x05, 0xa5, 0x49, 0xd9, 0xa9, 0x95, 0x12, 0x8c,
|
||||
0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x50, 0x9e, 0x90, 0x0c, 0x17, 0x67, 0x4e, 0x66, 0x71, 0x49, 0x6a,
|
||||
0x5e, 0x6a, 0x51, 0xb1, 0x04, 0x93, 0x02, 0xb3, 0x06, 0x67, 0x10, 0x42, 0x40, 0x48, 0x88, 0x8b,
|
||||
0xa5, 0xb4, 0x28, 0xb3, 0x58, 0x82, 0x19, 0x2c, 0x01, 0x66, 0x1b, 0x85, 0x71, 0x71, 0x85, 0xc3,
|
||||
0xed, 0x17, 0xf2, 0xe0, 0x62, 0x87, 0x5a, 0x25, 0x24, 0xab, 0x87, 0xe2, 0x2e, 0x3d, 0x54, 0x47,
|
||||
0x49, 0xc9, 0xe1, 0x92, 0x86, 0xb8, 0xd0, 0xc9, 0x34, 0xca, 0x38, 0x3d, 0xb3, 0x24, 0xa3, 0x34,
|
||||
0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x27, 0x33, 0x3d, 0xa3, 0x24, 0x2f, 0x33, 0x2f, 0x3d, 0x2f,
|
||||
0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x3f, 0x27, 0x2f, 0x45, 0x3f, 0x27, 0x0f, 0x35, 0x3c, 0x8a,
|
||||
0x0a, 0x92, 0x93, 0xd8, 0xc0, 0x61, 0x62, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x23, 0x0b,
|
||||
0x68, 0x35, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConn
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// WatchtowerClient is the client API for Watchtower service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type WatchtowerClient interface {
|
||||
//* lncli: tower info
|
||||
//GetInfo returns general information concerning the companion watchtower
|
||||
//including it's public key and URIs where the server is currently
|
||||
//listening for clients.
|
||||
GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error)
|
||||
}
|
||||
|
||||
type watchtowerClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewWatchtowerClient(cc *grpc.ClientConn) WatchtowerClient {
|
||||
return &watchtowerClient{cc}
|
||||
}
|
||||
|
||||
func (c *watchtowerClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) {
|
||||
out := new(GetInfoResponse)
|
||||
err := c.cc.Invoke(ctx, "/watchtowerrpc.Watchtower/GetInfo", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// WatchtowerServer is the server API for Watchtower service.
|
||||
type WatchtowerServer interface {
|
||||
//* lncli: tower info
|
||||
//GetInfo returns general information concerning the companion watchtower
|
||||
//including it's public key and URIs where the server is currently
|
||||
//listening for clients.
|
||||
GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
|
||||
}
|
||||
|
||||
func RegisterWatchtowerServer(s *grpc.Server, srv WatchtowerServer) {
|
||||
s.RegisterService(&_Watchtower_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Watchtower_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetInfoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(WatchtowerServer).GetInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/watchtowerrpc.Watchtower/GetInfo",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(WatchtowerServer).GetInfo(ctx, req.(*GetInfoRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Watchtower_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "watchtowerrpc.Watchtower",
|
||||
HandlerType: (*WatchtowerServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetInfo",
|
||||
Handler: _Watchtower_GetInfo_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "watchtowerrpc/watchtower.proto",
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package watchtowerrpc;
|
||||
|
||||
option go_package = "github.com/lightningnetwork/lnd/lnrpc/watchtowerrpc";
|
||||
|
||||
service Watchtower {
|
||||
/** lncli: tower info
|
||||
GetInfo returns general information concerning the companion watchtower
|
||||
including it's public key and URIs where the server is currently
|
||||
listening for clients.
|
||||
*/
|
||||
rpc GetInfo(GetInfoRequest) returns (GetInfoResponse);
|
||||
}
|
||||
|
||||
message GetInfoRequest{
|
||||
}
|
||||
|
||||
message GetInfoResponse {
|
||||
/// The public key of the watchtower.
|
||||
bytes pubkey = 1 [json_name = "pubkey"];
|
||||
|
||||
/// The listening addresses of the watchtower.
|
||||
repeated string listeners = 2 [json_name = "listeners"];
|
||||
|
||||
/// The URIs of the watchtower.
|
||||
repeated string uris = 3 [json_name = "uris" ];
|
||||
}
|
||||
Reference in new issue
Block a user