Exemple #1
0
        public static ITradeBot CreateBot(string[] args)
        {
            var tradeBot = new TradeBotBuilder(args)
                           .Configure(config =>
            {
                config.SetBasePath(Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json", optional: true)
                .AddJsonFile("appsettings.dev.json", optional: true)
                .AddEnvironmentVariables();
            })
                           .ConfigureServices(services =>
            {
                services.AddLogging((loggerFactory) =>
                                    loggerFactory
                                    .AddConsole()
                                    .AddDebug()
                                    .SetMinimumLevel(LogLevel.Debug));
                services.AddSingleton(typeof(ILogger <>), typeof(Logger <>));
                services.AddSingleton <IEmailHelper, EmailHelper>();
            })
                           .UseCommandLine()
                           .AddDockerSecret("Email.ApiKey", "Email:ApiKey")
                           .AddDockerSecret("BinanceAccount.API_KEY", "BinanceAccount:API_KEY")
                           .AddDockerSecret("BinanceAccount.API_SECRET", "BinanceAccount.API_SECRET")
                           .AddDockerSecret("BittrexAccount.API_KEY", "BittrexAccount.API_key")
                           .AddDockerSecret("BittrexAccount.API_SECRET", "BittrexAccount.API_SECRET")
                           .Build();

            return(tradeBot);
        }
Exemple #2
0
        public static ITradeBot CreateBot(string[] args)
        {
            var tradeBot = new TradeBotBuilder()
                           .Configure(config =>
            {
                config.SetBasePath(Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json", optional: true)
                .AddJsonFile("appsettings.dev.json", optional: true)
                .AddEnvironmentVariables();
            })
                           .UseCommandLine(args)
                           .Build();

            return(tradeBot);
        }