add check for ipfs

This commit is contained in:
Iuri Matias 2016-10-02 19:43:19 -04:00
parent a19a690d3d
commit 47736b6eed
1 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,6 @@
var Web3 = require('web3');
var async = require('async');
var request = require('request');
var ServicesMonitor = function(options) {
this.logger = options.logger;
@ -41,8 +42,15 @@ ServicesMonitor.prototype.check = function() {
},
function checkIPFS(result, callback) {
self.logger.trace('checkIPFS');
result.push('IPFS'.green);
callback(null, result);
request('http://localhost:5001', function(error, response, body) {
if (error) {
result.push('IPFS'.red);
} else {
result.push('IPFS'.green);
}
callback(null, result);
});
},
function checkDevServer(result, callback) {
self.logger.trace('checkDevServer');