MCPcopy Create free account
hub / github.com/DOSNetwork/core / LoadConfig

Method LoadConfig

configuration/config.go:71–92  ·  view source on GitHub ↗

LoadConfig loads configuration file from path.

()

Source from the content-addressed store, hash-verified

69
70// LoadConfig loads configuration file from path.
71func (c *Config) LoadConfig() (err error) {
72 path = os.Getenv(envConfigPath)
73 if path == "" {
74 path, err = os.Getwd()
75 if err != nil {
76 return
77 }
78 if path == "/" {
79 path = "."
80 }
81 }
82 path = path + "/config.json"
83
84 err = LoadConfig(path, c)
85 if err != nil {
86 fmt.Println("LoadConfig err", err)
87 return
88 }
89 err = c.overWrite()
90
91 return
92}
93
94func (c *Config) overWrite() (err error) {
95 ip := os.Getenv(envNodeIP)

Callers 4

actionStartFunction · 0.95
TestOffChainReadConfigFunction · 0.80
TestOnChainReadConfigFunction · 0.80
TestOnChainUpdateFunction · 0.80

Calls 2

overWriteMethod · 0.95
LoadConfigFunction · 0.85

Tested by 3

TestOffChainReadConfigFunction · 0.64
TestOnChainReadConfigFunction · 0.64
TestOnChainUpdateFunction · 0.64