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,550 points

retagged Nov 22, 2018 by Priyaj 149 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
• 67,660 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,170 points
364 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
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,550 points
81 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
• 67,660 points
517 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
• 67,660 points
797 views