@kyve/core-beta
Version:
🚀 The base KYVE node implementation.
30 lines (29 loc) • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateVersion = void 0;
const __1 = require("../..");
/**
* validateVersion checks if the version of the pool matches with the runtime
* version of the node. If it does not match the node will exit.
*
* @method validateVersion
* @param {Node} this
* @return {void}
*/
function validateVersion() {
try {
this.logger.debug(`Comparing pool runtime version with protocol node runtime version`);
if (this.pool.data.protocol.version !== this.runtime.version) {
this.logger.fatal(`Running an invalid version. Exiting ...`);
this.logger.fatal(`Found Runtime version = ${this.runtime.version} required = ${this.pool.data.protocol.version}`);
process.exit(1);
}
this.logger.info(`Node running on runtime version = ${this.runtime.version}`);
}
catch (err) {
this.logger.fatal(`Error while validating runtime version. Exiting ...`);
this.logger.fatal((0, __1.standardizeJSON)(err));
process.exit(1);
}
}
exports.validateVersion = validateVersion;