Copying the mailing list.

On Thu, Apr 5, 2018 at 11:34 PM Patrick Chugh <m...@patrickchugh.com> wrote:

> Hello Michael,
>
>
> Sorry to trouble you again, can you please help me by checking the code
> below? It works fine under the native C++ wrapper but when I switch to the
> new pure JS version the final call back never fires. Any help / direction
> would be greatly appreciated.
>
>
> process.env.GRPC_SSL_CIPHER_SUITES='ECDHE-ECDSA-AES128-GCM-SHA256'
> // Old Way: var grpc = require('grpc');
> var grpc= require('@grpc/grpc-js');
> var fs = require("fs");
> var protoLoader = require("./proto-loader.js");
> var lndCert = fs.readFileSync(
> "/Users/patrickchugh/Dropbox/Dev/nodejs/tls.cert");
> var macfile = fs.readFileSync(
> "/Users/patrickchugh/Dropbox/Dev/nodejs/admin.macaroon");
> var macaroon = macfile.toString('hex');
> let metadata = new grpc.Metadata();
> metadata.add('macaroon', macaroon);
> let macaroonCreds = grpc.credentials.createFromMetadataGenerator((params,
> callback) =>
> callback(null, metadata)
> );
> //Combine SSL + macaroon metadata in the headers
> var sslCreds = grpc.credentials.createSsl(lndCert);
> var credentials = grpc.credentials.combineChannelCredentials(sslCreds,
> macaroonCreds);
> // Old Way: var lnrpcDescriptor = grpc.load('rpc.proto');
> var packageDefinition = protoLoader.loadSync('rpc.proto', []);
> var lnrpcDescriptor = grpc.loadPackageDefinition(packageDefinition);
> var lnrpc = lnrpcDescriptor.lnrpc;
> var lightning = new lnrpc.Lightning('34.232.232.166:10009', credentials);
> lightning.getInfo({}, function(err, response) {
> console.log('GetInfo:', response);
> });
>
> --
>
> With Gratitude,
> Patrick Chughhttp://www.patrickchugh.com
>
> 8/F, Unit A, Cambridge House, Taikoo Place,979 King's Road 
> <https://maps.google.com/?q=979+King's+Road&entry=gmail&source=g>, Island 
> East,
> Quarry Bay, Hong Kong.
>
> Tel: 852.2293.2478
> Fax: 852.3020.1834
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAO8e_2LfX9UEhhDGSkp%3D_MsZsMLyDQEJc9vW9x-utrVwtAhjHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to