public NotificationTester() { Address = "http://localhost:" + ServerTester.FindFreePort() + "/"; _Disposables.Add(WebApp.Start(Address, app => { app.Run(context => { context.Response.ContentType = "text/plain"; var notif = new NotificationRequest(context); _Requests.Add(notif); return(notif.Task); }); })); }
public ListenerTester(ServerTester tester) { _Network = tester.Configuration.Indexer.Network; Random rand = new Random(); _Server = tester; _Server._disposables.Add(this); _Listener = new QBitNinjaListener(_Server.Configuration); _NodeServer = new NodeServer(_Server.Configuration.Indexer.Network, internalPort: rand.Next(20000, 50000)); _NodeListener = new EventLoopMessageListener <IncomingMessage>(NewNodeMessage); _NodeServer.ExternalEndpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), _NodeServer.LocalEndpoint.Port); _NodeServer.AllowLocalPeers = true; _NodeServer.IsRelay = true; _NodeServer.AllMessages.AddMessageListener(_NodeListener); _NodeServer.Listen(); _Listener.Configuration.Indexer.Node = "127.0.0.1:" + _NodeServer.LocalEndpoint.Port; _Listener.Listen(); _Server.ChainBuilder.SkipIndexer = true; _Server.ChainBuilder.NewBlock += ChainBuilder_NewBlock; _Server.ChainBuilder.NewTransaction += ChainBuilder_NewTransaction; }
public ChainBuilder(ServerTester serverTester) { _parent = serverTester; _Network = serverTester.Configuration.Indexer.Network; Chain = new ConcurrentChain(_Network); }
public ChainBuilder(ServerTester serverTester) { _parent = serverTester; Chain = new ConcurrentChain(Network.TestNet); }