public async Task StartAsync(int listeningPort)
        {
            _server = new global::Grpc.Core.Server
            {
                Ports =
                {
                    new ServerPort(IPAddress.Any.ToString(), listeningPort, ServerCredentials.Insecure)
                },
                Services =
                {
                    ParentChainRpc.BindService(_grpcParentChainServerBase),
                    SideChainRpc.BindService(_grpcSideChainServerBase),
                    BasicCrossChainRpc.BindService(_grpcBasicServerBase)
                }
            };

            await Task.Run(() => _server.Start());

            Logger.LogInformation($"Grpc cross chain server started, listening at {listeningPort}");
            IsStarted = true;
        }
Example #2
0
        public async Task StartAsync(string localServerHost, int localServerPort)
        {
            _server = new Server
            {
                Ports =
                {
                    new ServerPort(localServerHost, localServerPort, ServerCredentials.Insecure)
                },
                Services =
                {
                    ParentChainRpc.BindService(_grpcParentChainServerBase),
                    SideChainRpc.BindService(_grpcSideChainServerBase),
                    BasicCrossChainRpc.BindService(_grpcBasicServerBase)
                }
            };

            await Task.Run(() => _server.Start());

            Logger.LogDebug($"Grpc cross chain server started, listening at {localServerPort}");
            IsStarted = true;
        }