Ejemplo n.º 1
0
        /// <summary>
        /// Load configuration with different Environment Variable
        /// </summary>
        /// <param name="config">Configuration</param>
        /// <returns>IConfigurationRoot</returns>
        public static IConfigurationRoot LoadConfig(string config)
        {
            var env        = LyraNodeConfig.GetNetworkId();
            var configFile = string.IsNullOrWhiteSpace(env) ? $"{config}.json" : $"{config}.{env}.json";

            if (env == "devnet")
            {
                configFile = $"{config}.json";
            }

            return(new ConfigurationBuilder()
                   //.SetBasePath(Utilities.LyraDataDir)
                   .AddJsonFile(configFile, true)
                   .AddEnvironmentVariables("LYRA_")
                   .Build());
        }
Ejemplo n.º 2
0
 public LyraConfig(IConfigurationSection section)
 {
     Lyra = new LyraNodeConfig(section.GetSection("Lyra"));
 }