added sample config

This commit is contained in:
michael1011 2018-03-29 15:01:28 +02:00
parent 08057fcb04
commit 1f7126d4c2
No known key found for this signature in database
GPG Key ID: 84D249BA71685D46
3 changed files with 41 additions and 9 deletions

View File

@ -14,9 +14,9 @@ import (
)
type LND struct {
RPCHost string `long:"rpchost" Description:"Host that the gRPC interface of LND is listening to"`
CertFile string `long:"certfile" Description:"TLS certificate for LND gRPC and REST services"`
MacaroonFile string `long:"macaroonfile" Description:"Admin macaroon file for LND authentication. Set to an empty string for no macaroon"`
GRPCHost string `long:"grpchost" Description:"Host of the gRPC interface of LND"`
CertFile string `long:"certfile" Description:"TLS certificate for the LND gRPC and REST services"`
MacaroonFile string `long:"macaroonfile" Description:"Admin macaroon file for authentication. Set to an empty string for no macaroon"`
client lnrpc.LightningClient
ctx context.Context
@ -31,7 +31,7 @@ func (lnd *LND) Connect() error {
return err
}
con, err := grpc.Dial(lnd.RPCHost, grpc.WithTransportCredentials(creds))
con, err := grpc.Dial(lnd.GRPCHost, grpc.WithTransportCredentials(creds))
if err != nil {
log.Error("Failed to connect to LND gRPC server")

View File

@ -21,18 +21,18 @@ const (
defaultTipExpiry = 3600
defaultLndRPCHost = "localhost:10009"
defaultLndGRPCHost = "localhost:10009"
defaultLndCertFile = "tls.cert"
defaultMacaroonFile = "admin.macaroon"
)
type config struct {
ConfigFile string `long:"config" Description:"Config file location"`
ConfigFile string `long:"config" Description:"Location of the config file"`
LogFile string `long:"logfile" Description:"Log file location"`
LogFile string `long:"logfile" Description:"Location of the log file"`
LogLevel string `long:"loglevel" Description:"Log level: debug, info, warning, error"`
RESTHost string `long:"resthost" Description:"Host for the rest interface of LightningTip"`
RESTHost string `long:"resthost" Description:"Host for the REST interface of LightningTip"`
AccessDomain string `long:"accessdomain" Description:"The domain you are using LightningTip from"`
TipExpiry int64 `long:"tipexpiry" Description:"Invoice expiry time in seconds"`
@ -59,7 +59,7 @@ func initConfig() {
TipExpiry: defaultTipExpiry,
LND: &backends.LND{
RPCHost: defaultLndRPCHost,
GRPCHost: defaultLndGRPCHost,
CertFile: path.Join(lndDir, defaultLndCertFile),
MacaroonFile: path.Join(lndDir, defaultMacaroonFile),
},

32
sample-lightningTip.conf Normal file
View File

@ -0,0 +1,32 @@
[Application Options]
# Location of the log file
logfile = lightningTip.log
# Log level for log file and console. Options are: debug, info, warning and error
loglevel = info
# Host for the REST interface of LightningTip
resthost = localhost:8081
# The domain (or IP address) you are using LightningTip from
# Only needed if LightningTip is running on another port than the web server and no reverse proxy is used
# Set the value to "*" to allow all domains and IP addresses
# This value is used for the HTTP header: "Access-Control-Allow-Origin"
# accessdomain =
# After how many seconds invoices should expire
tipexpiry = 3600
[LND]
# LightningTip should work out of the box with LND
# You only have to change this settings if you edited the according settings in the LND config
# Host of the gRPC interface of LND
# lnd.grpchost = localhost:10009
# TLS certificate for the LND gRPC and REST services
# lnd.certfile = .lnd/tls.cert
# Admin macaroon file for authentication
# Set an empty string if you disabled the usage of macaroons (not recommended)
# lnd.macaroonfile = .lnd/admin.macaroon