Skip to content

Commit

Permalink
feat: add vss_enabled property to nwc_node_started event (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz authored Dec 8, 2024
1 parent 4dbbd34 commit f1d679b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lnclient/ldk/ldk.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func NewLDKService(ctx context.Context, cfg config.Config, eventPublisher events
}

logger.Logger.WithFields(logrus.Fields{
"vss": vssToken != "",
"vss_enabled": vssToken != "",
}).Info("Creating node")
var node *ldk_node.Node
if vssToken != "" {
Expand Down
5 changes: 4 additions & 1 deletion service/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ func (svc *service) launchLNBackend(ctx context.Context, encryptionKey string) e
logger.Logger.Infof("Launching LN Backend: %s", lnBackend)
var lnClient lnclient.LNClient
var err error
vssEnabled := false
switch lnBackend {
case config.LNDBackendType:
LNDAddress, _ := svc.cfg.Get("LNDAddress", encryptionKey)
Expand All @@ -284,6 +285,7 @@ func (svc *service) launchLNBackend(ctx context.Context, encryptionKey string) e
logger.Logger.WithError(err).Error("Failed to request VSS token")
return err
}
vssEnabled = vssToken != ""

lnClient, err = ldk.NewLDKService(ctx, svc.cfg, svc.eventPublisher, mnemonic, ldkWorkdir, svc.cfg.GetEnv().LDKNetwork, nil, false, vssToken)
case config.GreenlightBackendType:
Expand Down Expand Up @@ -342,7 +344,8 @@ func (svc *service) launchLNBackend(ctx context.Context, encryptionKey string) e
svc.eventPublisher.Publish(&events.Event{
Event: "nwc_node_started",
Properties: map[string]interface{}{
"node_type": lnBackend,
"node_type": lnBackend,
"vss_enabled": vssEnabled,
},
})

Expand Down

0 comments on commit f1d679b

Please sign in to comment.