Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Add option to spin up a sidecar acceptor #8

Open
wants to merge 3 commits into
base: 0-13-3-branch-f1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ const (
defaultChainSubDirname = "chain"
defaultGraphSubDirname = "graph"
defaultTowerSubDirname = "watchtower"
defaultPoolDirname = "pool"
defaultTLSCertFilename = "tls.cert"
defaultTLSKeyFilename = "tls.key"
defaultAdminMacFilename = "admin.macaroon"
@@ -177,6 +178,7 @@ var (

defaultDataDir = filepath.Join(DefaultLndDir, defaultDataDirname)
defaultLogDir = filepath.Join(DefaultLndDir, defaultLogDirname)
defaultPoolDir = filepath.Join(DefaultLndDir, defaultPoolDirname)

defaultTowerDir = filepath.Join(defaultDataDir, defaultTowerSubDirname)

@@ -233,6 +235,7 @@ type Config struct {
ReadMacPath string `long:"readonlymacaroonpath" description:"Path to write the read-only macaroon for lnd's RPC and REST services if it doesn't exist"`
InvoiceMacPath string `long:"invoicemacaroonpath" description:"Path to the invoice-only macaroon for lnd's RPC and REST services if it doesn't exist"`
LogDir string `long:"logdir" description:"Directory to log output."`
PoolDir string `long:"pooldir" description:"DIrectory to store sidecar ticket data."`
MaxLogFiles int `long:"maxlogfiles" description:"Maximum logfiles to keep (0 for no rotation)"`
MaxLogFileSize int `long:"maxlogfilesize" description:"Maximum logfile size in MB"`
AcceptorTimeout time.Duration `long:"acceptortimeout" description:"Time after which an RPCAcceptor will time out and return false if it hasn't yet received a response"`
@@ -360,6 +363,8 @@ type Config struct {

DustThreshold uint64 `long:"dust-threshold" description:"Sets the dust sum threshold in satoshis for a channel after which dust HTLC's will be failed."`

SidecarAcceptor bool `long:"sidecar-acceptor" description:"If true, we run a sidecar acceptor alongside lnd"`

Invoices *lncfg.Invoices `group:"invoices" namespace:"invoices"`

Routing *lncfg.Routing `group:"routing" namespace:"routing"`
@@ -520,6 +525,7 @@ func DefaultConfig() Config {
Watchtower: &lncfg.Watchtower{
TowerDir: defaultTowerDir,
},
PoolDir: defaultPoolDir,
HealthChecks: &lncfg.HealthCheckConfig{
ChainCheck: &lncfg.CheckConfig{
Interval: defaultChainInterval,
@@ -657,6 +663,7 @@ func ValidateConfig(cfg Config, usageMessage string,
cfg.TLSCertPath = filepath.Join(lndDir, defaultTLSCertFilename)
cfg.TLSKeyPath = filepath.Join(lndDir, defaultTLSKeyFilename)
cfg.LogDir = filepath.Join(lndDir, defaultLogDirname)
cfg.PoolDir = filepath.Join(lndDir, defaultPoolDirname)

// If the watchtower's directory is set to the default, i.e. the
// user has not requested a different location, we'll move the
@@ -665,6 +672,11 @@ func ValidateConfig(cfg Config, usageMessage string,
cfg.Watchtower.TowerDir =
filepath.Join(cfg.DataDir, defaultTowerSubDirname)
}

if cfg.PoolDir == defaultPoolDir {
cfg.PoolDir =
filepath.Join(cfg.DataDir, defaultPoolDirname)
}
}

funcName := "loadConfig"
@@ -702,6 +714,7 @@ func ValidateConfig(cfg Config, usageMessage string,
cfg.ReadMacPath = CleanAndExpandPath(cfg.ReadMacPath)
cfg.InvoiceMacPath = CleanAndExpandPath(cfg.InvoiceMacPath)
cfg.LogDir = CleanAndExpandPath(cfg.LogDir)
cfg.PoolDir = CleanAndExpandPath(cfg.PoolDir)
cfg.BtcdMode.Dir = CleanAndExpandPath(cfg.BtcdMode.Dir)
cfg.LtcdMode.Dir = CleanAndExpandPath(cfg.LtcdMode.Dir)
cfg.BitcoindMode.Dir = CleanAndExpandPath(cfg.BitcoindMode.Dir)
@@ -1266,6 +1279,10 @@ func ValidateConfig(cfg Config, usageMessage string,
cfg.registeredChains.PrimaryChain().String(),
lncfg.NormalizeNetwork(cfg.ActiveNetParams.Name))

cfg.PoolDir = filepath.Join(cfg.PoolDir,
cfg.registeredChains.PrimaryChain().String(),
lncfg.NormalizeNetwork(cfg.ActiveNetParams.Name))

// A log writer must be passed in, otherwise we can't function and would
// run into a panic later on.
if cfg.LogWriter == nil {
33 changes: 11 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/lightningnetwork/lnd

require (
git.schwanenlied.me/yawning/bsaes.git v0.0.0-20180720073208-c0276d75487e // indirect
github.com/NebulousLabs/fastrand v0.0.0-20181203155948-6fb6489aac4e // indirect
github.com/NebulousLabs/go-upnp v0.0.0-20180202185039-29b680b06c82
github.com/Yawning/aez v0.0.0-20180114000226-4dad034d9db2
github.com/btcsuite/btcd v0.22.0-beta.0.20210916191717-f8e6854197cd
@@ -12,13 +10,10 @@ require (
github.com/btcsuite/btcwallet v0.12.1-0.20210826004415-4ef582f76b02
github.com/btcsuite/btcwallet/wallet/txauthor v1.1.0
github.com/btcsuite/btcwallet/wallet/txrules v1.1.0
github.com/btcsuite/btcwallet/wallet/txsizes v1.1.0 // indirect
github.com/btcsuite/btcwallet/walletdb v1.3.6-0.20210803004036-eebed51155ec
github.com/btcsuite/btcwallet/wtxmgr v1.3.1-0.20210822222949-9b5a201c344c
github.com/davecgh/go-spew v1.1.1
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-errors/errors v1.0.1
github.com/go-openapi/strfmt v0.19.5 // indirect
github.com/golang/protobuf v1.4.3
github.com/gorilla/websocket v1.4.2
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4
@@ -29,15 +24,10 @@ require (
github.com/jedib0t/go-pretty v4.3.0+incompatible
github.com/jessevdk/go-flags v1.4.0
github.com/jrick/logrotate v1.0.0
github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c // indirect
github.com/juju/errors v0.0.0-20190806202954-0232dcc7464d // indirect
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 // indirect
github.com/juju/retry v0.0.0-20180821225755-9058e192b216 // indirect
github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2 // indirect
github.com/juju/utils v0.0.0-20180820210520-bf9cc5bdd62d // indirect
github.com/juju/version v0.0.0-20180108022336-b64dbd566305 // indirect
github.com/kkdai/bstream v1.0.0
github.com/lightninglabs/lndclient v0.12.0-8
github.com/lightninglabs/neutrino v0.12.1
github.com/lightninglabs/pool v0.5.0-alpha
github.com/lightninglabs/protobuf-hex-display v1.4.3-hex-display
github.com/lightningnetwork/lightning-onion v1.0.2-0.20210520211913-522b799e65b1
github.com/lightningnetwork/lnd/cert v1.0.3
@@ -47,24 +37,23 @@ require (
github.com/lightningnetwork/lnd/queue v1.0.4
github.com/lightningnetwork/lnd/ticker v1.0.0
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/miekg/dns v0.0.0-20171125082028-79bfde677fa8
github.com/prometheus/client_golang v1.0.0
github.com/miekg/dns v1.1.43
github.com/prometheus/client_golang v1.11.0
github.com/stretchr/testify v1.7.0
github.com/tv42/zbase32 v0.0.0-20160707012821-501572607d02
github.com/urfave/cli v1.20.0
go.etcd.io/etcd v3.4.14+incompatible
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0
golang.org/x/net v0.0.0-20210913180222-943fd674d43e
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
google.golang.org/grpc v1.29.1
google.golang.org/protobuf v1.23.0
gopkg.in/errgo.v1 v1.0.1 // indirect
google.golang.org/protobuf v1.26.0-rc.1
gopkg.in/macaroon-bakery.v2 v2.0.1
gopkg.in/macaroon.v2 v2.0.0
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
gopkg.in/macaroon.v2 v2.1.0
)

replace github.com/lightninglabs/pool => github.com/orbitalturtle/pool v0.4.4-alpha.0.20211026234715-1ad32d9ecd10

replace github.com/lightningnetwork/lnd/ticker => ./ticker

replace github.com/lightningnetwork/lnd/queue => ./queue
Loading