How to communicate gRPC example working with Node.js?

0 votes

Hi Guys,

I am working as a Node.js developer. I am trying to understand how to communicate with a gRPC server. It seems I have to load any .proto files you provided and load protoDescriptor to work with the client. 

Actually, with the example below am not able to load proto files because proto-loader mess up with Google APIs importing.

var PROTO_PATH = __dirname + '/../protos/';

var grpc = require('grpc');
var protoLoader = require('@grpc/proto-loader');
var packageDefinition = protoLoader.loadSync(PROTO_PATH + 'internal.proto');

//{keepCase: true,
// longs: String,
// enums: String,
// defaults: true,
// oneofs: true
var protoDescriptor =  grpc.loadPackageDefinition(packageDefinition);
// The protoDescriptor object has the full package hierarchy
var api_proto = protoDescriptor.api;


function main() {
var client = new api_proto.InternalService('',
var body = JSON.stringify({ username: "admin", password: "password" })

client.Login({}, function(err, response) {
console.log('loginresponse:', response.message);


Would be great if you can provide an example that can work with Lora-app-server gRPC.

Thanks & Regards

Dec 5, 2018 in Others by camillelola
• 140 points

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Others

0 votes
1 answer

How do I start studying Node.JS to create a restful API?

Node.js is an open source server environment ...READ MORE

answered Jun 10 in Others by ArchanaNagur
• 2,110 points
0 votes
1 answer
0 votes
1 answer

Why and when to use Node.js?

The major reason why they are going ...READ MORE

answered Jun 14 in Others by sunshine
• 1,160 points

edited Jun 14 by sunshine 22 views
+1 vote
0 answers
0 votes
1 answer

How to check if array is multidimensional or not?

Since the 'second dimension' could be just ...READ MORE

answered Nov 5, 2018 in Others by DataKing99
• 8,100 points
0 votes
1 answer

How is machine learning used to detect objects?

To understand the surrounding environment in real ...READ MORE

answered Nov 30, 2018 in Others by Kailash
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
0 votes
1 answer
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,320 points