Skip to content

Commit 219a9cc

Browse files
positiveblueguggero
authored andcommitted
multi: new disable mode for the taproot assets subserver
Enable to start litd with taproot asset subserver disabled. The default mode for the new sub-server is "Disabled" Add coverage in itests for flows with some subservers disabled (based on Elle's #537)
1 parent e78d1cb commit 219a9cc

File tree

5 files changed

+351
-102
lines changed

5 files changed

+351
-102
lines changed

config.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ const (
4242

4343
ModeIntegrated = "integrated"
4444
ModeRemote = "remote"
45+
ModeDisable = "disable"
4546

4647
DefaultLndMode = ModeRemote
4748
defaultFaradayMode = ModeIntegrated
4849
defaultLoopMode = ModeIntegrated
4950
defaultPoolMode = ModeIntegrated
50-
defaultTapMode = ModeIntegrated
51+
defaultTapMode = ModeDisable
5152

5253
defaultConfigFilename = "lit.conf"
5354

@@ -195,7 +196,7 @@ type Config struct {
195196
PoolMode string `long:"pool-mode" description:"The mode to run pool in, either 'integrated' (default) or 'remote'. 'integrated' means poold is started alongside the UI and everything is stored in pool's main data directory, configure everything by using the --pool.* flags. 'remote' means the UI connects to an existing poold node and acts as a proxy for gRPC calls to it." choice:"integrated" choice:"remote"`
196197
Pool *pool.Config `group:"Integrated pool options (use when pool-mode=integrated)" namespace:"pool"`
197198

198-
TaprootAssetsMode string `long:"taproot-assets-mode" description:"The mode to run taproot assets in, either 'integrated' (default) or 'remote'. 'integrated' means tapd is started alongside the UI and everything is stored in tap's main data directory, configure everything by using the --taproot-assets.* flags. 'remote' means the UI connects to an existing tapd node and acts as a proxy for gRPC calls to it." choice:"integrated" choice:"remote"`
199+
TaprootAssetsMode string `long:"taproot-assets-mode" description:"The mode to run taproot assets in, either 'integrated' (default), 'remote' or 'disable'. 'integrated' means tapd is started alongside the UI and everything is stored in tap's main data directory, configure everything by using the --taproot-assets.* flags. 'remote' means the UI connects to an existing tapd node and acts as a proxy for gRPC calls to it. 'disable' means that LiT is started without a connection to tapd" choice:"integrated" choice:"disable"`
199200
TaprootAssets *tapcfg.Config `group:"Integrated taproot assets options (use when taproot-assets=integrated)" namespace:"taproot-assets"`
200201

201202
RPCMiddleware *mid.Config `group:"RPC middleware options" namespace:"rpcmiddleware"`
@@ -462,9 +463,13 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
462463
return nil, err
463464
}
464465

465-
cfg.TaprootAssets, err = tapcfg.ValidateConfig(*cfg.TaprootAssets, log)
466-
if err != nil {
467-
return nil, err
466+
if cfg.TaprootAssetsMode != ModeDisable {
467+
cfg.TaprootAssets, err = tapcfg.ValidateConfig(
468+
*cfg.TaprootAssets, log,
469+
)
470+
if err != nil {
471+
return nil, err
472+
}
468473
}
469474

470475
// We've set the network before and have now validated the loop config

0 commit comments

Comments
 (0)