Hyperledger Fabric How to ping network using program

0 votes

The usual way to ping a network is by using the following command:

composer network ping -c admin@sample

I want to know how to do it with a Nodejs program?

Nov 9, 2018 in Blockchain by digger
• 26,740 points

retagged Nov 22, 2018 by Priyaj 1,135 views

1 answer to this question.

0 votes
// http://nodejs.org/api.html#_child_processes
var sys = require('sys')
var exec = require('child_process').exec;
var child;
// executes `pwd`
child = exec("pwd", function (error, stdout, stderr) {
  sys.print('stdout: ' + stdout);
  sys.print('stderr: ' + stderr);
  if (error !== null) {
    console.log('exec error: ' + error);
  }
});
// or
var sys = require('sys')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { sys.puts(stdout) }
exec("composer network ping -c admin@sample", puts);
answered Nov 9, 2018 by Omkar
• 69,220 points

Related Questions In Blockchain

0 votes
1 answer
0 votes
1 answer

How to set up Hyperledger Fabric v0.6 network without docker?

Hyperledger Fabric v0.6 does not provide any ...READ MORE

answered Jul 9, 2018 in Blockchain by slayer
• 29,370 points
1,365 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,740 points
1,004 views
+1 vote
1 answer
0 votes
1 answer

Hyperledger Fabric: How to create wallet using program?

You can do this by passing some ...READ MORE

answered Oct 31, 2018 in Blockchain by Omkar
• 69,220 points
2,125 views
0 votes
1 answer

Hyperledger Fabric: How to get transaction history using key?

history, err := stub.GetHistoryForKey(key_value) for history.HasNext() { ...READ MORE

answered Nov 20, 2018 in Blockchain by Omkar
• 69,220 points
3,534 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP