-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from NetSepio/rushikesh
chain name fix
- Loading branch information
Showing
3 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package core | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
"github.com/joho/godotenv" | ||
) | ||
|
||
var ChainName string | ||
|
||
// Function to load the chain name from the environment and save it to the global variable | ||
func LoadChainName() { | ||
// Load environment variables from the .env file | ||
err := godotenv.Load() | ||
if err != nil { | ||
log.Fatalf("Error loading .env file") | ||
} | ||
|
||
// Get the CHAIN_NAME variable from the environment | ||
ChainName = os.Getenv("CHAIN_NAME") | ||
if ChainName == "" { | ||
log.Fatalf("CHAIN_NAME environment variable is not set") | ||
} | ||
fmt.Printf("Chain Name: %s\n", ChainName) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters