Ejemplo n.º 1
0
        public ListenerTester(ServerTester tester)
        {
            _Network = tester.Configuration.Indexer.Network;
            Random rand = new Random();

            _Server = tester;
            _Server._disposables.Add(this);
            _Listener = new RapidBaseListener(_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;
        }
Ejemplo n.º 2
0
 public ChainBuilder(ServerTester serverTester)
 {
     _parent = serverTester;
     Chain   = new ConcurrentChain(Network.TestNet);
 }