mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
lnrpc/watchtowerrpc: add WatchtowerBackend configs
This commit is contained in:
parent
72e4fbff97
commit
0db39d4fe6
13
lnrpc/watchtowerrpc/config_active.go
Normal file
13
lnrpc/watchtowerrpc/config_active.go
Normal file
@ -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
|
||||
}
|
6
lnrpc/watchtowerrpc/config_default.go
Normal file
6
lnrpc/watchtowerrpc/config_default.go
Normal file
@ -0,0 +1,6 @@
|
||||
// +build !watchtowerrpc
|
||||
|
||||
package watchtowerrpc
|
||||
|
||||
// Config is empty for non-watchtowerrpc builds.
|
||||
type Config struct{}
|
23
lnrpc/watchtowerrpc/interface.go
Normal file
23
lnrpc/watchtowerrpc/interface.go
Normal file
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user