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