// LoadConfig reads config from config.json file.
LoadConfig reads config from config.json file.
// LoadConfig reads config from config . json file .
func LoadConfig(nodeAddr, p2pPort string) (*Config, error) {
	configPath := configFilePath()
	config := &Config{}
	configFile, err := os.Open(configPath)
	if err != nil {
		return nil, err
	}
	parser := json.NewDecoder(configFile)
	if err = parser.Decode(config); err != nil {
		return nil, err
	}
	if nodeAddr != "" {
		config.NodeAddr = nodeAddr
	}
	if p2pPort != "" {
		config.P2PPort = p2pPort
	}
	return config, nil
}
func LoadConfig ( nodeAddr , p2pPort string ) ( * Config , error ) { configPath := configFilePath ( ) config := & Config { } configFile , err := os . Open ( configPath ) if err != nil { return nil , err } parser := json . NewDecoder ( configFile ) if err = parser . Decode ( config ) ; err != nil { return nil , err } if nodeAddr != " " { config . NodeAddr = nodeAddr } if p2pPort != " " { config . P2PPort = p2pPort } return config , nil }
LoadConfig reads config from config.json file.
LoadConfig reads config from config . json file .