Skip to content

Commit

Permalink
add global config for env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
aydinnyunus committed Jun 23, 2024
1 parent c034567 commit 61e98a8
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEO4J_USERNAME=neo4j
NEO4J_PASS=letmein
6 changes: 4 additions & 2 deletions cli/command/repository/consts.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package repository

import "time"
import (
"time"
)

const (
BtcNetwork = 1
Expand All @@ -14,7 +16,7 @@ const (

var (
Neo4jUri = getEnv("NEO4J_URI", "neo4j://localhost:7687")
Neo4jUser = getEnv("NEO4J_USER", "neo4j")
Neo4jUser = getEnv("NEO4J_USERNAME", "neo4j")
Neo4jPass = getEnv("NEO4J_PASS", "letmein")
exchange = []string{"uniswap", "bitfinex"}
SatoshiToBitcoin = float64(100000000)
Expand Down
7 changes: 7 additions & 0 deletions cmd/wallet-tracker/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"github.com/joho/godotenv"
"log"
"os"

"github.com/spf13/cobra"
Expand All @@ -11,6 +13,11 @@ import (
var rootCmd *cobra.Command

func main() {
err := godotenv.Load()
if err != nil {
log.Fatalf("Error loading .env file")
}

rootCmd = commands.NewWalletTrackerCommand()
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
volumes:
- ./neo4j/data:/data
environment:
- NEO4J_AUTH=neo4j/letmein
- NEO4J_AUTH=${NEO4J_USERNAME}/${NEO4J_PASS}
- NEO4JLABS_PLUGINS=["apoc", "graph-data-science"]
- NEO4J_dbms_security_procedures_unrestricted=apoc.*,gds.*
- NEO4J_dbms_memory_heap_initial__size=4G
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ require (
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
Expand Down

0 comments on commit 61e98a8

Please sign in to comment.