Exemplo n.º 1
0
        /// <summary>
        /// 启动服务
        /// </summary>
        public void Start()
        {
            GrpcServer server = new GrpcServer(_config.LocalAddress.Split(':')[0], int.Parse(_config.LocalAddress.Split(':')[1]), _config.ClusterToken, new DebugConsole());

            server.Register(typeof(IHost), typeof(Host), _host);
            server.Start().Wait();

            DebugConsole.WriteLine("Raft is Running...");
            DebugConsole.WriteLine($"NodeId:{_config.NodeId} name:{_config.NodeName} address:{_config.LocalAddress}...");
        }