Skip to content

Commit

Permalink
improve logging on nats variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Povilaszva committed Apr 29, 2024
1 parent e941c5a commit 675d11e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion injective-chain/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,13 @@ func NewInjectiveApp(
var err error
var nkey, jwt *string

natsUrl := os.Getenv("NATS_URL")
if natsUrl != "" {
fmt.Println("connecting to NATS_URL: ", natsUrl)
} else {
panic(fmt.Errorf("NATS_URL missing"))
}

accNkey := os.Getenv("NATS_ACC_NKEY")
if accNkey != "" {
nkey, jwt, err = CreateUser(accNkey)
Expand All @@ -403,7 +410,7 @@ func NewInjectiveApp(
if err != nil {
panic(fmt.Errorf("failed to generate user JWT: %w", err))
}
natsConnection, _ := publisherOptions.MakeNats("Injective Publisher", os.Getenv("NATS_URL"), "", *nkey, *jwt, "", "", "")
natsConnection, _ := publisherOptions.MakeNats("Injective Publisher", natsUrl, "", *nkey, *jwt, "", "", "")
ctx, _ := signal.NotifyContext(context.Background(), os.Interrupt)

options := []publisherOptions.Option{
Expand Down

0 comments on commit 675d11e

Please sign in to comment.