public void Start()
        {
            StringBuilder config = new StringBuilder();

            config.AppendLine($"port={Port}");
            config.AppendLine($"rpcuser={RPCUser}");
            config.AppendLine($"rpcpassword={RPCPassword}");
            config.AppendLine($"rpcurl={RPCURL}");
            config.AppendLine($"clightning={CLightning}");
            Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");

            string conf = System.IO.Path.Combine(Directory, "settings.conf");

            System.IO.Directory.CreateDirectory(Directory);
            File.Create(conf).Close();
            File.WriteAllText(conf, config.ToString());
            var parameters = new[] { "--datadir", Directory, "--conf", conf };

            var iconf = new DefaultConfigurationBase()
            {
                Actor = P2PHost
            }.CreateConfiguration(parameters);
            var services = new ServiceCollection();

            StartupDefault.ConfigureServices(iconf, services);
            ServiceProvider = services.BuildServiceProvider();
        }
Beispiel #2
0
 public void Configure(
     IApplicationBuilder app,
     IHostingEnvironment env,
     ILoggerFactory loggerFactory)
 {
     StartupDefault.Configure(app, env, loggerFactory);
     Logs.Configure(loggerFactory);
 }
Beispiel #3
0
 public void ConfigureServices(IServiceCollection services)
 {
     StartupDefault.ConfigureServices(_Configuration, services);
 }