Skip to content

Commit bcc52dc

Browse files
authored
Merge pull request #240 from lightninglabs/lnd-0.13-cleanup
Cleanup after upgrade to lnd v0.13.0-beta
2 parents 9a4d739 + 728a262 commit bcc52dc

File tree

5 files changed

+34
-17
lines changed

5 files changed

+34
-17
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Lightning Terminal is backwards compatible with `lnd` back to version v0.12.0-be
7070

7171
| LiT | LND |
7272
| ---------------- | ------------ |
73-
| **v0.4.2-alpha** | v0.12.0-beta |
73+
| **v0.5.0-alpha** | v0.12.0-beta |
7474
| **v0.4.1-alpha** | v0.11.1-beta |
7575
| **v0.4.0-alpha** | v0.11.1-beta |
7676
| **v0.3.4-alpha** | v0.11.1-beta |
@@ -84,7 +84,7 @@ Lightning Terminal is backwards compatible with `lnd` back to version v0.12.0-be
8484

8585
| LiT | LND | Loop | Faraday | Pool |
8686
| ---------------- | ------------ | ----------- | ------------ |---------------|
87-
| **v0.4.2-alpha** | v0.13.0-beta | v0.13.0-beta | v0.2.5-alpha | v0.5.0-alpha |
87+
| **v0.5.0-alpha** | v0.13.0-beta | v0.14.1-beta | v0.2.6-alpha | v0.5.0-alpha |
8888
| **v0.4.1-alpha** | v0.12.1-beta | v0.11.4-beta | v0.2.3-alpha | v0.4.4-alpha |
8989
| **v0.4.0-alpha** | v0.12.0-beta | v0.11.2-beta | v0.2.3-alpha | v0.4.3-alpha |
9090
| **v0.3.4-alpha** | v0.11.1-beta | v0.11.2-beta | v0.2.2-alpha | v0.3.4-alpha |

app/scripts/build-protos.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const protoSources = async () => {
2121
const goModPath = join(appPath, '..', 'go.mod');
2222
const goModSource = (await fs.readFile(goModPath)).toString();
2323

24-
const lndVersion = ['', 'v0.13.0-beta.rc3']; // TODO revert: goModSource.match(LND_VERSION_PATTERN);
24+
const lndVersion = goModSource.match(LND_VERSION_PATTERN);
2525
if (!lndVersion || lndVersion.length !== 2) {
2626
throw new Error(`go.mod did not match pattern ${LND_VERSION_PATTERN}`);
2727
}

config.go

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,23 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
336336
cfg.loopRemote = cfg.LoopMode == ModeRemote
337337
cfg.poolRemote = cfg.PoolMode == ModeRemote
338338

339+
// Now that we've registered all loggers, let's parse, validate, and set
340+
// the debug log level(s). In remote lnd mode we have a global log level
341+
// that overwrites all others. In integrated mode we use the lnd log
342+
// level as the master level.
343+
if cfg.lndRemote {
344+
err = build.ParseAndSetDebugLevels(
345+
cfg.Remote.LitDebugLevel, cfg.Lnd.LogWriter,
346+
)
347+
} else {
348+
err = build.ParseAndSetDebugLevels(
349+
cfg.Lnd.DebugLevel, cfg.Lnd.LogWriter,
350+
)
351+
}
352+
if err != nil {
353+
return nil, err
354+
}
355+
339356
// Validate the lightning-terminal config options.
340357
litDir := lnd.CleanAndExpandPath(preCfg.LitDir)
341358
cfg.LetsEncryptDir = lncfg.CleanAndExpandPath(cfg.LetsEncryptDir)
@@ -378,14 +395,18 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
378395
// (like the log or lnd options) as they will be taken from lnd's config
379396
// struct. Others we want to force to be the same as lnd so the user
380397
// doesn't have to set them manually, like the network for example.
398+
cfg.Faraday.Lnd.MacaroonPath = faraday.DefaultLndMacaroonPath
381399
if err := faraday.ValidateConfig(cfg.Faraday); err != nil {
382400
return nil, err
383401
}
384-
cfg.Loop.Lnd.MacaroonPath = loopd.DefaultMacaroonPath
402+
403+
defaultLoopCfg := loopd.DefaultConfig()
404+
cfg.Loop.Lnd.MacaroonPath = defaultLoopCfg.Lnd.MacaroonPath
385405
if err := loopd.Validate(cfg.Loop); err != nil {
386406
return nil, err
387407
}
388-
cfg.Pool.Lnd.MacaroonPath = pool.DefaultMacaroonPath
408+
409+
cfg.Pool.Lnd.MacaroonPath = pool.DefaultLndMacaroonPath
389410
if err := pool.Validate(cfg.Pool); err != nil {
390411
return nil, err
391412
}
@@ -419,7 +440,6 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
419440
}
420441
}
421442

422-
defaultLoopCfg := loopd.DefaultConfig()
423443
if cfg.loopRemote && cfg.Network != defaultNetwork {
424444
if cfg.Remote.Loop.MacaroonPath == defaultLoopCfg.MacaroonPath {
425445
cfg.Remote.Loop.MacaroonPath = cfg.Loop.MacaroonPath
@@ -576,21 +596,21 @@ func validateRemoteModeConfig(cfg *Config) error {
576596
}
577597

578598
// In remote mode, we don't call lnd's ValidateConfig that sets up a
579-
// logging backend for us. We need to manually create and start one.
580-
logWriter := build.NewRotatingLogWriter()
581-
cfg.Lnd.LogWriter = logWriter
582-
err := logWriter.InitLogRotator(
599+
// logging backend for us. We need to manually create and start one. The
600+
// root logger should've already been created as part of the default
601+
// config though.
602+
if cfg.Lnd.LogWriter == nil {
603+
cfg.Lnd.LogWriter = build.NewRotatingLogWriter()
604+
}
605+
err := cfg.Lnd.LogWriter.InitLogRotator(
583606
filepath.Join(r.LitLogDir, cfg.Network, defaultLogFilename),
584607
r.LitMaxLogFileSize, r.LitMaxLogFiles,
585608
)
586609
if err != nil {
587610
return fmt.Errorf("log rotation setup failed: %v", err.Error())
588611
}
589612

590-
// Parse, validate, and set debug log level(s).
591-
return build.ParseAndSetDebugLevels(
592-
cfg.Remote.LitDebugLevel, logWriter,
593-
)
613+
return nil
594614
}
595615

596616
// setNetwork parses the top-level network config options and, if valid, sets it

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ require (
1616
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
1717
github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76
1818
github.com/prometheus/client_golang v1.5.1 // indirect
19-
github.com/rakyll/statik v0.1.7
2019
github.com/rs/cors v1.7.0 // indirect
2120
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
2221
google.golang.org/grpc v1.29.1

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,6 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
364364
github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8=
365365
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
366366
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
367-
github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ=
368-
github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc=
369367
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
370368
github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s=
371369
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=

0 commit comments

Comments
 (0)