public ElasticGridNetworkTests(ILoggable logger, IElasticNode node, IPeerList peers, PrivateKey nodeKey)
 {
     Logger  = logger;
     Node    = node;
     Peers   = peers;
     NodeKey = nodeKey;
 }
        public void Start(int port, int acceptWorkers, CancellationTokenSource cts)
        {
            this.cts = cts;

            string host = Configuration.GetValue("Host", TcpHelper.ANY);

            if (port <= 0)
            {
                port = Configuration.GetValue("Port", 9000);
            }

            NodeKey  = PeerListClient.MasterKey.CKD($"{host}:{port}");
            EndPoint = new ElasticAddress(NodeKey.Address, host, port);

            // start catalog service
            PeerListClient.Start(NodeKey, EndPoint);

            // Elastic Node Host start
            ElasticNode = new ElasticNode(Configuration, Logger, Peers, NodeKey, EndPoint)
            {
                OnMessage = OnElasticMessage
            };
            ElasticNode.Start(cts);

            // ElasticGridNetworkTests
            Test = new ElasticGridNetworkTests(Logger, ElasticNode, Peers, NodeKey);
        }