wtclientrpc

package
v0.13.1-beta-fund-reco... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package wtclientrpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	PolicyType_name = map[int32]string{
		0: "LEGACY",
		1: "ANCHOR",
	}
	PolicyType_value = map[string]int32{
		"LEGACY": 0,
		"ANCHOR": 1,
	}
)

Enum value maps for PolicyType.

View Source
var (

	// ErrWtclientNotActive signals that RPC calls cannot be processed
	// because the watchtower client is not active.
	ErrWtclientNotActive = errors.New("watchtower client not active")
)
View Source
var File_wtclientrpc_wtclient_proto protoreflect.FileDescriptor

Functions

func RegisterWatchtowerClientHandler

func RegisterWatchtowerClientHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterWatchtowerClientHandler registers the http handlers for service WatchtowerClient to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterWatchtowerClientHandlerClient

func RegisterWatchtowerClientHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WatchtowerClientClient) error

RegisterWatchtowerClientHandlerClient registers the http handlers for service WatchtowerClient to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WatchtowerClientClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WatchtowerClientClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WatchtowerClientClient" to call the correct interceptors.

func RegisterWatchtowerClientHandlerFromEndpoint

func RegisterWatchtowerClientHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterWatchtowerClientHandlerFromEndpoint is same as RegisterWatchtowerClientHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterWatchtowerClientHandlerServer

func RegisterWatchtowerClientHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WatchtowerClientServer) error

RegisterWatchtowerClientHandlerServer registers the http handlers for service WatchtowerClient to "mux". UnaryRPC :call WatchtowerClientServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterWatchtowerClientServer

func RegisterWatchtowerClientServer(s *grpc.Server, srv WatchtowerClientServer)

Types

type AddTowerRequest

type AddTowerRequest struct {

	// The identifying public key of the watchtower to add.
	Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
	// A network address the watchtower is reachable over.
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*AddTowerRequest) Descriptor deprecated

func (*AddTowerRequest) Descriptor() ([]byte, []int)

Deprecated: Use AddTowerRequest.ProtoReflect.Descriptor instead.

func (*AddTowerRequest) GetAddress

func (x *AddTowerRequest) GetAddress() string

func (*AddTowerRequest) GetPubkey

func (x *AddTowerRequest) GetPubkey() []byte

func (*AddTowerRequest) ProtoMessage

func (*AddTowerRequest) ProtoMessage()

func (*AddTowerRequest) ProtoReflect

func (x *AddTowerRequest) ProtoReflect() protoreflect.Message

func (*AddTowerRequest) Reset

func (x *AddTowerRequest) Reset()

func (*AddTowerRequest) String

func (x *AddTowerRequest) String() string

type AddTowerResponse

type AddTowerResponse struct {
	// contains filtered or unexported fields
}

func (*AddTowerResponse) Descriptor deprecated

func (*AddTowerResponse) Descriptor() ([]byte, []int)

Deprecated: Use AddTowerResponse.ProtoReflect.Descriptor instead.

func (*AddTowerResponse) ProtoMessage

func (*AddTowerResponse) ProtoMessage()

func (*AddTowerResponse) ProtoReflect

func (x *AddTowerResponse) ProtoReflect() protoreflect.Message

func (*AddTowerResponse) Reset

func (x *AddTowerResponse) Reset()

func (*AddTowerResponse) String

func (x *AddTowerResponse) String() string

type Config

type Config struct {
	// Active indicates if the watchtower client is enabled.
	Active bool

	// Client is the backing watchtower client that we'll interact with
	// through the watchtower RPC subserver.
	Client wtclient.Client

	// AnchorClient is the backing watchtower client for anchor channels that
	// we'll interact through the watchtower RPC subserver.
	AnchorClient wtclient.Client

	// Resolver is a custom resolver that will be used to resolve watchtower
	// addresses to ensure we don't leak any information when running over
	// non-clear networks, e.g. Tor, etc.
	Resolver lncfg.TCPResolver

	// Log is the logger instance we should log output to.
	Log btclog.Logger
}

Config is the primary configuration struct for the watchtower RPC server. It contains all the items required for the RPC server to carry out its duties. The fields with struct tags are meant to be parsed as normal configuration options, while if able to be populated, the latter fields MUST also be specified.

type GetTowerInfoRequest

type GetTowerInfoRequest struct {

	// The identifying public key of the watchtower to retrieve information for.
	Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
	// Whether we should include sessions with the watchtower in the response.
	IncludeSessions bool `protobuf:"varint,2,opt,name=include_sessions,json=includeSessions,proto3" json:"include_sessions,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTowerInfoRequest) Descriptor deprecated

func (*GetTowerInfoRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetTowerInfoRequest.ProtoReflect.Descriptor instead.

func (*GetTowerInfoRequest) GetIncludeSessions

func (x *GetTowerInfoRequest) GetIncludeSessions() bool

func (*GetTowerInfoRequest) GetPubkey

func (x *GetTowerInfoRequest) GetPubkey() []byte

func (*GetTowerInfoRequest) ProtoMessage

func (*GetTowerInfoRequest) ProtoMessage()

func (*GetTowerInfoRequest) ProtoReflect

func (x *GetTowerInfoRequest) ProtoReflect() protoreflect.Message

func (*GetTowerInfoRequest) Reset

func (x *GetTowerInfoRequest) Reset()

func (*GetTowerInfoRequest) String

func (x *GetTowerInfoRequest) String() string

type ListTowersRequest

type ListTowersRequest struct {

	// Whether we should include sessions with the watchtower in the response.
	IncludeSessions bool `protobuf:"varint,1,opt,name=include_sessions,json=includeSessions,proto3" json:"include_sessions,omitempty"`
	// contains filtered or unexported fields
}

func (*ListTowersRequest) Descriptor deprecated

func (*ListTowersRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListTowersRequest.ProtoReflect.Descriptor instead.

func (*ListTowersRequest) GetIncludeSessions

func (x *ListTowersRequest) GetIncludeSessions() bool

func (*ListTowersRequest) ProtoMessage

func (*ListTowersRequest) ProtoMessage()

func (*ListTowersRequest) ProtoReflect

func (x *ListTowersRequest) ProtoReflect() protoreflect.Message

func (*ListTowersRequest) Reset

func (x *ListTowersRequest) Reset()

func (*ListTowersRequest) String

func (x *ListTowersRequest) String() string

type ListTowersResponse

type ListTowersResponse struct {

	// The list of watchtowers available for new backups.
	Towers []*Tower `protobuf:"bytes,1,rep,name=towers,proto3" json:"towers,omitempty"`
	// contains filtered or unexported fields
}

func (*ListTowersResponse) Descriptor deprecated

func (*ListTowersResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListTowersResponse.ProtoReflect.Descriptor instead.

func (*ListTowersResponse) GetTowers

func (x *ListTowersResponse) GetTowers() []*Tower

func (*ListTowersResponse) ProtoMessage

func (*ListTowersResponse) ProtoMessage()

func (*ListTowersResponse) ProtoReflect

func (x *ListTowersResponse) ProtoReflect() protoreflect.Message

func (*ListTowersResponse) Reset

func (x *ListTowersResponse) Reset()

func (*ListTowersResponse) String

func (x *ListTowersResponse) String() string

type PolicyRequest

type PolicyRequest struct {

	//
	//The client type from which to retrieve the active offering policy.
	PolicyType PolicyType `protobuf:"varint,1,opt,name=policy_type,json=policyType,proto3,enum=wtclientrpc.PolicyType" json:"policy_type,omitempty"`
	// contains filtered or unexported fields
}

func (*PolicyRequest) Descriptor deprecated

func (*PolicyRequest) Descriptor() ([]byte, []int)

Deprecated: Use PolicyRequest.ProtoReflect.Descriptor instead.

func (*PolicyRequest) GetPolicyType

func (x *PolicyRequest) GetPolicyType() PolicyType

func (*PolicyRequest) ProtoMessage

func (*PolicyRequest) ProtoMessage()

func (*PolicyRequest) ProtoReflect

func (x *PolicyRequest) ProtoReflect() protoreflect.Message

func (*PolicyRequest) Reset

func (x *PolicyRequest) Reset()

func (*PolicyRequest) String

func (x *PolicyRequest) String() string

type PolicyResponse

type PolicyResponse struct {

	//
	//The maximum number of updates each session we negotiate with watchtowers
	//should allow.
	MaxUpdates uint32 `protobuf:"varint,1,opt,name=max_updates,json=maxUpdates,proto3" json:"max_updates,omitempty"`
	//
	//Deprecated, use sweep_sat_per_vbyte.
	//The fee rate, in satoshis per vbyte, that will be used by watchtowers for
	//justice transactions in response to channel breaches.
	//
	// Deprecated: Do not use.
	SweepSatPerByte uint32 `protobuf:"varint,2,opt,name=sweep_sat_per_byte,json=sweepSatPerByte,proto3" json:"sweep_sat_per_byte,omitempty"`
	//
	//The fee rate, in satoshis per vbyte, that will be used by watchtowers for
	//justice transactions in response to channel breaches.
	SweepSatPerVbyte uint32 `protobuf:"varint,3,opt,name=sweep_sat_per_vbyte,json=sweepSatPerVbyte,proto3" json:"sweep_sat_per_vbyte,omitempty"`
	// contains filtered or unexported fields
}

func (*PolicyResponse) Descriptor deprecated

func (*PolicyResponse) Descriptor() ([]byte, []int)

Deprecated: Use PolicyResponse.ProtoReflect.Descriptor instead.

func (*PolicyResponse) GetMaxUpdates

func (x *PolicyResponse) GetMaxUpdates() uint32

func (*PolicyResponse) GetSweepSatPerByte deprecated

func (x *PolicyResponse) GetSweepSatPerByte() uint32

Deprecated: Do not use.

func (*PolicyResponse) GetSweepSatPerVbyte

func (x *PolicyResponse) GetSweepSatPerVbyte() uint32

func (*PolicyResponse) ProtoMessage

func (*PolicyResponse) ProtoMessage()

func (*PolicyResponse) ProtoReflect

func (x *PolicyResponse) ProtoReflect() protoreflect.Message

func (*PolicyResponse) Reset

func (x *PolicyResponse) Reset()

func (*PolicyResponse) String

func (x *PolicyResponse) String() string

type PolicyType

type PolicyType int32
const (
	// Selects the policy from the legacy tower client.
	PolicyType_LEGACY PolicyType = 0
	// Selects the policy from the anchor tower client.
	PolicyType_ANCHOR PolicyType = 1
)

func (PolicyType) Descriptor

func (PolicyType) Descriptor() protoreflect.EnumDescriptor

func (PolicyType) Enum

func (x PolicyType) Enum() *PolicyType

func (PolicyType) EnumDescriptor deprecated

func (PolicyType) EnumDescriptor() ([]byte, []int)

Deprecated: Use PolicyType.Descriptor instead.

func (PolicyType) Number

func (x PolicyType) Number() protoreflect.EnumNumber

func (PolicyType) String

func (x PolicyType) String() string

func (PolicyType) Type

type RemoveTowerRequest

type RemoveTowerRequest struct {

	// The identifying public key of the watchtower to remove.
	Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
	//
	//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.
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveTowerRequest) Descriptor deprecated

func (*RemoveTowerRequest) Descriptor() ([]byte, []int)

Deprecated: Use RemoveTowerRequest.ProtoReflect.Descriptor instead.

func (*RemoveTowerRequest) GetAddress

func (x *RemoveTowerRequest) GetAddress() string

func (*RemoveTowerRequest) GetPubkey

func (x *RemoveTowerRequest) GetPubkey() []byte

func (*RemoveTowerRequest) ProtoMessage

func (*RemoveTowerRequest) ProtoMessage()

func (*RemoveTowerRequest) ProtoReflect

func (x *RemoveTowerRequest) ProtoReflect() protoreflect.Message

func (*RemoveTowerRequest) Reset

func (x *RemoveTowerRequest) Reset()

func (*RemoveTowerRequest) String

func (x *RemoveTowerRequest) String() string

type RemoveTowerResponse

type RemoveTowerResponse struct {
	// contains filtered or unexported fields
}

func (*RemoveTowerResponse) Descriptor deprecated

func (*RemoveTowerResponse) Descriptor() ([]byte, []int)

Deprecated: Use RemoveTowerResponse.ProtoReflect.Descriptor instead.

func (*RemoveTowerResponse) ProtoMessage

func (*RemoveTowerResponse) ProtoMessage()

func (*RemoveTowerResponse) ProtoReflect

func (x *RemoveTowerResponse) ProtoReflect() protoreflect.Message

func (*RemoveTowerResponse) Reset

func (x *RemoveTowerResponse) Reset()

func (*RemoveTowerResponse) String

func (x *RemoveTowerResponse) String() string

type ServerShell

type ServerShell struct {
	WatchtowerClientServer
}

ServerShell is a shell struct holding a reference to the actual sub-server. It is used to register the gRPC sub-server with the root server before we have the necessary dependencies to populate the actual sub-server.

func (*ServerShell) CreateSubServer

func (r *ServerShell) CreateSubServer(configRegistry lnrpc.SubServerConfigDispatcher) (
	lnrpc.SubServer, lnrpc.MacaroonPerms, error)

CreateSubServer populates the subserver's dependencies using the passed SubServerConfigDispatcher. This method should fully initialize the sub-server instance, making it ready for action. It returns the macaroon permissions that the sub-server wishes to pass on to the root server for all methods routed towards it.

NOTE: This is part of the lnrpc.GrpcHandler interface.

func (*ServerShell) RegisterWithRestServer

func (r *ServerShell) RegisterWithRestServer(ctx context.Context,
	mux *runtime.ServeMux, dest string, opts []grpc.DialOption) error

RegisterWithRestServer will be called by the root REST mux to direct a sub RPC server to register itself with the main REST mux 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.GrpcHandler interface.

func (*ServerShell) RegisterWithRootServer

func (r *ServerShell) RegisterWithRootServer(grpcServer *grpc.Server) error

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.GrpcHandler interface.

type StatsRequest

type StatsRequest struct {
	// contains filtered or unexported fields
}

func (*StatsRequest) Descriptor deprecated

func (*StatsRequest) Descriptor() ([]byte, []int)

Deprecated: Use StatsRequest.ProtoReflect.Descriptor instead.

func (*StatsRequest) ProtoMessage

func (*StatsRequest) ProtoMessage()

func (*StatsRequest) ProtoReflect

func (x *StatsRequest) ProtoReflect() protoreflect.Message

func (*StatsRequest) Reset

func (x *StatsRequest) Reset()

func (*StatsRequest) String

func (x *StatsRequest) String() string

type StatsResponse

type StatsResponse struct {

	//
	//The total number of backups made to all active and exhausted watchtower
	//sessions.
	NumBackups uint32 `protobuf:"varint,1,opt,name=num_backups,json=numBackups,proto3" json:"num_backups,omitempty"`
	//
	//The total number of backups that are pending to be acknowledged by all
	//active and exhausted watchtower sessions.
	NumPendingBackups uint32 `protobuf:"varint,2,opt,name=num_pending_backups,json=numPendingBackups,proto3" json:"num_pending_backups,omitempty"`
	//
	//The total number of backups that all active and exhausted watchtower
	//sessions have failed to acknowledge.
	NumFailedBackups uint32 `protobuf:"varint,3,opt,name=num_failed_backups,json=numFailedBackups,proto3" json:"num_failed_backups,omitempty"`
	// The total number of new sessions made to watchtowers.
	NumSessionsAcquired uint32 `protobuf:"varint,4,opt,name=num_sessions_acquired,json=numSessionsAcquired,proto3" json:"num_sessions_acquired,omitempty"`
	// The total number of watchtower sessions that have been exhausted.
	NumSessionsExhausted uint32 `protobuf:"varint,5,opt,name=num_sessions_exhausted,json=numSessionsExhausted,proto3" json:"num_sessions_exhausted,omitempty"`
	// contains filtered or unexported fields
}

func (*StatsResponse) Descriptor deprecated

func (*StatsResponse) Descriptor() ([]byte, []int)

Deprecated: Use StatsResponse.ProtoReflect.Descriptor instead.

func (*StatsResponse) GetNumBackups

func (x *StatsResponse) GetNumBackups() uint32

func (*StatsResponse) GetNumFailedBackups

func (x *StatsResponse) GetNumFailedBackups() uint32

func (*StatsResponse) GetNumPendingBackups

func (x *StatsResponse) GetNumPendingBackups() uint32

func (*StatsResponse) GetNumSessionsAcquired

func (x *StatsResponse) GetNumSessionsAcquired() uint32

func (*StatsResponse) GetNumSessionsExhausted

func (x *StatsResponse) GetNumSessionsExhausted() uint32

func (*StatsResponse) ProtoMessage

func (*StatsResponse) ProtoMessage()

func (*StatsResponse) ProtoReflect

func (x *StatsResponse) ProtoReflect() protoreflect.Message

func (*StatsResponse) Reset

func (x *StatsResponse) Reset()

func (*StatsResponse) String

func (x *StatsResponse) String() string

type Tower

type Tower struct {

	// The identifying public key of the watchtower.
	Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
	// The list of addresses the watchtower is reachable over.
	Addresses []string `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"`
	// Whether the watchtower is currently a candidate for new sessions.
	ActiveSessionCandidate bool `` /* 130-byte string literal not displayed */
	// The number of sessions that have been negotiated with the watchtower.
	NumSessions uint32 `protobuf:"varint,4,opt,name=num_sessions,json=numSessions,proto3" json:"num_sessions,omitempty"`
	// The list of sessions that have been negotiated with the watchtower.
	Sessions []*TowerSession `protobuf:"bytes,5,rep,name=sessions,proto3" json:"sessions,omitempty"`
	// contains filtered or unexported fields
}

func (*Tower) Descriptor deprecated

func (*Tower) Descriptor() ([]byte, []int)

Deprecated: Use Tower.ProtoReflect.Descriptor instead.

func (*Tower) GetActiveSessionCandidate

func (x *Tower) GetActiveSessionCandidate() bool

func (*Tower) GetAddresses

func (x *Tower) GetAddresses() []string

func (*Tower) GetNumSessions

func (x *Tower) GetNumSessions() uint32

func (*Tower) GetPubkey

func (x *Tower) GetPubkey() []byte

func (*Tower) GetSessions

func (x *Tower) GetSessions() []*TowerSession

func (*Tower) ProtoMessage

func (*Tower) ProtoMessage()

func (*Tower) ProtoReflect

func (x *Tower) ProtoReflect() protoreflect.Message

func (*Tower) Reset

func (x *Tower) Reset()

func (*Tower) String

func (x *Tower) String() string

type TowerSession

type TowerSession struct {

	//
	//The total number of successful backups that have been made to the
	//watchtower session.
	NumBackups uint32 `protobuf:"varint,1,opt,name=num_backups,json=numBackups,proto3" json:"num_backups,omitempty"`
	//
	//The total number of backups in the session that are currently pending to be
	//acknowledged by the watchtower.
	NumPendingBackups uint32 `protobuf:"varint,2,opt,name=num_pending_backups,json=numPendingBackups,proto3" json:"num_pending_backups,omitempty"`
	// The maximum number of backups allowed by the watchtower session.
	MaxBackups uint32 `protobuf:"varint,3,opt,name=max_backups,json=maxBackups,proto3" json:"max_backups,omitempty"`
	//
	//Deprecated, use sweep_sat_per_vbyte.
	//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.
	//
	// Deprecated: Do not use.
	SweepSatPerByte uint32 `protobuf:"varint,4,opt,name=sweep_sat_per_byte,json=sweepSatPerByte,proto3" json:"sweep_sat_per_byte,omitempty"`
	//
	//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.
	SweepSatPerVbyte uint32 `protobuf:"varint,5,opt,name=sweep_sat_per_vbyte,json=sweepSatPerVbyte,proto3" json:"sweep_sat_per_vbyte,omitempty"`
	// contains filtered or unexported fields
}

func (*TowerSession) Descriptor deprecated

func (*TowerSession) Descriptor() ([]byte, []int)

Deprecated: Use TowerSession.ProtoReflect.Descriptor instead.

func (*TowerSession) GetMaxBackups

func (x *TowerSession) GetMaxBackups() uint32

func (*TowerSession) GetNumBackups

func (x *TowerSession) GetNumBackups() uint32

func (*TowerSession) GetNumPendingBackups

func (x *TowerSession) GetNumPendingBackups() uint32

func (*TowerSession) GetSweepSatPerByte deprecated

func (x *TowerSession) GetSweepSatPerByte() uint32

Deprecated: Do not use.

func (*TowerSession) GetSweepSatPerVbyte

func (x *TowerSession) GetSweepSatPerVbyte() uint32

func (*TowerSession) ProtoMessage

func (*TowerSession) ProtoMessage()

func (*TowerSession) ProtoReflect

func (x *TowerSession) ProtoReflect() protoreflect.Message

func (*TowerSession) Reset

func (x *TowerSession) Reset()

func (*TowerSession) String

func (x *TowerSession) String() string

type UnimplementedWatchtowerClientServer

type UnimplementedWatchtowerClientServer struct {
}

UnimplementedWatchtowerClientServer can be embedded to have forward compatible implementations.

func (*UnimplementedWatchtowerClientServer) AddTower

func (*UnimplementedWatchtowerClientServer) GetTowerInfo

func (*UnimplementedWatchtowerClientServer) ListTowers

func (*UnimplementedWatchtowerClientServer) Policy

func (*UnimplementedWatchtowerClientServer) RemoveTower

func (*UnimplementedWatchtowerClientServer) Stats

type WatchtowerClient

type WatchtowerClient struct {
	// contains filtered or unexported fields
}

WatchtowerClient is the RPC server we'll use to interact with the backing active watchtower client.

TODO(wilmer): better name?

func New

New returns a new instance of the wtclientrpc WatchtowerClient 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 (*WatchtowerClient) AddTower

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 (*WatchtowerClient) GetTowerInfo

func (c *WatchtowerClient) GetTowerInfo(ctx context.Context,
	req *GetTowerInfoRequest) (*Tower, error)

GetTowerInfo retrieves information for a registered watchtower.

func (*WatchtowerClient) ListTowers

ListTowers returns the list of watchtowers registered with the client.

func (*WatchtowerClient) Name

func (c *WatchtowerClient) Name() string

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 (*WatchtowerClient) Policy

Policy returns the active watchtower client policy configuration.

func (*WatchtowerClient) RemoveTower

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.

func (*WatchtowerClient) Start

func (c *WatchtowerClient) Start() error

Start launches any helper goroutines required for the WatchtowerClient to function.

NOTE: This is part of the lnrpc.SubWatchtowerClient interface.

func (*WatchtowerClient) Stats

Stats returns the in-memory statistics of the client since startup.

func (*WatchtowerClient) Stop

func (c *WatchtowerClient) Stop() error

Stop signals any active goroutines for a graceful closure.

NOTE: This is part of the lnrpc.SubServer interface.

type WatchtowerClientClient

type WatchtowerClientClient interface {
	//
	//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.
	AddTower(ctx context.Context, in *AddTowerRequest, opts ...grpc.CallOption) (*AddTowerResponse, error)
	//
	//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.
	RemoveTower(ctx context.Context, in *RemoveTowerRequest, opts ...grpc.CallOption) (*RemoveTowerResponse, error)
	// ListTowers returns the list of watchtowers registered with the client.
	ListTowers(ctx context.Context, in *ListTowersRequest, opts ...grpc.CallOption) (*ListTowersResponse, error)
	// GetTowerInfo retrieves information for a registered watchtower.
	GetTowerInfo(ctx context.Context, in *GetTowerInfoRequest, opts ...grpc.CallOption) (*Tower, error)
	// Stats returns the in-memory statistics of the client since startup.
	Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error)
	// Policy returns the active watchtower client policy configuration.
	Policy(ctx context.Context, in *PolicyRequest, opts ...grpc.CallOption) (*PolicyResponse, error)
}

WatchtowerClientClient is the client API for WatchtowerClient service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type WatchtowerClientServer

type WatchtowerClientServer interface {
	//
	//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.
	AddTower(context.Context, *AddTowerRequest) (*AddTowerResponse, error)
	//
	//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.
	RemoveTower(context.Context, *RemoveTowerRequest) (*RemoveTowerResponse, error)
	// ListTowers returns the list of watchtowers registered with the client.
	ListTowers(context.Context, *ListTowersRequest) (*ListTowersResponse, error)
	// GetTowerInfo retrieves information for a registered watchtower.
	GetTowerInfo(context.Context, *GetTowerInfoRequest) (*Tower, error)
	// Stats returns the in-memory statistics of the client since startup.
	Stats(context.Context, *StatsRequest) (*StatsResponse, error)
	// Policy returns the active watchtower client policy configuration.
	Policy(context.Context, *PolicyRequest) (*PolicyResponse, error)
}

WatchtowerClientServer is the server API for WatchtowerClient service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL