test if client version is supported, warn if not or can't determine

This commit is contained in:
Michael Bradley, Jr 2018-10-29 14:45:26 +01:00
parent 901d1f8e32
commit 09a5ea8ba1
1 changed files with 7 additions and 0 deletions

View File

@ -305,6 +305,13 @@ Blockchain.prototype.isClientInstalled = function (callback) {
if (err || !stdout || stderr.indexOf("not found") >= 0 || stdout.indexOf("not found") >= 0) {
return callback(__('Ethereum client bin not found:') + ' ' + this.client.getBinaryPath());
}
const parsedVersion = this.client.parseVersion(stdout);
const supported = this.client.isSupportedVersion(parsedVersion);
if (supported === undefined) {
this.logger.error((__('WARNING! Ethereum client version could not be determined or compared with version range') + ' ' + this.client.versSupported + __(', for best results please use a supported version')).yellow);
} else if (!supported) {
this.logger.error((__('WARNING! Ethereum client version unsupported, for best results please use a version in range') + ' ' + this.client.versSupported).yellow);
}
callback();
});
};