From 675d11e43e6be8f1b053f572c5308e1e786a57c2 Mon Sep 17 00:00:00 2001 From: povilaszvaliauskas Date: Mon, 29 Apr 2024 19:54:37 +0300 Subject: [PATCH] improve logging on nats variables --- injective-chain/app/app.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/injective-chain/app/app.go b/injective-chain/app/app.go index 6bb4a2b..0ce1996 100644 --- a/injective-chain/app/app.go +++ b/injective-chain/app/app.go @@ -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) @@ -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{