// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, P2PServer p2PServer) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseAuthentication(); app.UseMvc(); string peersCSV = Configuration["Peers"]; p2PServer.PopulatePeers(peersCSV); p2PServer.Listen(); }
public Program(BlockChain _blcokchain, P2PServer _p2pServer, IConfiguration Configuration) { int PORT = 55051; string IP = "127.0.0.1"; blockchain = _blcokchain; p2pServer = _p2pServer; p2pServer.IP = IP; p2pServer.PORT = PORT; string csvPeers = Configuration["Peers"]; p2pServer.PopulatePeers(csvPeers); }