Using gRPC in cTrader doesn't work

Created at 15 Aug 2022, 21:28
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JO

JonasKn

Joined 24.03.2022

Using gRPC in cTrader doesn't work
15 Aug 2022, 21:28


Hello cTrader Community,

currently I'm playing around with the cAlgo API. Inside the cTrader everythings working fine, but my new project consists of two components. One cTrader Bot and a second application with a selfmade GUI (without graphs). I tried the simplest gRPC sample (Greetings) I could found, but even with this example the communication out of the cTrader isn't possible. Outside the cTrader the example works out of the box.

cTrader Clientside:

        [Parameter(DefaultValue = "Hello world!")]
        Handler messageHandler;
        protected override void OnStart()
        {
            // To learn more about cTrader Automate visit our Help Center:
            // https://help.ctrader.com/ctrader-automate
            Print("start");
            using var channel = GrpcChannel.ForAddress("http://localhost:5001");
            var client = new Greeter.GreeterClient(channel);
            Task.Run(async () => await client.SayHelloAsync(new HelloRequest { Name =         "GreeterClient" }));

            Print("Shutting down");
        }

The server side is just like in the example: https://github.com/grpc/grpc-dotnet/tree/master/examples/Greeter ("I just changed it to http")

Is there any restrictions oder any reason why this or any kind of communication doesn't work?

EDIT: 

In the meantime I tried several ways to implement it, be it pipes, TCP sockets and several different libraries. Nothing seems to work although I have included all libraries

 

I appreciate any advice you can give me.

Best regards

Jonas

 


@JonasKn
Replies

PanagiotisCharalampous
16 Aug 2022, 09:26

Hi Jonas,

Make sure your cBot has full access rights.

[Robot(TimeZone = TimeZones.GMTStandardTime, AccessRights = AccessRights.FullAccess)]

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

JonasKn
17 Aug 2022, 01:14

RE:

PanagiotisCharalampous said:

Hi Jonas,

Make sure your cBot has full access rights.

[Robot(TimeZone = TimeZones.GMTStandardTime, AccessRights = AccessRights.FullAccess)]

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Thank you very much, Panagiotis. It was indeed because of that. It now works as it should!

 

BR

Jonas


@JonasKn